Upgrade Scintilla from v3.56 to v4.14
20
scintilla/CONTRIBUTING
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
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.
|
@ -6,9 +6,11 @@ To build SciTE, Scintilla must first be built.
|
|||||||
|
|
||||||
*** GTK+/Linux version ***
|
*** GTK+/Linux version ***
|
||||||
|
|
||||||
You must first have GTK+ 2.0 or later and GCC (4.1 or better) installed.
|
You must first have GTK+ 2.24 or later and GCC (7.1 or better) installed.
|
||||||
GTK+ 1.x will not work.
|
Clang may be used by adding CLANG=1 to the make command line.
|
||||||
Other C++ compilers may work but may require tweaking the make file.
|
Other C++ compilers may work but may require tweaking the make file.
|
||||||
|
Either GTK+ 2.x or 3.x may be used with 2.x the default and 3.x
|
||||||
|
chosen with the make argument GTK3=1.
|
||||||
|
|
||||||
To build Scintilla, use the makefile located in the scintilla/gtk directory
|
To build Scintilla, use the makefile located in the scintilla/gtk directory
|
||||||
cd scintilla/gtk
|
cd scintilla/gtk
|
||||||
@ -18,7 +20,7 @@ To build Scintilla, use the makefile located in the scintilla/gtk directory
|
|||||||
To build and install SciTE, use the makefile located in the scite/gtk directory
|
To build and install SciTE, use the makefile located in the scite/gtk directory
|
||||||
cd scite/gtk
|
cd scite/gtk
|
||||||
make
|
make
|
||||||
make install
|
sudo make install
|
||||||
|
|
||||||
This installs SciTE into $prefix/bin. The value of $prefix is determined from
|
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
|
the location of Gnome if it is installed. This is usually /usr if installed
|
||||||
@ -30,7 +32,7 @@ properties file is installed at $prefix/share/scite/SciTEGlobal.properties.
|
|||||||
The language specific properties files are also installed into this directory.
|
The language specific properties files are also installed into this directory.
|
||||||
|
|
||||||
To remove SciTE
|
To remove SciTE
|
||||||
make uninstall
|
sudo make uninstall
|
||||||
|
|
||||||
To clean the object files which may be needed to change $prefix
|
To clean the object files which may be needed to change $prefix
|
||||||
make clean
|
make clean
|
||||||
@ -40,28 +42,44 @@ The current make file only supports static linking between SciTE and Scintilla.
|
|||||||
|
|
||||||
*** Windows version ***
|
*** Windows version ***
|
||||||
|
|
||||||
A C++ compiler is required. Visual Studio 2010 is the development system
|
A C++ 17 compiler is required.
|
||||||
used for most development although TDM Mingw32 4.7.1 is also supported.
|
Visual Studio 2017 is the development system used for most development
|
||||||
|
although Mingw-w64 7.1 is also supported.
|
||||||
|
|
||||||
To build Scintilla, make in the scintilla/win32 directory
|
To build Scintilla, make in the scintilla/win32 directory
|
||||||
cd scintilla\win32
|
cd scintilla\win32
|
||||||
GCC: mingw32-make
|
GCC: mingw32-make
|
||||||
VS .NET: nmake -f scintilla.mak
|
Visual C++: nmake -f scintilla.mak
|
||||||
cd ..\..
|
cd ..\..
|
||||||
|
|
||||||
To build SciTE, use the makefiles located in the scite/win32 directory
|
To build SciTE, use the makefiles located in the scite/win32 directory
|
||||||
cd scite\win32
|
cd scite\win32
|
||||||
GCC: mingw32-make
|
GCC: mingw32-make
|
||||||
VS .NET: nmake -f scite.mak
|
Visual C++: nmake -f scite.mak
|
||||||
|
|
||||||
An executable SciTE will now be in scite/bin.
|
An executable SciTE will now be in scite/bin.
|
||||||
|
|
||||||
*** GTK+/Windows version ***
|
*** GTK+/Windows version ***
|
||||||
|
|
||||||
Mingw32 is known to work. Other compilers will probably not work.
|
Mingw-w64 is known to work. Other compilers will probably not work.
|
||||||
|
|
||||||
Only Scintilla will build with GTK+ on Windows. SciTE will not work.
|
Only Scintilla will build with GTK+ on Windows. SciTE will not work.
|
||||||
|
|
||||||
To build Scintilla, make in the scintilla/gtk directory
|
To build Scintilla, make in the scintilla/gtk directory
|
||||||
cd scintilla\gtk
|
cd scintilla\gtk
|
||||||
mingw32-make
|
mingw32-make
|
||||||
|
|
||||||
|
*** macOS Cocoa version ***
|
||||||
|
|
||||||
|
Xcode 9.2 or later may be used to build Scintilla on macOS.
|
||||||
|
|
||||||
|
There is no open source version of SciTE for macOS 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.
|
||||||
|
BIN
scintilla/bin/libscintilla.lib
Normal file
@ -1,9 +1,7 @@
|
|||||||
#ifndef ANSIDOCUMENTITERATOR_H_12481491281240
|
#ifndef ANSIDOCUMENTITERATOR_H_12481491281240
|
||||||
#define ANSIDOCUMENTITERATOR_H_12481491281240
|
#define ANSIDOCUMENTITERATOR_H_12481491281240
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
namespace Scintilla {
|
namespace Scintilla {
|
||||||
#endif
|
|
||||||
|
|
||||||
class AnsiDocumentIterator : public std::iterator<std::bidirectional_iterator_tag, char>
|
class AnsiDocumentIterator : public std::iterator<std::bidirectional_iterator_tag, char>
|
||||||
{
|
{
|
||||||
@ -94,9 +92,6 @@ private:
|
|||||||
int m_end;
|
int m_end;
|
||||||
Document* m_doc;
|
Document* m_doc;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -4,17 +4,26 @@
|
|||||||
* Converted from boost::xpressive to boost::regex and performance improvements
|
* Converted from boost::xpressive to boost::regex and performance improvements
|
||||||
* (principally caching the compiled regex), and support for UTF8 encoded text
|
* (principally caching the compiled regex), and support for UTF8 encoded text
|
||||||
* (c) 2012 Dave Brotherstone - Changes for boost::regex
|
* (c) 2012 Dave Brotherstone - Changes for boost::regex
|
||||||
* (c) 2013 Francois-R.Boyer@PolyMtl.ca - Empty match modes and best match backward search.
|
* (c) 2013 Francois-R.Boyer@PolyMtl.ca - Empty match modes and best match backward search
|
||||||
|
* (c) 2019 Don Ho - Adapt for upgrading Scitilla (to version 4.1.4) and boost (to version 1.70)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "scintilla.h"
|
|
||||||
|
#include "Scintilla.h"
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
|
#include "ILoader.h"
|
||||||
|
#include "ILexer.h"
|
||||||
|
#include "Position.h"
|
||||||
|
#include "UniqueString.h"
|
||||||
#include "SplitVector.h"
|
#include "SplitVector.h"
|
||||||
#include "Partitioning.h"
|
#include "Partitioning.h"
|
||||||
#include "RunStyles.h"
|
#include "RunStyles.h"
|
||||||
|
#include "ContractionState.h"
|
||||||
|
|
||||||
#include "CellBuffer.h"
|
#include "CellBuffer.h"
|
||||||
#include "CharClassify.h"
|
#include "CharClassify.h"
|
||||||
#include "Decoration.h"
|
#include "Decoration.h"
|
||||||
@ -29,12 +38,9 @@
|
|||||||
#define CP_UTF8 65001
|
#define CP_UTF8 65001
|
||||||
#define SC_CP_UTF8 65001
|
#define SC_CP_UTF8 65001
|
||||||
|
|
||||||
|
#define _SILENCE_ALL_CXX17_DEPRECATION_WARNI
|
||||||
|
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace boost;
|
using namespace boost;
|
||||||
|
|
||||||
class BoostRegexSearch : public RegexSearchBase
|
class BoostRegexSearch : public RegexSearchBase
|
||||||
@ -48,7 +54,7 @@ public:
|
|||||||
_substituted = NULL;
|
_substituted = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual long FindText(Document* doc, int startPosition, int endPosition, const char *regex,
|
virtual Sci::Position FindText(Document* doc, Sci::Position minPos, Sci::Position maxPos, const char *regex,
|
||||||
bool caseSensitive, bool word, bool wordStart, int sciSearchFlags, int *lengthRet);
|
bool caseSensitive, bool word, bool wordStart, int sciSearchFlags, int *lengthRet);
|
||||||
|
|
||||||
virtual const char *SubstituteByPosition(Document* doc, const char *text, int *length);
|
virtual const char *SubstituteByPosition(Document* doc, const char *text, int *length);
|
||||||
@ -139,7 +145,7 @@ private:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void NotifyDeleted(Document* deletedDocument, void* /*userData*/)
|
virtual void NotifyDeleted(Document* deletedDocument, void* /*userData*/) noexcept
|
||||||
{
|
{
|
||||||
if (deletedDocument == _document)
|
if (deletedDocument == _document)
|
||||||
{
|
{
|
||||||
@ -236,28 +242,22 @@ private:
|
|||||||
int _lastDirection;
|
int _lastDirection;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
namespace Scintilla
|
namespace Scintilla
|
||||||
{
|
{
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef SCI_OWNREGEX
|
#ifdef SCI_OWNREGEX
|
||||||
RegexSearchBase *CreateRegexSearch(CharClassify* /* charClassTable */)
|
RegexSearchBase *CreateRegexSearch(CharClassify* /* charClassTable */)
|
||||||
{
|
{
|
||||||
return new BoostRegexSearch();
|
return new BoostRegexSearch();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find text in document, supporting both forward and backward
|
* Find text in document, supporting both forward and backward
|
||||||
* searches (just pass startPosition > endPosition to do a backward search).
|
* searches (just pass startPosition > endPosition to do a backward search).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
long BoostRegexSearch::FindText(Document* doc, int startPosition, int endPosition, const char *regexString,
|
Sci::Position BoostRegexSearch::FindText(Document* doc, Sci::Position startPosition, Sci::Position endPosition, const char *regexString,
|
||||||
bool caseSensitive, bool /*word*/, bool /*wordStart*/, int sciSearchFlags, int *lengthRet)
|
bool caseSensitive, bool /*word*/, bool /*wordStart*/, int sciSearchFlags, int *lengthRet)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@ -453,19 +453,21 @@ char *BoostRegexSearch::EncodingDependent<CharT, CharacterIterator>::SubstituteB
|
|||||||
wchar_t *BoostRegexSearch::utf8ToWchar(const char *utf8)
|
wchar_t *BoostRegexSearch::utf8ToWchar(const char *utf8)
|
||||||
{
|
{
|
||||||
size_t utf8Size = strlen(utf8);
|
size_t utf8Size = strlen(utf8);
|
||||||
size_t wcharSize = UTF16Length(utf8, utf8Size);
|
std::string s(utf8, utf8Size);
|
||||||
|
size_t wcharSize = UTF16Length(s);
|
||||||
wchar_t *w = new wchar_t[wcharSize + 1];
|
wchar_t *w = new wchar_t[wcharSize + 1];
|
||||||
UTF16FromUTF8(utf8, utf8Size, w, wcharSize + 1);
|
UTF16FromUTF8(s, w, wcharSize + 1);
|
||||||
w[wcharSize] = 0;
|
w[wcharSize] = 0;
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *BoostRegexSearch::wcharToUtf8(const wchar_t *w)
|
char *BoostRegexSearch::wcharToUtf8(const wchar_t *w)
|
||||||
{
|
{
|
||||||
int wcharSize = static_cast<int>(wcslen(w));
|
//int wcharSize = static_cast<int>(wcslen(w));
|
||||||
int charSize = UTF8Length(w, wcharSize);
|
std::wstring ws(w);
|
||||||
|
int charSize = UTF8Length(ws);
|
||||||
char *c = new char[charSize + 1];
|
char *c = new char[charSize + 1];
|
||||||
UTF8FromUTF16(w, wcharSize, c, charSize);
|
UTF8FromUTF16(ws, c, charSize);
|
||||||
c[charSize] = 0;
|
c[charSize] = 0;
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,84 @@
|
|||||||
#include "UTF8DocumentIterator.h"
|
#include "UTF8DocumentIterator.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
|
|
||||||
|
#include "ILoader.h"
|
||||||
|
#include "ILexer.h"
|
||||||
|
#include "Scintilla.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "CharacterCategory.h"
|
||||||
|
#include "Position.h"
|
||||||
|
#include "SplitVector.h"
|
||||||
|
#include "Partitioning.h"
|
||||||
|
#include "RunStyles.h"
|
||||||
|
#include "CellBuffer.h"
|
||||||
|
#include "CharClassify.h"
|
||||||
|
#include "Decoration.h"
|
||||||
|
#include "CaseFolder.h"
|
||||||
|
#include "Document.h"
|
||||||
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
UTF8DocumentIterator::UTF8DocumentIterator(Document* doc, int pos, int end) :
|
||||||
|
m_doc(doc),
|
||||||
|
m_pos(pos),
|
||||||
|
m_end(end),
|
||||||
|
m_characterIndex(0)
|
||||||
|
{
|
||||||
|
// Check for debug builds
|
||||||
|
PLATFORM_ASSERT(m_pos <= m_end);
|
||||||
|
|
||||||
|
// Ensure for release.
|
||||||
|
if (m_pos > m_end)
|
||||||
|
{
|
||||||
|
m_pos = m_end;
|
||||||
|
}
|
||||||
|
readCharacter();
|
||||||
|
}
|
||||||
|
|
||||||
|
UTF8DocumentIterator::UTF8DocumentIterator(const UTF8DocumentIterator& copy) :
|
||||||
|
m_doc(copy.m_doc),
|
||||||
|
m_pos(copy.m_pos),
|
||||||
|
m_end(copy.m_end),
|
||||||
|
m_characterIndex(copy.m_characterIndex),
|
||||||
|
m_utf8Length(copy.m_utf8Length),
|
||||||
|
m_utf16Length(copy.m_utf16Length)
|
||||||
|
{
|
||||||
|
// Check for debug builds
|
||||||
|
PLATFORM_ASSERT(m_pos <= m_end);
|
||||||
|
m_character[0] = copy.m_character[0];
|
||||||
|
m_character[1] = copy.m_character[1];
|
||||||
|
|
||||||
|
// Ensure for release.
|
||||||
|
if (m_pos > m_end)
|
||||||
|
{
|
||||||
|
m_pos = m_end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
UTF8DocumentIterator& UTF8DocumentIterator::operator -- ()
|
||||||
|
{
|
||||||
|
if (m_utf16Length == 2 && m_characterIndex == 1)
|
||||||
|
{
|
||||||
|
m_characterIndex = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
--m_pos;
|
||||||
|
// Skip past the UTF-8 extension bytes
|
||||||
|
while (0x80 == (m_doc->CharAt(m_pos) & 0xC0) && m_pos > 0)
|
||||||
|
--m_pos;
|
||||||
|
|
||||||
|
readCharacter();
|
||||||
|
if (m_utf16Length == 2)
|
||||||
|
{
|
||||||
|
m_characterIndex = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
void UTF8DocumentIterator::readCharacter()
|
void UTF8DocumentIterator::readCharacter()
|
||||||
{
|
{
|
||||||
|
@ -5,21 +5,10 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
#include "SplitVector.h"
|
|
||||||
#include "Partitioning.h"
|
|
||||||
#include "RunStyles.h"
|
|
||||||
#include "CellBuffer.h"
|
|
||||||
#include "CharClassify.h"
|
|
||||||
#include "Decoration.h"
|
|
||||||
#include <ILexer.h>
|
|
||||||
#include "CaseFolder.h"
|
|
||||||
#include <Document.h>
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
namespace Scintilla {
|
namespace Scintilla {
|
||||||
#endif
|
|
||||||
|
|
||||||
|
class Document;
|
||||||
|
|
||||||
class UTF8DocumentIterator : public std::iterator<std::bidirectional_iterator_tag, wchar_t>
|
class UTF8DocumentIterator : public std::iterator<std::bidirectional_iterator_tag, wchar_t>
|
||||||
{
|
{
|
||||||
@ -34,42 +23,8 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
UTF8DocumentIterator(Document* doc, int pos, int end) :
|
UTF8DocumentIterator(Document* doc, int pos, int end);
|
||||||
m_doc(doc),
|
UTF8DocumentIterator(const UTF8DocumentIterator& copy);
|
||||||
m_pos(pos),
|
|
||||||
m_end(end),
|
|
||||||
m_characterIndex(0)
|
|
||||||
{
|
|
||||||
// Check for debug builds
|
|
||||||
PLATFORM_ASSERT(m_pos <= m_end);
|
|
||||||
|
|
||||||
// Ensure for release.
|
|
||||||
if (m_pos > m_end)
|
|
||||||
{
|
|
||||||
m_pos = m_end;
|
|
||||||
}
|
|
||||||
readCharacter();
|
|
||||||
}
|
|
||||||
|
|
||||||
UTF8DocumentIterator(const UTF8DocumentIterator& copy) :
|
|
||||||
m_doc(copy.m_doc),
|
|
||||||
m_pos(copy.m_pos),
|
|
||||||
m_end(copy.m_end),
|
|
||||||
m_characterIndex(copy.m_characterIndex),
|
|
||||||
m_utf8Length(copy.m_utf8Length),
|
|
||||||
m_utf16Length(copy.m_utf16Length)
|
|
||||||
{
|
|
||||||
// Check for debug builds
|
|
||||||
PLATFORM_ASSERT(m_pos <= m_end);
|
|
||||||
m_character[0] = copy.m_character[0];
|
|
||||||
m_character[1] = copy.m_character[1];
|
|
||||||
|
|
||||||
// Ensure for release.
|
|
||||||
if (m_pos > m_end)
|
|
||||||
{
|
|
||||||
m_pos = m_end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator == (const UTF8DocumentIterator& other) const
|
bool operator == (const UTF8DocumentIterator& other) const
|
||||||
{
|
{
|
||||||
@ -113,27 +68,7 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
UTF8DocumentIterator& operator -- ()
|
UTF8DocumentIterator& operator -- ();
|
||||||
{
|
|
||||||
if (m_utf16Length == 2 && m_characterIndex == 1)
|
|
||||||
{
|
|
||||||
m_characterIndex = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
--m_pos;
|
|
||||||
// Skip past the UTF-8 extension bytes
|
|
||||||
while (0x80 == (m_doc->CharAt(m_pos) & 0xC0) && m_pos > 0)
|
|
||||||
--m_pos;
|
|
||||||
|
|
||||||
readCharacter();
|
|
||||||
if (m_utf16Length == 2)
|
|
||||||
{
|
|
||||||
m_characterIndex = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
int pos() const
|
int pos() const
|
||||||
{
|
{
|
||||||
@ -159,8 +94,6 @@ private:
|
|||||||
static const unsigned char m_firstByteMask[];
|
static const unsigned char m_firstByteMask[];
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // UTF8DOCUMENTITERATOR_H_3452843291318441149
|
#endif // UTF8DOCUMENTITERATOR_H_3452843291318441149
|
||||||
|
BIN
scintilla/boostregex/libboost_regex-vc141-mt-s-x32-1_70.lib
Normal file
42
scintilla/boostregex/nppSpecifics2.mak
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
# This makefile should be included in the main scintilla.mak file,
|
||||||
|
# just after where LOBJS is defined (around line
|
||||||
|
#
|
||||||
|
# The following line should be added around line 211 of scintilla.mak
|
||||||
|
# !INCLUDE nppSpecifics.mak
|
||||||
|
|
||||||
|
# Set your boost path (the root of where you've unpacked your boost zip).
|
||||||
|
# Boost is available from www.boost.org
|
||||||
|
|
||||||
|
!IFDEF BOOSTPATH
|
||||||
|
!IFDEF BOOSTREGEXLIBPATH
|
||||||
|
|
||||||
|
SOBJS=\
|
||||||
|
$(SOBJS)\
|
||||||
|
$(DIR_O)\BoostRegexSearch.obj\
|
||||||
|
$(DIR_O)\UTF8DocumentIterator.obj
|
||||||
|
|
||||||
|
SCILEXOBJS=\
|
||||||
|
$(SCILEXOBJS)\
|
||||||
|
$(DIR_O)\BoostRegexSearch.obj\
|
||||||
|
$(DIR_O)\UTF8DocumentIterator.obj
|
||||||
|
|
||||||
|
LOBJS=\
|
||||||
|
$(LOBJS)\
|
||||||
|
$(DIR_O)\BoostRegexSearch.obj\
|
||||||
|
$(DIR_O)\UTF8DocumentIterator.obj
|
||||||
|
|
||||||
|
INCLUDEDIRS=$(INCLUDEDIRS) -I$(BOOSTPATH)
|
||||||
|
|
||||||
|
CXXFLAGS=$(CXXFLAGS) -DSCI_OWNREGEX -arch:IA32
|
||||||
|
LDFLAGS=$(LDFLAGS) -LIBPATH:$(BOOSTREGEXLIBPATH)
|
||||||
|
|
||||||
|
|
||||||
|
$(DIR_O)\UTF8DocumentIterator.obj:: ../boostregex/UTF8DocumentIterator.cxx
|
||||||
|
$(CC) $(CXXFLAGS) -c ../boostregex/UTF8DocumentIterator.cxx
|
||||||
|
|
||||||
|
$(DIR_O)\BoostRegexSearch.obj:: ../boostregex/BoostRegexSearch.cxx ../src/CharClassify.h ../src/RESearch.h
|
||||||
|
$(CC) $(CXXFLAGS) -c ../boostregex/BoostRegexSearch.cxx
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
!ENDIF
|
||||||
|
|
@ -16,31 +16,29 @@
|
|||||||
/**
|
/**
|
||||||
* Extended text cell for vertically aligned text.
|
* Extended text cell for vertically aligned text.
|
||||||
*/
|
*/
|
||||||
@interface VerticallyCenteredTextFieldCell : NSTextFieldCell
|
@interface VerticallyCenteredTextFieldCell : NSTextFieldCell {
|
||||||
{
|
|
||||||
BOOL mIsEditingOrSelecting;
|
BOOL mIsEditingOrSelecting;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface InfoBar : NSView <InfoBarCommunicator>
|
@interface InfoBar : NSView <InfoBarCommunicator> {
|
||||||
{
|
|
||||||
@private
|
@private
|
||||||
NSImage* mBackground;
|
NSImage *mBackground;
|
||||||
IBDisplay mDisplayMask;
|
IBDisplay mDisplayMask;
|
||||||
|
|
||||||
float mScaleFactor;
|
float mScaleFactor;
|
||||||
NSPopUpButton* mZoomPopup;
|
NSPopUpButton *mZoomPopup;
|
||||||
|
|
||||||
int mCurrentCaretX;
|
int mCurrentCaretX;
|
||||||
int mCurrentCaretY;
|
int mCurrentCaretY;
|
||||||
NSTextField* mCaretPositionLabel;
|
NSTextField *mCaretPositionLabel;
|
||||||
NSTextField* mStatusTextLabel;
|
NSTextField *mStatusTextLabel;
|
||||||
|
|
||||||
id <InfoBarCommunicator> mCallback;
|
id <InfoBarCommunicator> mCallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) notify: (NotificationType) type message: (NSString*) message location: (NSPoint) location
|
- (void) notify: (NotificationType) type message: (NSString *) message location: (NSPoint) location
|
||||||
value: (float) value;
|
value: (float) value;
|
||||||
- (void) setCallback: (id <InfoBarCommunicator>) callback;
|
- (void) setCallback: (id <InfoBarCommunicator>) callback;
|
||||||
|
|
||||||
|
@ -18,23 +18,20 @@
|
|||||||
|
|
||||||
// Inspired by code from Daniel Jalkut, Red Sweater Software.
|
// Inspired by code from Daniel Jalkut, Red Sweater Software.
|
||||||
|
|
||||||
- (NSRect) drawingRectForBounds: (NSRect) theRect
|
- (NSRect) drawingRectForBounds: (NSRect) theRect {
|
||||||
{
|
|
||||||
// Get the parent's idea of where we should draw
|
// Get the parent's idea of where we should draw
|
||||||
NSRect newRect = [super drawingRectForBounds: theRect];
|
NSRect newRect = [super drawingRectForBounds: theRect];
|
||||||
|
|
||||||
// When the text field is being edited or selected, we have to turn off the magic because it
|
// 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
|
// 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.
|
// selectWithFrame and editWithFrame and sneaking a reduced, centered rect in at the last minute.
|
||||||
if (mIsEditingOrSelecting == NO)
|
if (mIsEditingOrSelecting == NO) {
|
||||||
{
|
|
||||||
// Get our ideal size for current text
|
// Get our ideal size for current text
|
||||||
NSSize textSize = [self cellSizeForBounds: theRect];
|
NSSize textSize = [self cellSizeForBounds: theRect];
|
||||||
|
|
||||||
// Center that in the proposed rect
|
// Center that in the proposed rect
|
||||||
CGFloat heightDelta = newRect.size.height - textSize.height;
|
CGFloat heightDelta = newRect.size.height - textSize.height;
|
||||||
if (heightDelta > 0)
|
if (heightDelta > 0) {
|
||||||
{
|
|
||||||
newRect.size.height -= heightDelta;
|
newRect.size.height -= heightDelta;
|
||||||
newRect.origin.y += ceil(heightDelta / 2);
|
newRect.origin.y += ceil(heightDelta / 2);
|
||||||
}
|
}
|
||||||
@ -45,9 +42,8 @@
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
- (void) selectWithFrame: (NSRect) aRect inView: (NSView*) controlView editor: (NSText*) textObj
|
- (void) selectWithFrame: (NSRect) aRect inView: (NSView *) controlView editor: (NSText *) textObj
|
||||||
delegate:(id) anObject start: (NSInteger) selStart length: (NSInteger) selLength
|
delegate: (id) anObject start: (NSInteger) selStart length: (NSInteger) selLength {
|
||||||
{
|
|
||||||
aRect = [self drawingRectForBounds: aRect];
|
aRect = [self drawingRectForBounds: aRect];
|
||||||
mIsEditingOrSelecting = YES;
|
mIsEditingOrSelecting = YES;
|
||||||
[super selectWithFrame: aRect
|
[super selectWithFrame: aRect
|
||||||
@ -61,9 +57,8 @@
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
- (void) editWithFrame: (NSRect) aRect inView: (NSView*) controlView editor: (NSText*) textObj
|
- (void) editWithFrame: (NSRect) aRect inView: (NSView *) controlView editor: (NSText *) textObj
|
||||||
delegate: (id) anObject event: (NSEvent*) theEvent
|
delegate: (id) anObject event: (NSEvent *) theEvent {
|
||||||
{
|
|
||||||
aRect = [self drawingRectForBounds: aRect];
|
aRect = [self drawingRectForBounds: aRect];
|
||||||
mIsEditingOrSelecting = YES;
|
mIsEditingOrSelecting = YES;
|
||||||
[super editWithFrame: aRect
|
[super editWithFrame: aRect
|
||||||
@ -80,16 +75,18 @@
|
|||||||
|
|
||||||
@implementation InfoBar
|
@implementation InfoBar
|
||||||
|
|
||||||
- (id) initWithFrame: (NSRect) frame
|
- (instancetype) initWithFrame: (NSRect) frame {
|
||||||
{
|
|
||||||
self = [super initWithFrame: frame];
|
self = [super initWithFrame: frame];
|
||||||
if (self)
|
if (self) {
|
||||||
{
|
NSBundle *bundle = [NSBundle bundleForClass: [InfoBar class]];
|
||||||
NSBundle* bundle = [NSBundle bundleForClass: [InfoBar class]];
|
|
||||||
|
|
||||||
NSString* path = [bundle pathForResource: @"info_bar_bg" ofType: @"tiff" inDirectory: nil];
|
NSString *path = [bundle pathForResource: @"info_bar_bg" ofType: @"tiff" inDirectory: nil];
|
||||||
|
// macOS 10.13 introduced bug where pathForResource: fails on SMB share
|
||||||
|
if (path == nil) {
|
||||||
|
path = [bundle.bundlePath stringByAppendingPathComponent: @"Resources/info_bar_bg.tiff"];
|
||||||
|
}
|
||||||
mBackground = [[NSImage alloc] initWithContentsOfFile: path];
|
mBackground = [[NSImage alloc] initWithContentsOfFile: path];
|
||||||
if (![mBackground isValid])
|
if (!mBackground.valid)
|
||||||
NSLog(@"Background image for info bar is invalid.");
|
NSLog(@"Background image for info bar is invalid.");
|
||||||
|
|
||||||
mScaleFactor = 1.0;
|
mScaleFactor = 1.0;
|
||||||
@ -110,11 +107,9 @@
|
|||||||
* @param location Carries the new location (e.g. caret) if the type is a caret change or similar type.
|
* @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.
|
* @param value Carries the new zoom value if the type is a zoom change.
|
||||||
*/
|
*/
|
||||||
- (void) notify: (NotificationType) type message: (NSString*) message location: (NSPoint) location
|
- (void) notify: (NotificationType) type message: (NSString *) message location: (NSPoint) location
|
||||||
value: (float) value
|
value: (float) value {
|
||||||
{
|
switch (type) {
|
||||||
switch (type)
|
|
||||||
{
|
|
||||||
case IBNZoomChanged:
|
case IBNZoomChanged:
|
||||||
[self setScaleFactor: value adjustPopup: YES];
|
[self setScaleFactor: value adjustPopup: YES];
|
||||||
break;
|
break;
|
||||||
@ -122,7 +117,7 @@
|
|||||||
[self setCaretPosition: location];
|
[self setCaretPosition: location];
|
||||||
break;
|
break;
|
||||||
case IBNStatusChanged:
|
case IBNStatusChanged:
|
||||||
[mStatusTextLabel setStringValue: message];
|
mStatusTextLabel.stringValue = message;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -132,8 +127,7 @@
|
|||||||
/**
|
/**
|
||||||
* Used to set a protocol object we can use to send change notifications to.
|
* Used to set a protocol object we can use to send change notifications to.
|
||||||
*/
|
*/
|
||||||
- (void) setCallback: (id <InfoBarCommunicator>) callback
|
- (void) setCallback: (id <InfoBarCommunicator>) callback {
|
||||||
{
|
|
||||||
mCallback = callback;
|
mCallback = callback;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,34 +142,32 @@ static float DefaultScaleMenuFactors[] = {
|
|||||||
static unsigned DefaultScaleMenuSelectedItemIndex = 4;
|
static unsigned DefaultScaleMenuSelectedItemIndex = 4;
|
||||||
static float BarFontSize = 10.0;
|
static float BarFontSize = 10.0;
|
||||||
|
|
||||||
- (void) createItems
|
- (void) createItems {
|
||||||
{
|
|
||||||
// 1) The zoom popup.
|
// 1) The zoom popup.
|
||||||
unsigned numberOfDefaultItems = sizeof(DefaultScaleMenuLabels) / sizeof(NSString *);
|
unsigned numberOfDefaultItems = sizeof(DefaultScaleMenuLabels) / sizeof(NSString *);
|
||||||
|
|
||||||
// Create the popup button.
|
// Create the popup button.
|
||||||
mZoomPopup = [[NSPopUpButton allocWithZone:[self zone]] initWithFrame: NSMakeRect(0.0, 0.0, 1.0, 1.0) pullsDown: NO];
|
mZoomPopup = [[NSPopUpButton alloc] initWithFrame: NSMakeRect(0.0, 0.0, 1.0, 1.0) pullsDown: NO];
|
||||||
|
|
||||||
// No border or background please.
|
// No border or background please.
|
||||||
[[mZoomPopup cell] setBordered: NO];
|
[mZoomPopup.cell setBordered: NO];
|
||||||
[[mZoomPopup cell] setArrowPosition: NSPopUpArrowAtBottom];
|
[mZoomPopup.cell setArrowPosition: NSPopUpArrowAtBottom];
|
||||||
|
|
||||||
// Fill it.
|
// Fill it.
|
||||||
for (unsigned count = 0; count < numberOfDefaultItems; count++)
|
for (unsigned count = 0; count < numberOfDefaultItems; count++) {
|
||||||
{
|
|
||||||
[mZoomPopup addItemWithTitle: NSLocalizedStringFromTable(DefaultScaleMenuLabels[count], @"ZoomValues", nil)];
|
[mZoomPopup addItemWithTitle: NSLocalizedStringFromTable(DefaultScaleMenuLabels[count], @"ZoomValues", nil)];
|
||||||
id currentItem = [mZoomPopup itemAtIndex: count];
|
id currentItem = [mZoomPopup itemAtIndex: count];
|
||||||
if (DefaultScaleMenuFactors[count] != 0.0)
|
if (DefaultScaleMenuFactors[count] != 0.0)
|
||||||
[currentItem setRepresentedObject: [NSNumber numberWithFloat: DefaultScaleMenuFactors[count]]];
|
[currentItem setRepresentedObject: @(DefaultScaleMenuFactors[count])];
|
||||||
}
|
}
|
||||||
[mZoomPopup selectItemAtIndex: DefaultScaleMenuSelectedItemIndex];
|
[mZoomPopup selectItemAtIndex: DefaultScaleMenuSelectedItemIndex];
|
||||||
|
|
||||||
// Hook it up.
|
// Hook it up.
|
||||||
[mZoomPopup setTarget: self];
|
mZoomPopup.target = self;
|
||||||
[mZoomPopup setAction: @selector(zoomItemAction:)];
|
mZoomPopup.action = @selector(zoomItemAction:);
|
||||||
|
|
||||||
// Set a suitable font.
|
// Set a suitable font.
|
||||||
[mZoomPopup setFont: [NSFont menuBarFontOfSize: BarFontSize]];
|
mZoomPopup.font = [NSFont menuBarFontOfSize: BarFontSize];
|
||||||
|
|
||||||
// Make sure the popup is big enough to fit the cells.
|
// Make sure the popup is big enough to fit the cells.
|
||||||
[mZoomPopup sizeToFit];
|
[mZoomPopup sizeToFit];
|
||||||
@ -185,7 +177,6 @@ static float BarFontSize = 10.0;
|
|||||||
|
|
||||||
// put it in the scrollview.
|
// put it in the scrollview.
|
||||||
[self addSubview: mZoomPopup];
|
[self addSubview: mZoomPopup];
|
||||||
[mZoomPopup release];
|
|
||||||
|
|
||||||
// 2) The caret position label.
|
// 2) The caret position label.
|
||||||
Class oldCellClass = [NSTextField cellClass];
|
Class oldCellClass = [NSTextField cellClass];
|
||||||
@ -197,14 +188,13 @@ static float BarFontSize = 10.0;
|
|||||||
[mCaretPositionLabel setEditable: NO];
|
[mCaretPositionLabel setEditable: NO];
|
||||||
[mCaretPositionLabel setSelectable: NO];
|
[mCaretPositionLabel setSelectable: NO];
|
||||||
[mCaretPositionLabel setDrawsBackground: NO];
|
[mCaretPositionLabel setDrawsBackground: NO];
|
||||||
[mCaretPositionLabel setFont: [NSFont menuBarFontOfSize: BarFontSize]];
|
mCaretPositionLabel.font = [NSFont menuBarFontOfSize: BarFontSize];
|
||||||
|
|
||||||
NSTextFieldCell* cell = [mCaretPositionLabel cell];
|
NSTextFieldCell *cell = mCaretPositionLabel.cell;
|
||||||
[cell setPlaceholderString: @"0:0"];
|
cell.placeholderString = @"0:0";
|
||||||
[cell setAlignment: NSCenterTextAlignment];
|
cell.alignment = NSTextAlignmentCenter;
|
||||||
|
|
||||||
[self addSubview: mCaretPositionLabel];
|
[self addSubview: mCaretPositionLabel];
|
||||||
[mCaretPositionLabel release];
|
|
||||||
|
|
||||||
// 3) The status text.
|
// 3) The status text.
|
||||||
mStatusTextLabel = [[NSTextField alloc] initWithFrame: NSMakeRect(0.0, 0.0, 1.0, 1.0)];
|
mStatusTextLabel = [[NSTextField alloc] initWithFrame: NSMakeRect(0.0, 0.0, 1.0, 1.0)];
|
||||||
@ -213,13 +203,12 @@ static float BarFontSize = 10.0;
|
|||||||
[mStatusTextLabel setEditable: NO];
|
[mStatusTextLabel setEditable: NO];
|
||||||
[mStatusTextLabel setSelectable: NO];
|
[mStatusTextLabel setSelectable: NO];
|
||||||
[mStatusTextLabel setDrawsBackground: NO];
|
[mStatusTextLabel setDrawsBackground: NO];
|
||||||
[mStatusTextLabel setFont: [NSFont menuBarFontOfSize: BarFontSize]];
|
mStatusTextLabel.font = [NSFont menuBarFontOfSize: BarFontSize];
|
||||||
|
|
||||||
cell = [mStatusTextLabel cell];
|
cell = mStatusTextLabel.cell;
|
||||||
[cell setPlaceholderString: @""];
|
cell.placeholderString = @"";
|
||||||
|
|
||||||
[self addSubview: mStatusTextLabel];
|
[self addSubview: mStatusTextLabel];
|
||||||
[mStatusTextLabel release];
|
|
||||||
|
|
||||||
// Restore original cell class so that everything else doesn't get broken
|
// Restore original cell class so that everything else doesn't get broken
|
||||||
[NSTextField setCellClass: oldCellClass];
|
[NSTextField setCellClass: oldCellClass];
|
||||||
@ -227,52 +216,46 @@ static float BarFontSize = 10.0;
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
- (void) dealloc
|
|
||||||
{
|
|
||||||
[mBackground release];
|
|
||||||
[super dealloc];
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fill the background.
|
* Fill the background.
|
||||||
*/
|
*/
|
||||||
- (void) drawRect: (NSRect) rect
|
- (void) drawRect: (NSRect) rect {
|
||||||
{
|
[[NSColor controlBackgroundColor] set];
|
||||||
|
[NSBezierPath fillRect: rect];
|
||||||
|
|
||||||
// Since the background is seamless, we don't need to take care for the proper offset.
|
// Since the background is seamless, we don't need to take care for the proper offset.
|
||||||
// Simply tile the background over the invalid rectangle.
|
// Simply tile the background over the invalid rectangle.
|
||||||
|
if (mBackground.size.width != 0) {
|
||||||
NSPoint target = {rect.origin.x, 0};
|
NSPoint target = {rect.origin.x, 0};
|
||||||
while (target.x < rect.origin.x + rect.size.width)
|
while (target.x < rect.origin.x + rect.size.width) {
|
||||||
{
|
[mBackground drawAtPoint: target fromRect: NSZeroRect operation: NSCompositingOperationSourceOver fraction: 1];
|
||||||
[mBackground drawAtPoint: target fromRect: NSZeroRect operation: NSCompositeCopy fraction: 1];
|
|
||||||
target.x += mBackground.size.width;
|
target.x += mBackground.size.width;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Draw separator lines between items.
|
// Draw separator lines between items.
|
||||||
NSRect verticalLineRect;
|
NSRect verticalLineRect;
|
||||||
CGFloat component = 190.0 / 255.0;
|
CGFloat component = 190.0 / 255.0;
|
||||||
NSColor* lineColor = [NSColor colorWithDeviceRed: component green: component blue: component alpha: 1];
|
NSColor *lineColor = [NSColor colorWithDeviceRed: component green: component blue: component alpha: 1];
|
||||||
|
|
||||||
if (mDisplayMask & IBShowZoom)
|
if (mDisplayMask & IBShowZoom) {
|
||||||
{
|
verticalLineRect = mZoomPopup.frame;
|
||||||
verticalLineRect = [mZoomPopup frame];
|
|
||||||
verticalLineRect.origin.x += verticalLineRect.size.width + 1.0;
|
verticalLineRect.origin.x += verticalLineRect.size.width + 1.0;
|
||||||
verticalLineRect.size.width = 1.0;
|
verticalLineRect.size.width = 1.0;
|
||||||
if (NSIntersectsRect(rect, verticalLineRect))
|
if (NSIntersectsRect(rect, verticalLineRect)) {
|
||||||
{
|
|
||||||
[lineColor set];
|
[lineColor set];
|
||||||
NSRectFill(verticalLineRect);
|
NSRectFill(verticalLineRect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mDisplayMask & IBShowCaretPosition)
|
if (mDisplayMask & IBShowCaretPosition) {
|
||||||
{
|
verticalLineRect = mCaretPositionLabel.frame;
|
||||||
verticalLineRect = [mCaretPositionLabel frame];
|
|
||||||
verticalLineRect.origin.x += verticalLineRect.size.width + 1.0;
|
verticalLineRect.origin.x += verticalLineRect.size.width + 1.0;
|
||||||
verticalLineRect.size.width = 1.0;
|
verticalLineRect.size.width = 1.0;
|
||||||
if (NSIntersectsRect(rect, verticalLineRect))
|
if (NSIntersectsRect(rect, verticalLineRect)) {
|
||||||
{
|
|
||||||
[lineColor set];
|
[lineColor set];
|
||||||
NSRectFill(verticalLineRect);
|
NSRectFill(verticalLineRect);
|
||||||
}
|
}
|
||||||
@ -281,8 +264,7 @@ static float BarFontSize = 10.0;
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
- (BOOL) isOpaque
|
- (BOOL) isOpaque {
|
||||||
{
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -291,45 +273,37 @@ static float BarFontSize = 10.0;
|
|||||||
/**
|
/**
|
||||||
* Used to reposition our content depending on the size of the view.
|
* Used to reposition our content depending on the size of the view.
|
||||||
*/
|
*/
|
||||||
- (void) setFrame: (NSRect) newFrame
|
- (void) setFrame: (NSRect) newFrame {
|
||||||
{
|
super.frame = newFrame;
|
||||||
[super setFrame: newFrame];
|
|
||||||
[self positionSubViews];
|
[self positionSubViews];
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
- (void) positionSubViews
|
- (void) positionSubViews {
|
||||||
{
|
NSRect currentBounds = {{0, 0}, {0, self.frame.size.height}};
|
||||||
NSRect currentBounds = {{0, 0}, {0, [self frame].size.height}};
|
if (mDisplayMask & IBShowZoom) {
|
||||||
if (mDisplayMask & IBShowZoom)
|
|
||||||
{
|
|
||||||
[mZoomPopup setHidden: NO];
|
[mZoomPopup setHidden: NO];
|
||||||
currentBounds.size.width = [mZoomPopup frame].size.width;
|
currentBounds.size.width = mZoomPopup.frame.size.width;
|
||||||
[mZoomPopup setFrame: currentBounds];
|
mZoomPopup.frame = currentBounds;
|
||||||
currentBounds.origin.x += currentBounds.size.width + 1; // Add 1 for the separator.
|
currentBounds.origin.x += currentBounds.size.width + 1; // Add 1 for the separator.
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
[mZoomPopup setHidden: YES];
|
[mZoomPopup setHidden: YES];
|
||||||
|
|
||||||
if (mDisplayMask & IBShowCaretPosition)
|
if (mDisplayMask & IBShowCaretPosition) {
|
||||||
{
|
|
||||||
[mCaretPositionLabel setHidden: NO];
|
[mCaretPositionLabel setHidden: NO];
|
||||||
currentBounds.size.width = [mCaretPositionLabel frame].size.width;
|
currentBounds.size.width = mCaretPositionLabel.frame.size.width;
|
||||||
[mCaretPositionLabel setFrame: currentBounds];
|
mCaretPositionLabel.frame = currentBounds;
|
||||||
currentBounds.origin.x += currentBounds.size.width + 1;
|
currentBounds.origin.x += currentBounds.size.width + 1;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
[mCaretPositionLabel setHidden: YES];
|
[mCaretPositionLabel setHidden: YES];
|
||||||
|
|
||||||
if (mDisplayMask & IBShowStatusText)
|
if (mDisplayMask & IBShowStatusText) {
|
||||||
{
|
|
||||||
// The status text always takes the rest of the available space.
|
// The status text always takes the rest of the available space.
|
||||||
[mStatusTextLabel setHidden: NO];
|
[mStatusTextLabel setHidden: NO];
|
||||||
currentBounds.size.width = [self frame].size.width - currentBounds.origin.x;
|
currentBounds.size.width = self.frame.size.width - currentBounds.origin.x;
|
||||||
[mStatusTextLabel setFrame: currentBounds];
|
mStatusTextLabel.frame = currentBounds;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
[mStatusTextLabel setHidden: YES];
|
[mStatusTextLabel setHidden: YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,13 +314,11 @@ static float BarFontSize = 10.0;
|
|||||||
*
|
*
|
||||||
* @param display Bitwise ORed IBDisplay values which determine what to show on the bar.
|
* @param display Bitwise ORed IBDisplay values which determine what to show on the bar.
|
||||||
*/
|
*/
|
||||||
- (void) setDisplay: (IBDisplay) display
|
- (void) setDisplay: (IBDisplay) display {
|
||||||
{
|
if (mDisplayMask != display) {
|
||||||
if (mDisplayMask != display)
|
|
||||||
{
|
|
||||||
mDisplayMask = display;
|
mDisplayMask = display;
|
||||||
[self positionSubViews];
|
[self positionSubViews];
|
||||||
[self needsDisplay];
|
self.needsDisplay = YES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -355,30 +327,23 @@ static float BarFontSize = 10.0;
|
|||||||
/**
|
/**
|
||||||
* Handler for selection changes in the zoom menu.
|
* Handler for selection changes in the zoom menu.
|
||||||
*/
|
*/
|
||||||
- (void) zoomItemAction: (id) sender
|
- (void) zoomItemAction: (id) sender {
|
||||||
{
|
NSNumber *selectedFactorObject = [[sender selectedCell] representedObject];
|
||||||
NSNumber* selectedFactorObject = [[sender selectedCell] representedObject];
|
|
||||||
|
|
||||||
if (selectedFactorObject == nil)
|
if (selectedFactorObject == nil) {
|
||||||
{
|
|
||||||
NSLog(@"Scale popup action: setting arbitrary zoom factors is not yet supported.");
|
NSLog(@"Scale popup action: setting arbitrary zoom factors is not yet supported.");
|
||||||
return;
|
return;
|
||||||
}
|
} else {
|
||||||
else
|
[self setScaleFactor: selectedFactorObject.floatValue adjustPopup: NO];
|
||||||
{
|
|
||||||
[self setScaleFactor: [selectedFactorObject floatValue] adjustPopup: NO];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
- (void) setScaleFactor: (float) newScaleFactor adjustPopup: (BOOL) flag
|
- (void) setScaleFactor: (float) newScaleFactor adjustPopup: (BOOL) flag {
|
||||||
{
|
if (mScaleFactor != newScaleFactor) {
|
||||||
if (mScaleFactor != newScaleFactor)
|
|
||||||
{
|
|
||||||
mScaleFactor = newScaleFactor;
|
mScaleFactor = newScaleFactor;
|
||||||
if (flag)
|
if (flag) {
|
||||||
{
|
|
||||||
unsigned count = 0;
|
unsigned count = 0;
|
||||||
unsigned numberOfDefaultItems = sizeof(DefaultScaleMenuFactors) / sizeof(float);
|
unsigned numberOfDefaultItems = sizeof(DefaultScaleMenuFactors) / sizeof(float);
|
||||||
|
|
||||||
@ -388,16 +353,13 @@ static float BarFontSize = 10.0;
|
|||||||
count++;
|
count++;
|
||||||
if (count == numberOfDefaultItems)
|
if (count == numberOfDefaultItems)
|
||||||
[mZoomPopup selectItemAtIndex: -1];
|
[mZoomPopup selectItemAtIndex: -1];
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
[mZoomPopup selectItemAtIndex: count];
|
[mZoomPopup selectItemAtIndex: count];
|
||||||
|
|
||||||
// Set scale factor to found preset value if it comes close.
|
// Set scale factor to found preset value if it comes close.
|
||||||
mScaleFactor = DefaultScaleMenuFactors[count];
|
mScaleFactor = DefaultScaleMenuFactors[count];
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
// Internally set. Notify owner.
|
// Internally set. Notify owner.
|
||||||
[mCallback notify: IBNZoomChanged message: nil location: NSZeroPoint value: newScaleFactor];
|
[mCallback notify: IBNZoomChanged message: nil location: NSZeroPoint value: newScaleFactor];
|
||||||
}
|
}
|
||||||
@ -409,18 +371,16 @@ static float BarFontSize = 10.0;
|
|||||||
/**
|
/**
|
||||||
* Called from the notification method to update the caret position display.
|
* Called from the notification method to update the caret position display.
|
||||||
*/
|
*/
|
||||||
- (void) setCaretPosition: (NSPoint) position
|
- (void) setCaretPosition: (NSPoint) position {
|
||||||
{
|
|
||||||
// Make the position one-based.
|
// Make the position one-based.
|
||||||
int newX = (int) position.x + 1;
|
int newX = (int) position.x + 1;
|
||||||
int newY = (int) position.y + 1;
|
int newY = (int) position.y + 1;
|
||||||
|
|
||||||
if (mCurrentCaretX != newX || mCurrentCaretY != newY)
|
if (mCurrentCaretX != newX || mCurrentCaretY != newY) {
|
||||||
{
|
|
||||||
mCurrentCaretX = newX;
|
mCurrentCaretX = newX;
|
||||||
mCurrentCaretY = newY;
|
mCurrentCaretY = newY;
|
||||||
|
|
||||||
[mCaretPositionLabel setStringValue: [NSString stringWithFormat: @"%d:%d", newX, newY]];
|
mCaretPositionLabel.stringValue = [NSString stringWithFormat: @"%d:%d", newX, newY];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -429,20 +389,19 @@ static float BarFontSize = 10.0;
|
|||||||
/**
|
/**
|
||||||
* Makes the bar resize to the smallest width that can accommodate the currently enabled items.
|
* Makes the bar resize to the smallest width that can accommodate the currently enabled items.
|
||||||
*/
|
*/
|
||||||
- (void) sizeToFit
|
- (void) sizeToFit {
|
||||||
{
|
NSRect frame = self.frame;
|
||||||
NSRect frame = [self frame];
|
|
||||||
frame.size.width = 0;
|
frame.size.width = 0;
|
||||||
if (mDisplayMask & IBShowZoom)
|
if (mDisplayMask & IBShowZoom)
|
||||||
frame.size.width += [mZoomPopup frame].size.width;
|
frame.size.width += mZoomPopup.frame.size.width;
|
||||||
|
|
||||||
if (mDisplayMask & IBShowCaretPosition)
|
if (mDisplayMask & IBShowCaretPosition)
|
||||||
frame.size.width += [mCaretPositionLabel frame].size.width;
|
frame.size.width += mCaretPositionLabel.frame.size.width;
|
||||||
|
|
||||||
if (mDisplayMask & IBShowStatusText)
|
if (mDisplayMask & IBShowStatusText)
|
||||||
frame.size.width += [mStatusTextLabel frame].size.width;
|
frame.size.width += mStatusTextLabel.frame.size.width;
|
||||||
|
|
||||||
[self setFrame: frame];
|
self.frame = frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -28,7 +28,7 @@ typedef NS_ENUM(NSInteger, NotificationType) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
@protocol InfoBarCommunicator
|
@protocol InfoBarCommunicator
|
||||||
- (void) notify: (NotificationType) type message: (NSString*) message location: (NSPoint) location
|
- (void) notify: (NotificationType) type message: (NSString *) message location: (NSPoint) location
|
||||||
value: (float) value;
|
value: (float) value;
|
||||||
- (void) setCallback: (id <InfoBarCommunicator>) callback;
|
- (void) setCallback: (id <InfoBarCommunicator>) callback;
|
||||||
@end
|
@end
|
||||||
|
@ -7,38 +7,36 @@
|
|||||||
#ifndef PLATCOCOA_H
|
#ifndef PLATCOCOA_H
|
||||||
#define PLATCOCOA_H
|
#define PLATCOCOA_H
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
#include <sys/time.h>
|
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
#include <cassert>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
|
#include <sys/time.h>
|
||||||
|
|
||||||
#include <Cocoa/Cocoa.h>
|
#include <Cocoa/Cocoa.h>
|
||||||
#include "QuartzTextLayout.h"
|
|
||||||
|
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
#include "Scintilla.h"
|
#include "Scintilla.h"
|
||||||
|
|
||||||
NSRect PRectangleToNSRect(Scintilla::PRectangle& rc);
|
#include "QuartzTextLayout.h"
|
||||||
Scintilla::PRectangle NSRectToPRectangle(NSRect& rc);
|
|
||||||
|
NSRect PRectangleToNSRect(const Scintilla::PRectangle &rc);
|
||||||
|
Scintilla::PRectangle NSRectToPRectangle(NSRect &rc);
|
||||||
CFStringEncoding EncodingFromCharacterSet(bool unicode, int characterSet);
|
CFStringEncoding EncodingFromCharacterSet(bool unicode, int characterSet);
|
||||||
|
|
||||||
@interface ScintillaContextMenu : NSMenu
|
@interface ScintillaContextMenu : NSMenu {
|
||||||
{
|
Scintilla::ScintillaCocoa *owner;
|
||||||
Scintilla::ScintillaCocoa* owner;
|
|
||||||
}
|
}
|
||||||
- (void) handleCommand: (NSMenuItem*) sender;
|
- (void) handleCommand: (NSMenuItem *) sender;
|
||||||
- (void) setOwner: (Scintilla::ScintillaCocoa*) newOwner;
|
- (void) setOwner: (Scintilla::ScintillaCocoa *) newOwner;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
namespace Scintilla {
|
namespace Scintilla {
|
||||||
|
|
||||||
// A class to do the actual text rendering for us using Quartz 2D.
|
// A class to do the actual text rendering for us using Quartz 2D.
|
||||||
class SurfaceImpl : public Surface
|
class SurfaceImpl : public Surface {
|
||||||
{
|
|
||||||
private:
|
private:
|
||||||
bool unicodeMode;
|
bool unicodeMode;
|
||||||
float x;
|
float x;
|
||||||
@ -47,75 +45,79 @@ private:
|
|||||||
CGContextRef gc;
|
CGContextRef gc;
|
||||||
|
|
||||||
/** The text layout instance */
|
/** The text layout instance */
|
||||||
QuartzTextLayout* textLayout;
|
std::unique_ptr<QuartzTextLayout> textLayout;
|
||||||
int codePage;
|
int codePage;
|
||||||
int verticalDeviceResolution;
|
int verticalDeviceResolution;
|
||||||
|
|
||||||
/** If the surface is a bitmap context, contains a reference to the bitmap data. */
|
/** If the surface is a bitmap context, contains a reference to the bitmap data. */
|
||||||
uint8_t* bitmapData;
|
std::unique_ptr<uint8_t[]> bitmapData;
|
||||||
/** If the surface is a bitmap context, stores the dimensions of the bitmap. */
|
/** If the surface is a bitmap context, stores the dimensions of the bitmap. */
|
||||||
int bitmapWidth;
|
int bitmapWidth;
|
||||||
int bitmapHeight;
|
int bitmapHeight;
|
||||||
|
|
||||||
/** Set the CGContext's fill colour to the specified desired colour. */
|
/** Set the CGContext's fill colour to the specified desired colour. */
|
||||||
void FillColour( const ColourDesired& back );
|
void FillColour(const ColourDesired &back);
|
||||||
|
|
||||||
|
|
||||||
// 24-bit RGB+A bitmap data constants
|
// 24-bit RGB+A bitmap data constants
|
||||||
static const int BITS_PER_COMPONENT = 8;
|
static const int BITS_PER_COMPONENT = 8;
|
||||||
static const int BITS_PER_PIXEL = BITS_PER_COMPONENT * 4;
|
static const int BITS_PER_PIXEL = BITS_PER_COMPONENT * 4;
|
||||||
static const int BYTES_PER_PIXEL = BITS_PER_PIXEL / 8;
|
static const int BYTES_PER_PIXEL = BITS_PER_PIXEL / 8;
|
||||||
|
|
||||||
|
void Clear();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SurfaceImpl();
|
SurfaceImpl();
|
||||||
~SurfaceImpl();
|
~SurfaceImpl() override;
|
||||||
|
|
||||||
void Init(WindowID wid);
|
void Init(WindowID wid) override;
|
||||||
void Init(SurfaceID sid, WindowID wid);
|
void Init(SurfaceID sid, WindowID wid) override;
|
||||||
void InitPixMap(int width, int height, Surface *surface_, WindowID wid);
|
void InitPixMap(int width, int height, Surface *surface_, WindowID wid) override;
|
||||||
CGContextRef GetContext() { return gc; }
|
CGContextRef GetContext() { return gc; }
|
||||||
|
|
||||||
void Release();
|
void Release() override;
|
||||||
bool Initialised();
|
bool Initialised() override;
|
||||||
void PenColour(ColourDesired fore);
|
void PenColour(ColourDesired fore) override;
|
||||||
|
|
||||||
/** Returns a CGImageRef that represents the surface. Returns NULL if this is not possible. */
|
/** Returns a CGImageRef that represents the surface. Returns NULL if this is not possible. */
|
||||||
CGImageRef GetImage();
|
CGImageRef GetImage();
|
||||||
void CopyImageRectangle(Surface &surfaceSource, PRectangle srcRect, PRectangle dstRect);
|
void CopyImageRectangle(Surface &surfaceSource, PRectangle srcRect, PRectangle dstRect);
|
||||||
|
|
||||||
int LogPixelsY();
|
int LogPixelsY() override;
|
||||||
int DeviceHeightFont(int points);
|
int DeviceHeightFont(int points) override;
|
||||||
void MoveTo(int x_, int y_);
|
void MoveTo(int x_, int y_) override;
|
||||||
void LineTo(int x_, int y_);
|
void LineTo(int x_, int y_) override;
|
||||||
void Polygon(Scintilla::Point *pts, int npts, ColourDesired fore, ColourDesired back);
|
void Polygon(Scintilla::Point *pts, size_t npts, ColourDesired fore, ColourDesired back) override;
|
||||||
void RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back);
|
void RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back) override;
|
||||||
void FillRectangle(PRectangle rc, ColourDesired back);
|
void FillRectangle(PRectangle rc, ColourDesired back) override;
|
||||||
void FillRectangle(PRectangle rc, Surface &surfacePattern);
|
void FillRectangle(PRectangle rc, Surface &surfacePattern) override;
|
||||||
void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back);
|
void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back) override;
|
||||||
void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill,
|
void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill,
|
||||||
ColourDesired outline, int alphaOutline, int flags);
|
ColourDesired outline, int alphaOutline, int flags) override;
|
||||||
void DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage);
|
void GradientRectangle(PRectangle rc, const std::vector<ColourStop> &stops, GradientOptions options) override;
|
||||||
void Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back);
|
void DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage) override;
|
||||||
void Copy(PRectangle rc, Scintilla::Point from, Surface &surfaceSource);
|
void Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back) override;
|
||||||
void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore,
|
void Copy(PRectangle rc, Scintilla::Point from, Surface &surfaceSource) override;
|
||||||
ColourDesired back);
|
std::unique_ptr<IScreenLineLayout> Layout(const IScreenLine *screenLine) override;
|
||||||
void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore,
|
void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, std::string_view text, ColourDesired fore,
|
||||||
ColourDesired back);
|
ColourDesired back) override;
|
||||||
void DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore);
|
void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, std::string_view text, ColourDesired fore,
|
||||||
void MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions);
|
ColourDesired back) override;
|
||||||
XYPOSITION WidthText(Font &font_, const char *s, int len);
|
void DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, std::string_view text, ColourDesired fore) override;
|
||||||
XYPOSITION WidthChar(Font &font_, char ch);
|
void MeasureWidths(Font &font_, std::string_view text, XYPOSITION *positions) override;
|
||||||
XYPOSITION Ascent(Font &font_);
|
XYPOSITION WidthText(Font &font_, std::string_view text) override;
|
||||||
XYPOSITION Descent(Font &font_);
|
XYPOSITION Ascent(Font &font_) override;
|
||||||
XYPOSITION InternalLeading(Font &font_);
|
XYPOSITION Descent(Font &font_) override;
|
||||||
XYPOSITION ExternalLeading(Font &font_);
|
XYPOSITION InternalLeading(Font &font_) override;
|
||||||
XYPOSITION Height(Font &font_);
|
XYPOSITION Height(Font &font_) override;
|
||||||
XYPOSITION AverageCharWidth(Font &font_);
|
XYPOSITION AverageCharWidth(Font &font_) override;
|
||||||
|
|
||||||
void SetClip(PRectangle rc);
|
void SetClip(PRectangle rc) override;
|
||||||
void FlushCachedState();
|
void FlushCachedState() override;
|
||||||
|
|
||||||
void SetUnicodeMode(bool unicodeMode_);
|
void SetUnicodeMode(bool unicodeMode_) override;
|
||||||
void SetDBCSMode(int codePage_);
|
void SetDBCSMode(int codePage_) override;
|
||||||
|
void SetBidiR2L(bool bidiR2L_) override;
|
||||||
}; // SurfaceImpl class
|
}; // SurfaceImpl class
|
||||||
|
|
||||||
} // Scintilla namespace
|
} // Scintilla namespace
|
||||||
|
@ -16,59 +16,64 @@
|
|||||||
#include "QuartzTextStyle.h"
|
#include "QuartzTextStyle.h"
|
||||||
|
|
||||||
|
|
||||||
class QuartzTextLayout
|
class QuartzTextLayout {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
/** Create a text layout for drawing on the specified context. */
|
/** Create a text layout for drawing. */
|
||||||
explicit QuartzTextLayout( CGContextRef context )
|
QuartzTextLayout() : mString(NULL), mLine(NULL), stringLength(0) {
|
||||||
{
|
|
||||||
mString = NULL;
|
|
||||||
mLine = NULL;
|
|
||||||
stringLength = 0;
|
|
||||||
setContext(context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~QuartzTextLayout()
|
~QuartzTextLayout() {
|
||||||
{
|
if (mString) {
|
||||||
if ( mString != NULL )
|
|
||||||
{
|
|
||||||
CFRelease(mString);
|
CFRelease(mString);
|
||||||
mString = NULL;
|
mString = NULL;
|
||||||
}
|
}
|
||||||
if ( mLine != NULL )
|
if (mLine) {
|
||||||
{
|
|
||||||
CFRelease(mLine);
|
CFRelease(mLine);
|
||||||
mLine = NULL;
|
mLine = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setText( const UInt8* buffer, size_t byteLength, CFStringEncoding encoding, const QuartzTextStyle& r )
|
CFStringEncoding setText(std::string_view sv, CFStringEncoding encoding, const QuartzTextStyle &r) {
|
||||||
{
|
// First clear current values in case of failure.
|
||||||
CFStringRef str = CFStringCreateWithBytes( NULL, buffer, byteLength, encoding, false );
|
if (mString) {
|
||||||
if (!str)
|
CFRelease(mString);
|
||||||
return;
|
mString = NULL;
|
||||||
|
}
|
||||||
|
if (mLine) {
|
||||||
|
CFRelease(mLine);
|
||||||
|
mLine = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
const UInt8 *puiBuffer = reinterpret_cast<const UInt8 *>(sv.data());
|
||||||
|
CFStringRef str = CFStringCreateWithBytes(NULL, puiBuffer, sv.length(), encoding, false);
|
||||||
|
if (!str) {
|
||||||
|
// Failed to decode bytes into string with given encoding so try
|
||||||
|
// MacRoman which should accept any byte.
|
||||||
|
encoding = kCFStringEncodingMacRoman;
|
||||||
|
str = CFStringCreateWithBytes(NULL, puiBuffer, sv.length(), encoding, false);
|
||||||
|
}
|
||||||
|
if (!str) {
|
||||||
|
return encoding;
|
||||||
|
}
|
||||||
|
|
||||||
stringLength = CFStringGetLength(str);
|
stringLength = CFStringGetLength(str);
|
||||||
|
|
||||||
CFMutableDictionaryRef stringAttribs = r.getCTStyle();
|
CFMutableDictionaryRef stringAttribs = r.getCTStyle();
|
||||||
|
|
||||||
if (mString != NULL)
|
|
||||||
CFRelease(mString);
|
|
||||||
mString = ::CFAttributedStringCreate(NULL, str, stringAttribs);
|
mString = ::CFAttributedStringCreate(NULL, str, stringAttribs);
|
||||||
|
|
||||||
if (mLine != NULL)
|
|
||||||
CFRelease(mLine);
|
|
||||||
mLine = ::CTLineCreateWithAttributedString(mString);
|
mLine = ::CTLineCreateWithAttributedString(mString);
|
||||||
|
|
||||||
CFRelease( str );
|
CFRelease(str);
|
||||||
|
return encoding;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Draw the text layout into the current CGContext at the specified position.
|
/** Draw the text layout into a CGContext at the specified position.
|
||||||
|
* @param gc The CGContext in which to draw the text.
|
||||||
* @param x The x axis position to draw the baseline in the current CGContext.
|
* @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. */
|
* @param y The y axis position to draw the baseline in the current CGContext. */
|
||||||
void draw( float x, float y )
|
void draw(CGContextRef gc, float x, float y) {
|
||||||
{
|
if (!mLine)
|
||||||
if (mLine == NULL)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
::CGContextSetTextMatrix(gc, CGAffineTransformMakeScale(1.0, -1.0));
|
::CGContextSetTextMatrix(gc, CGAffineTransformMakeScale(1.0, -1.0));
|
||||||
@ -80,8 +85,7 @@ public:
|
|||||||
::CTLineDraw(mLine, gc);
|
::CTLineDraw(mLine, gc);
|
||||||
}
|
}
|
||||||
|
|
||||||
float MeasureStringWidth()
|
float MeasureStringWidth() {
|
||||||
{
|
|
||||||
if (mLine == NULL)
|
if (mLine == NULL)
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
|
|
||||||
@ -96,13 +100,7 @@ public:
|
|||||||
return stringLength;
|
return stringLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setContext (CGContextRef context)
|
|
||||||
{
|
|
||||||
gc = context;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CGContextRef gc;
|
|
||||||
CFAttributedStringRef mString;
|
CFAttributedStringRef mString;
|
||||||
CTLineRef mLine;
|
CTLineRef mLine;
|
||||||
CFIndex stringLength;
|
CFIndex stringLength;
|
||||||
|
@ -10,11 +10,9 @@
|
|||||||
|
|
||||||
#include "QuartzTextStyleAttribute.h"
|
#include "QuartzTextStyleAttribute.h"
|
||||||
|
|
||||||
class QuartzTextStyle
|
class QuartzTextStyle {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
QuartzTextStyle()
|
QuartzTextStyle() {
|
||||||
{
|
|
||||||
fontRef = NULL;
|
fontRef = NULL;
|
||||||
styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2,
|
styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2,
|
||||||
&kCFTypeDictionaryKeyCallBacks,
|
&kCFTypeDictionaryKeyCallBacks,
|
||||||
@ -23,8 +21,7 @@ public:
|
|||||||
characterSet = 0;
|
characterSet = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QuartzTextStyle(const QuartzTextStyle &other)
|
QuartzTextStyle(const QuartzTextStyle &other) {
|
||||||
{
|
|
||||||
// Does not copy font colour attribute
|
// Does not copy font colour attribute
|
||||||
fontRef = static_cast<CTFontRef>(CFRetain(other.fontRef));
|
fontRef = static_cast<CTFontRef>(CFRetain(other.fontRef));
|
||||||
styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2,
|
styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2,
|
||||||
@ -34,48 +31,39 @@ public:
|
|||||||
characterSet = other.characterSet;
|
characterSet = other.characterSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
~QuartzTextStyle()
|
~QuartzTextStyle() {
|
||||||
{
|
if (styleDict != NULL) {
|
||||||
if (styleDict != NULL)
|
|
||||||
{
|
|
||||||
CFRelease(styleDict);
|
CFRelease(styleDict);
|
||||||
styleDict = NULL;
|
styleDict = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fontRef)
|
if (fontRef) {
|
||||||
{
|
|
||||||
CFRelease(fontRef);
|
CFRelease(fontRef);
|
||||||
fontRef = NULL;
|
fontRef = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CFMutableDictionaryRef getCTStyle() const
|
CFMutableDictionaryRef getCTStyle() const {
|
||||||
{
|
|
||||||
return styleDict;
|
return styleDict;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setCTStyleColor(CGColor *inColor)
|
void setCTStyleColor(CGColor *inColor) {
|
||||||
{
|
|
||||||
CFDictionarySetValue(styleDict, kCTForegroundColorAttributeName, inColor);
|
CFDictionarySetValue(styleDict, kCTForegroundColorAttributeName, inColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
float getAscent() const
|
float getAscent() const {
|
||||||
{
|
|
||||||
return static_cast<float>(::CTFontGetAscent(fontRef));
|
return static_cast<float>(::CTFontGetAscent(fontRef));
|
||||||
}
|
}
|
||||||
|
|
||||||
float getDescent() const
|
float getDescent() const {
|
||||||
{
|
|
||||||
return static_cast<float>(::CTFontGetDescent(fontRef));
|
return static_cast<float>(::CTFontGetDescent(fontRef));
|
||||||
}
|
}
|
||||||
|
|
||||||
float getLeading() const
|
float getLeading() const {
|
||||||
{
|
|
||||||
return static_cast<float>(::CTFontGetLeading(fontRef));
|
return static_cast<float>(::CTFontGetLeading(fontRef));
|
||||||
}
|
}
|
||||||
|
|
||||||
void setFontRef(CTFontRef inRef, int characterSet_)
|
void setFontRef(CTFontRef inRef, int characterSet_) {
|
||||||
{
|
|
||||||
fontRef = inRef;
|
fontRef = inRef;
|
||||||
characterSet = characterSet_;
|
characterSet = characterSet_;
|
||||||
|
|
||||||
@ -89,13 +77,11 @@ public:
|
|||||||
CFDictionaryAddValue(styleDict, kCTFontAttributeName, fontRef);
|
CFDictionaryAddValue(styleDict, kCTFontAttributeName, fontRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
CTFontRef getFontRef()
|
CTFontRef getFontRef() {
|
||||||
{
|
|
||||||
return fontRef;
|
return fontRef;
|
||||||
}
|
}
|
||||||
|
|
||||||
int getCharacterSet()
|
int getCharacterSet() {
|
||||||
{
|
|
||||||
return characterSet;
|
return characterSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,20 +12,17 @@
|
|||||||
#ifndef _QUARTZ_TEXT_STYLE_ATTRIBUTE_H
|
#ifndef _QUARTZ_TEXT_STYLE_ATTRIBUTE_H
|
||||||
#define _QUARTZ_TEXT_STYLE_ATTRIBUTE_H
|
#define _QUARTZ_TEXT_STYLE_ATTRIBUTE_H
|
||||||
|
|
||||||
class QuartzFont
|
class QuartzFont {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
/** Create a font style from a name. */
|
/** Create a font style from a name. */
|
||||||
QuartzFont( const char* name, size_t length, float size, int weight, bool italic )
|
QuartzFont(const char *name, size_t length, float size, int weight, bool italic) {
|
||||||
{
|
assert(name != NULL && length > 0 && name[length] == '\0');
|
||||||
assert( name != NULL && length > 0 && name[length] == '\0' );
|
|
||||||
|
|
||||||
CFStringRef fontName = CFStringCreateWithCString(kCFAllocatorDefault, name, kCFStringEncodingMacRoman);
|
CFStringRef fontName = CFStringCreateWithCString(kCFAllocatorDefault, name, kCFStringEncodingMacRoman);
|
||||||
assert(fontName != NULL);
|
assert(fontName != NULL);
|
||||||
bool bold = weight > SC_WEIGHT_NORMAL;
|
bool bold = weight > SC_WEIGHT_NORMAL;
|
||||||
|
|
||||||
if (bold || italic)
|
if (bold || italic) {
|
||||||
{
|
|
||||||
CTFontSymbolicTraits desiredTrait = 0;
|
CTFontSymbolicTraits desiredTrait = 0;
|
||||||
CTFontSymbolicTraits traitMask = 0;
|
CTFontSymbolicTraits traitMask = 0;
|
||||||
|
|
||||||
@ -44,24 +41,18 @@ public:
|
|||||||
// create a font and then a copy of it with the sym traits
|
// create a font and then a copy of it with the sym traits
|
||||||
CTFontRef iFont = ::CTFontCreateWithName(fontName, size, NULL);
|
CTFontRef iFont = ::CTFontCreateWithName(fontName, size, NULL);
|
||||||
fontid = ::CTFontCreateCopyWithSymbolicTraits(iFont, size, NULL, desiredTrait, traitMask);
|
fontid = ::CTFontCreateCopyWithSymbolicTraits(iFont, size, NULL, desiredTrait, traitMask);
|
||||||
if (fontid)
|
if (fontid) {
|
||||||
{
|
|
||||||
CFRelease(iFont);
|
CFRelease(iFont);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
// Traits failed so use base font
|
// Traits failed so use base font
|
||||||
fontid = iFont;
|
fontid = iFont;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
// create the font, no traits
|
// create the font, no traits
|
||||||
fontid = ::CTFontCreateWithName(fontName, size, NULL);
|
fontid = ::CTFontCreateWithName(fontName, size, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fontid)
|
if (!fontid) {
|
||||||
{
|
|
||||||
// Failed to create requested font so use font always present
|
// Failed to create requested font so use font always present
|
||||||
fontid = ::CTFontCreateWithName((CFStringRef)@"Monaco", size, NULL);
|
fontid = ::CTFontCreateWithName((CFStringRef)@"Monaco", size, NULL);
|
||||||
}
|
}
|
||||||
@ -69,8 +60,7 @@ public:
|
|||||||
CFRelease(fontName);
|
CFRelease(fontName);
|
||||||
}
|
}
|
||||||
|
|
||||||
CTFontRef getFontID()
|
CTFontRef getFontID() {
|
||||||
{
|
|
||||||
return fontid;
|
return fontid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,16 +13,18 @@
|
|||||||
* This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
|
* This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <cstddef>
|
||||||
#include <stdio.h>
|
#include <cstdlib>
|
||||||
#include <time.h>
|
#include <cstdio>
|
||||||
#include <ctype.h>
|
#include <ctime>
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#include "ILoader.h"
|
||||||
#include "ILexer.h"
|
#include "ILexer.h"
|
||||||
|
|
||||||
#ifdef SCI_LEXER
|
#ifdef SCI_LEXER
|
||||||
@ -30,6 +32,8 @@
|
|||||||
#include "PropSetSimple.h"
|
#include "PropSetSimple.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "Position.h"
|
||||||
|
#include "UniqueString.h"
|
||||||
#include "SplitVector.h"
|
#include "SplitVector.h"
|
||||||
#include "Partitioning.h"
|
#include "Partitioning.h"
|
||||||
#include "RunStyles.h"
|
#include "RunStyles.h"
|
||||||
@ -38,7 +42,6 @@
|
|||||||
#include "CallTip.h"
|
#include "CallTip.h"
|
||||||
#include "KeyMap.h"
|
#include "KeyMap.h"
|
||||||
#include "Indicator.h"
|
#include "Indicator.h"
|
||||||
#include "XPM.h"
|
|
||||||
#include "LineMarker.h"
|
#include "LineMarker.h"
|
||||||
#include "Style.h"
|
#include "Style.h"
|
||||||
#include "ViewStyle.h"
|
#include "ViewStyle.h"
|
||||||
@ -47,6 +50,8 @@
|
|||||||
#include "CaseFolder.h"
|
#include "CaseFolder.h"
|
||||||
#include "Document.h"
|
#include "Document.h"
|
||||||
#include "CaseConvert.h"
|
#include "CaseConvert.h"
|
||||||
|
#include "UniConversion.h"
|
||||||
|
#include "DBCS.h"
|
||||||
#include "Selection.h"
|
#include "Selection.h"
|
||||||
#include "PositionCache.h"
|
#include "PositionCache.h"
|
||||||
#include "EditModel.h"
|
#include "EditModel.h"
|
||||||
@ -57,7 +62,7 @@
|
|||||||
#include "AutoComplete.h"
|
#include "AutoComplete.h"
|
||||||
#include "ScintillaBase.h"
|
#include "ScintillaBase.h"
|
||||||
|
|
||||||
extern "C" NSString* ScintillaRecPboardType;
|
extern "C" NSString *ScintillaRecPboardType;
|
||||||
|
|
||||||
@class SCIContentView;
|
@class SCIContentView;
|
||||||
@class SCIMarginView;
|
@class SCIMarginView;
|
||||||
@ -68,15 +73,14 @@ extern "C" NSString* ScintillaRecPboardType;
|
|||||||
/**
|
/**
|
||||||
* Helper class to be used as timer target (NSTimer).
|
* Helper class to be used as timer target (NSTimer).
|
||||||
*/
|
*/
|
||||||
@interface TimerTarget : NSObject
|
@interface TimerTarget : NSObject {
|
||||||
{
|
void *mTarget;
|
||||||
void* mTarget;
|
NSNotificationQueue *notificationQueue;
|
||||||
NSNotificationQueue* notificationQueue;
|
|
||||||
}
|
}
|
||||||
- (id) init: (void*) target;
|
- (id) init: (void *) target;
|
||||||
- (void) timerFired: (NSTimer*) timer;
|
- (void) timerFired: (NSTimer *) timer;
|
||||||
- (void) idleTimerFired: (NSTimer*) timer;
|
- (void) idleTimerFired: (NSTimer *) timer;
|
||||||
- (void) idleTriggered: (NSNotification*) notification;
|
- (void) idleTriggered: (NSNotification *) notification;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
namespace Scintilla {
|
namespace Scintilla {
|
||||||
@ -84,11 +88,11 @@ namespace Scintilla {
|
|||||||
/**
|
/**
|
||||||
* Main scintilla class, implemented for OS X (Cocoa).
|
* Main scintilla class, implemented for OS X (Cocoa).
|
||||||
*/
|
*/
|
||||||
class ScintillaCocoa : public ScintillaBase
|
class ScintillaCocoa : public ScintillaBase {
|
||||||
{
|
|
||||||
private:
|
private:
|
||||||
TimerTarget* timerTarget;
|
ScintillaView *sciView;
|
||||||
NSEvent* lastMouseEvent;
|
TimerTarget *timerTarget;
|
||||||
|
NSEvent *lastMouseEvent;
|
||||||
|
|
||||||
id<ScintillaNotificationProtocol> delegate;
|
id<ScintillaNotificationProtocol> delegate;
|
||||||
|
|
||||||
@ -99,125 +103,127 @@ private:
|
|||||||
|
|
||||||
bool enteredSetScrollingSize;
|
bool enteredSetScrollingSize;
|
||||||
|
|
||||||
// Private so ScintillaCocoa objects can not be copied
|
bool GetPasteboardData(NSPasteboard *board, SelectionText *selectedText);
|
||||||
ScintillaCocoa(const ScintillaCocoa &) : ScintillaBase() {}
|
void SetPasteboardData(NSPasteboard *board, const SelectionText &selectedText);
|
||||||
ScintillaCocoa &operator=(const ScintillaCocoa &) { return * this; }
|
Sci::Position TargetAsUTF8(char *text) const;
|
||||||
|
Sci::Position EncodedFromUTF8(const char *utf8, char *encoded) const;
|
||||||
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 scrollSpeed;
|
||||||
int scrollTicks;
|
int scrollTicks;
|
||||||
NSTimer* tickTimer;
|
|
||||||
NSTimer* idleTimer;
|
|
||||||
CFRunLoopObserverRef observer;
|
CFRunLoopObserverRef observer;
|
||||||
|
|
||||||
FindHighlightLayer *layerFindIndicator;
|
FindHighlightLayer *layerFindIndicator;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Point GetVisibleOriginInMain() const;
|
Point GetVisibleOriginInMain() const override;
|
||||||
PRectangle GetClientRectangle() const;
|
PRectangle GetClientRectangle() const override;
|
||||||
virtual PRectangle GetClientDrawingRectangle();
|
PRectangle GetClientDrawingRectangle() override;
|
||||||
Point ConvertPoint(NSPoint point);
|
Point ConvertPoint(NSPoint point);
|
||||||
virtual void RedrawRect(PRectangle rc);
|
void RedrawRect(PRectangle rc) override;
|
||||||
virtual void DiscardOverdraw();
|
void DiscardOverdraw() override;
|
||||||
virtual void Redraw();
|
void Redraw() override;
|
||||||
|
|
||||||
virtual void Initialise();
|
void Init();
|
||||||
virtual void Finalise();
|
CaseFolder *CaseFolderForEncoding() override;
|
||||||
virtual CaseFolder *CaseFolderForEncoding();
|
std::string CaseMapString(const std::string &s, int caseMapping) override;
|
||||||
virtual std::string CaseMapString(const std::string &s, int caseMapping);
|
void CancelModes() override;
|
||||||
virtual void CancelModes();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ScintillaCocoa(SCIContentView* view, SCIMarginView* viewMargin);
|
ScintillaCocoa(ScintillaView *sciView_, SCIContentView *viewContent, SCIMarginView *viewMargin);
|
||||||
virtual ~ScintillaCocoa();
|
// Deleted so ScintillaCocoa objects can not be copied.
|
||||||
|
ScintillaCocoa(const ScintillaCocoa &) = delete;
|
||||||
|
ScintillaCocoa &operator=(const ScintillaCocoa &) = delete;
|
||||||
|
~ScintillaCocoa() override;
|
||||||
|
void Finalise() override;
|
||||||
|
|
||||||
void SetDelegate(id<ScintillaNotificationProtocol> delegate_);
|
void SetDelegate(id<ScintillaNotificationProtocol> delegate_);
|
||||||
void RegisterNotifyCallback(intptr_t windowid, SciNotifyFunc callback);
|
void RegisterNotifyCallback(intptr_t windowid, SciNotifyFunc callback);
|
||||||
sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
|
sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) override;
|
||||||
|
|
||||||
NSScrollView* ScrollContainer() const;
|
NSScrollView *ScrollContainer() const;
|
||||||
SCIContentView* ContentView();
|
SCIContentView *ContentView();
|
||||||
|
|
||||||
bool SyncPaint(void* gc, PRectangle rc);
|
bool SyncPaint(void *gc, PRectangle rc);
|
||||||
bool Draw(NSRect rect, CGContextRef gc);
|
bool Draw(NSRect rect, CGContextRef gc);
|
||||||
void PaintMargin(NSRect aRect);
|
void PaintMargin(NSRect aRect);
|
||||||
|
|
||||||
virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
|
sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) override;
|
||||||
void TickFor(TickReason reason);
|
void TickFor(TickReason reason) override;
|
||||||
bool FineTickerAvailable();
|
bool FineTickerRunning(TickReason reason) override;
|
||||||
bool FineTickerRunning(TickReason reason);
|
void FineTickerStart(TickReason reason, int millis, int tolerance) override;
|
||||||
void FineTickerStart(TickReason reason, int millis, int tolerance);
|
void FineTickerCancel(TickReason reason) override;
|
||||||
void FineTickerCancel(TickReason reason);
|
bool SetIdle(bool on) override;
|
||||||
bool SetIdle(bool on);
|
void SetMouseCapture(bool on) override;
|
||||||
void SetMouseCapture(bool on);
|
bool HaveMouseCapture() override;
|
||||||
bool HaveMouseCapture();
|
|
||||||
void WillDraw(NSRect rect);
|
void WillDraw(NSRect rect);
|
||||||
void ScrollText(int linesToMove);
|
void ScrollText(Sci::Line linesToMove) override;
|
||||||
void SetVerticalScrollPos();
|
void SetVerticalScrollPos() override;
|
||||||
void SetHorizontalScrollPos();
|
void SetHorizontalScrollPos() override;
|
||||||
bool ModifyScrollBars(int nMax, int nPage);
|
bool ModifyScrollBars(Sci::Line nMax, Sci::Line nPage) override;
|
||||||
bool SetScrollingSize(void);
|
bool SetScrollingSize(void);
|
||||||
void Resize();
|
void Resize();
|
||||||
void UpdateForScroll();
|
void UpdateForScroll();
|
||||||
|
|
||||||
// Notifications for the owner.
|
// Notifications for the owner.
|
||||||
void NotifyChange();
|
void NotifyChange() override;
|
||||||
void NotifyFocus(bool focus);
|
void NotifyFocus(bool focus) override;
|
||||||
void NotifyParent(SCNotification scn);
|
void NotifyParent(SCNotification scn) override;
|
||||||
void NotifyURIDropped(const char *uri);
|
void NotifyURIDropped(const char *uri);
|
||||||
|
|
||||||
bool HasSelection();
|
bool HasSelection();
|
||||||
bool CanUndo();
|
bool CanUndo();
|
||||||
bool CanRedo();
|
bool CanRedo();
|
||||||
virtual void CopyToClipboard(const SelectionText &selectedText);
|
void CopyToClipboard(const SelectionText &selectedText) override;
|
||||||
virtual void Copy();
|
void Copy() override;
|
||||||
virtual bool CanPaste();
|
bool CanPaste() override;
|
||||||
virtual void Paste();
|
void Paste() override;
|
||||||
virtual void Paste(bool rectangular);
|
void Paste(bool rectangular);
|
||||||
void CTPaint(void* gc, NSRect rc);
|
void CTPaint(void *gc, NSRect rc);
|
||||||
void CallTipMouseDown(NSPoint pt);
|
void CallTipMouseDown(NSPoint pt);
|
||||||
virtual void CreateCallTipWindow(PRectangle rc);
|
void CreateCallTipWindow(PRectangle rc) override;
|
||||||
virtual void AddToPopUp(const char *label, int cmd = 0, bool enabled = true);
|
void AddToPopUp(const char *label, int cmd = 0, bool enabled = true) override;
|
||||||
virtual void ClaimSelection();
|
void ClaimSelection() override;
|
||||||
|
|
||||||
NSPoint GetCaretPosition();
|
NSPoint GetCaretPosition();
|
||||||
|
|
||||||
static sptr_t DirectFunction(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam);
|
static sptr_t DirectFunction(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam);
|
||||||
|
|
||||||
NSTimer *timers[tickPlatform+1];
|
NSTimer *timers[tickPlatform+1];
|
||||||
void TimerFired(NSTimer* timer);
|
void TimerFired(NSTimer *timer);
|
||||||
void IdleTimerFired();
|
void IdleTimerFired();
|
||||||
static void UpdateObserver(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *sci);
|
static void UpdateObserver(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *sci);
|
||||||
void ObserverAdd();
|
void ObserverAdd();
|
||||||
void ObserverRemove();
|
void ObserverRemove();
|
||||||
virtual void IdleWork();
|
void IdleWork() override;
|
||||||
virtual void QueueIdleWork(WorkNeeded::workItems items, int upTo);
|
void QueueIdleWork(WorkNeeded::workItems items, Sci::Position upTo) override;
|
||||||
int InsertText(NSString* input);
|
ptrdiff_t InsertText(NSString *input);
|
||||||
NSRange PositionsFromCharacters(NSRange range) const;
|
NSRange PositionsFromCharacters(NSRange rangeCharacters) const;
|
||||||
NSRange CharactersFromPositions(NSRange range) const;
|
NSRange CharactersFromPositions(NSRange rangePositions) const;
|
||||||
|
NSString *RangeTextAsString(NSRange rangePositions) const;
|
||||||
|
NSInteger VisibleLineForIndex(NSInteger index);
|
||||||
|
NSRange RangeForVisibleLine(NSInteger lineVisible);
|
||||||
|
NSRect FrameForRange(NSRange rangeCharacters);
|
||||||
|
NSRect GetBounds() const;
|
||||||
void SelectOnlyMainSelection();
|
void SelectOnlyMainSelection();
|
||||||
void ConvertSelectionVirtualSpace();
|
void ConvertSelectionVirtualSpace();
|
||||||
bool ClearAllSelections();
|
bool ClearAllSelections();
|
||||||
void CompositionStart();
|
void CompositionStart();
|
||||||
void CompositionCommit();
|
void CompositionCommit();
|
||||||
void CompositionUndo();
|
void CompositionUndo();
|
||||||
virtual void SetDocPointer(Document *document);
|
void SetDocPointer(Document *document) override;
|
||||||
|
|
||||||
bool KeyboardInput(NSEvent* event);
|
bool KeyboardInput(NSEvent *event);
|
||||||
void MouseDown(NSEvent* event);
|
void MouseDown(NSEvent *event);
|
||||||
void MouseMove(NSEvent* event);
|
void RightMouseDown(NSEvent *event);
|
||||||
void MouseUp(NSEvent* event);
|
void MouseMove(NSEvent *event);
|
||||||
void MouseEntered(NSEvent* event);
|
void MouseUp(NSEvent *event);
|
||||||
void MouseExited(NSEvent* event);
|
void MouseEntered(NSEvent *event);
|
||||||
void MouseWheel(NSEvent* event);
|
void MouseExited(NSEvent *event);
|
||||||
|
void MouseWheel(NSEvent *event);
|
||||||
|
|
||||||
// Drag and drop
|
// Drag and drop
|
||||||
void StartDrag();
|
void StartDrag() override;
|
||||||
bool GetDragData(id <NSDraggingInfo> info, NSPasteboard &pasteBoard, SelectionText* selectedText);
|
bool GetDragData(id <NSDraggingInfo> info, NSPasteboard &pasteBoard, SelectionText *selectedText);
|
||||||
NSDragOperation DraggingEntered(id <NSDraggingInfo> info);
|
NSDragOperation DraggingEntered(id <NSDraggingInfo> info);
|
||||||
NSDragOperation DraggingUpdated(id <NSDraggingInfo> info);
|
NSDragOperation DraggingUpdated(id <NSDraggingInfo> info);
|
||||||
void DraggingExited(id <NSDraggingInfo> info);
|
void DraggingExited(id <NSDraggingInfo> info);
|
||||||
@ -225,16 +231,19 @@ public:
|
|||||||
void DragScroll();
|
void DragScroll();
|
||||||
|
|
||||||
// Promote some methods needed for NSResponder actions.
|
// Promote some methods needed for NSResponder actions.
|
||||||
virtual void SelectAll();
|
void SelectAll() override;
|
||||||
void DeleteBackward();
|
void DeleteBackward();
|
||||||
virtual void Cut();
|
void Cut() override;
|
||||||
virtual void Undo();
|
void Undo() override;
|
||||||
virtual void Redo();
|
void Redo() override;
|
||||||
|
|
||||||
virtual NSMenu* CreateContextMenu(NSEvent* event);
|
bool ShouldDisplayPopupOnMargin();
|
||||||
|
bool ShouldDisplayPopupOnText();
|
||||||
|
NSMenu *CreateContextMenu(NSEvent *event);
|
||||||
void HandleCommand(NSInteger command);
|
void HandleCommand(NSInteger command);
|
||||||
|
|
||||||
virtual void ActiveStateChanged(bool isActive);
|
void ActiveStateChanged(bool isActive);
|
||||||
|
void WindowWillMove();
|
||||||
|
|
||||||
// Find indicator
|
// Find indicator
|
||||||
void ShowFindIndicatorForRange(NSRange charRange, BOOL retaining);
|
void ShowFindIndicatorForRange(NSRange charRange, BOOL retaining);
|
||||||
|
@ -9,17 +9,19 @@
|
|||||||
<key>CFBundleIconFile</key>
|
<key>CFBundleIconFile</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>com.sun.${PRODUCT_NAME:identifier}</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>4.1.4</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1.0</string>
|
<string>4.1.4</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
1100F1EC178E393200105727 /* CaseConvert.h in Headers */ = {isa = PBXBuildFile; fileRef = 1100F1E7178E393200105727 /* CaseConvert.h */; };
|
1100F1EC178E393200105727 /* CaseConvert.h in Headers */ = {isa = PBXBuildFile; fileRef = 1100F1E7178E393200105727 /* CaseConvert.h */; };
|
||||||
1100F1ED178E393200105727 /* CaseFolder.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 1100F1E8178E393200105727 /* CaseFolder.cxx */; };
|
1100F1ED178E393200105727 /* CaseFolder.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 1100F1E8178E393200105727 /* CaseFolder.cxx */; };
|
||||||
1100F1EE178E393200105727 /* CaseFolder.h in Headers */ = {isa = PBXBuildFile; fileRef = 1100F1E9178E393200105727 /* CaseFolder.h */; };
|
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 */; };
|
1102C31C169FB49300DC16AB /* LexLaTeX.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 1102C31B169FB49300DC16AB /* LexLaTeX.cxx */; };
|
||||||
11126B8214CD3A6200803C49 /* LexAVS.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11126B8114CD3A6200803C49 /* LexAVS.cxx */; };
|
11126B8214CD3A6200803C49 /* LexAVS.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11126B8114CD3A6200803C49 /* LexAVS.cxx */; };
|
||||||
1114D6CB1602A951001DC345 /* LexPO.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 1114D6CA1602A951001DC345 /* LexPO.cxx */; };
|
1114D6CB1602A951001DC345 /* LexPO.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 1114D6CA1602A951001DC345 /* LexPO.cxx */; };
|
||||||
@ -63,7 +62,6 @@
|
|||||||
114B6F3A11FA7526004FB6AB /* LexNimrod.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EEB11FA7526004FB6AB /* LexNimrod.cxx */; };
|
114B6F3A11FA7526004FB6AB /* LexNimrod.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EEB11FA7526004FB6AB /* LexNimrod.cxx */; };
|
||||||
114B6F3B11FA7526004FB6AB /* LexNsis.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EEC11FA7526004FB6AB /* LexNsis.cxx */; };
|
114B6F3B11FA7526004FB6AB /* LexNsis.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EEC11FA7526004FB6AB /* LexNsis.cxx */; };
|
||||||
114B6F3C11FA7526004FB6AB /* LexOpal.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EED11FA7526004FB6AB /* LexOpal.cxx */; };
|
114B6F3C11FA7526004FB6AB /* LexOpal.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EED11FA7526004FB6AB /* LexOpal.cxx */; };
|
||||||
114B6F3D11FA7526004FB6AB /* LexOthers.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EEE11FA7526004FB6AB /* LexOthers.cxx */; };
|
|
||||||
114B6F3E11FA7526004FB6AB /* LexPascal.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EEF11FA7526004FB6AB /* LexPascal.cxx */; };
|
114B6F3E11FA7526004FB6AB /* LexPascal.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EEF11FA7526004FB6AB /* LexPascal.cxx */; };
|
||||||
114B6F3F11FA7526004FB6AB /* LexPB.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF011FA7526004FB6AB /* LexPB.cxx */; };
|
114B6F3F11FA7526004FB6AB /* LexPB.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF011FA7526004FB6AB /* LexPB.cxx */; };
|
||||||
114B6F4011FA7526004FB6AB /* LexPerl.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF111FA7526004FB6AB /* LexPerl.cxx */; };
|
114B6F4011FA7526004FB6AB /* LexPerl.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF111FA7526004FB6AB /* LexPerl.cxx */; };
|
||||||
@ -126,7 +124,7 @@
|
|||||||
114B6F9D11FA75BE004FB6AB /* PropSetSimple.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F9411FA75BE004FB6AB /* PropSetSimple.cxx */; };
|
114B6F9D11FA75BE004FB6AB /* PropSetSimple.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F9411FA75BE004FB6AB /* PropSetSimple.cxx */; };
|
||||||
114B6F9E11FA75BE004FB6AB /* StyleContext.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F9511FA75BE004FB6AB /* StyleContext.cxx */; };
|
114B6F9E11FA75BE004FB6AB /* StyleContext.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F9511FA75BE004FB6AB /* StyleContext.cxx */; };
|
||||||
114B6F9F11FA75BE004FB6AB /* WordList.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F9611FA75BE004FB6AB /* WordList.cxx */; };
|
114B6F9F11FA75BE004FB6AB /* WordList.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F9611FA75BE004FB6AB /* WordList.cxx */; };
|
||||||
114B6FA111FA75DB004FB6AB /* ILexer.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA011FA75DB004FB6AB /* ILexer.h */; };
|
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 */; };
|
114B6FBD11FA7623004FB6AB /* AutoComplete.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA211FA7623004FB6AB /* AutoComplete.h */; };
|
||||||
114B6FBE11FA7623004FB6AB /* CallTip.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA311FA7623004FB6AB /* CallTip.h */; };
|
114B6FBE11FA7623004FB6AB /* CallTip.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA311FA7623004FB6AB /* CallTip.h */; };
|
||||||
114B6FBF11FA7623004FB6AB /* Catalogue.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA411FA7623004FB6AB /* Catalogue.h */; };
|
114B6FBF11FA7623004FB6AB /* Catalogue.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA411FA7623004FB6AB /* Catalogue.h */; };
|
||||||
@ -200,6 +198,8 @@
|
|||||||
280056FC188DDD2C00F200AE /* StringCopy.h in Headers */ = {isa = PBXBuildFile; fileRef = 280056F9188DDD2C00F200AE /* StringCopy.h */; };
|
280056FC188DDD2C00F200AE /* StringCopy.h in Headers */ = {isa = PBXBuildFile; fileRef = 280056F9188DDD2C00F200AE /* StringCopy.h */; };
|
||||||
280056FD188DDD2C00F200AE /* SubStyles.h in Headers */ = {isa = PBXBuildFile; fileRef = 280056FA188DDD2C00F200AE /* SubStyles.h */; };
|
280056FD188DDD2C00F200AE /* SubStyles.h in Headers */ = {isa = PBXBuildFile; fileRef = 280056FA188DDD2C00F200AE /* SubStyles.h */; };
|
||||||
28064A05190F12E100E6E47F /* LexDMIS.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28064A04190F12E100E6E47F /* LexDMIS.cxx */; };
|
28064A05190F12E100E6E47F /* LexDMIS.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28064A04190F12E100E6E47F /* LexDMIS.cxx */; };
|
||||||
|
282D4A961F53FE270082E4D3 /* ILoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 282D4A951F53FE270082E4D3 /* ILoader.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
|
28804B2C1EEE232E00C0D154 /* DBCS.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28804B2B1EEE232E00C0D154 /* DBCS.cxx */; };
|
||||||
28A067111A36B42600B4966A /* LexHex.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A067101A36B42600B4966A /* LexHex.cxx */; };
|
28A067111A36B42600B4966A /* LexHex.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A067101A36B42600B4966A /* LexHex.cxx */; };
|
||||||
28A1DD51196BE0CA006EFCDD /* EditModel.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A1DD4E196BE0CA006EFCDD /* EditModel.cxx */; };
|
28A1DD51196BE0CA006EFCDD /* EditModel.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A1DD4E196BE0CA006EFCDD /* EditModel.cxx */; };
|
||||||
28A1DD52196BE0CA006EFCDD /* EditView.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A1DD4F196BE0CA006EFCDD /* EditView.cxx */; };
|
28A1DD52196BE0CA006EFCDD /* EditView.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A1DD4F196BE0CA006EFCDD /* EditView.cxx */; };
|
||||||
@ -208,12 +208,29 @@
|
|||||||
28A1DD58196BE0ED006EFCDD /* EditView.h in Headers */ = {isa = PBXBuildFile; fileRef = 28A1DD55196BE0ED006EFCDD /* EditView.h */; };
|
28A1DD58196BE0ED006EFCDD /* EditView.h in Headers */ = {isa = PBXBuildFile; fileRef = 28A1DD55196BE0ED006EFCDD /* EditView.h */; };
|
||||||
28A1DD59196BE0ED006EFCDD /* MarginView.h in Headers */ = {isa = PBXBuildFile; fileRef = 28A1DD56196BE0ED006EFCDD /* MarginView.h */; };
|
28A1DD59196BE0ED006EFCDD /* MarginView.h in Headers */ = {isa = PBXBuildFile; fileRef = 28A1DD56196BE0ED006EFCDD /* MarginView.h */; };
|
||||||
28A7D6051995E47D0062D204 /* LexRegistry.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A7D6041995E47D0062D204 /* LexRegistry.cxx */; };
|
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, ); }; };
|
||||||
|
28BDA1221EFB8F7C00EBD3F3 /* DefaultLexer.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28BDA1211EFB8F7C00EBD3F3 /* DefaultLexer.cxx */; };
|
||||||
|
28BDA1241EFB8FB200EBD3F3 /* DefaultLexer.h in Headers */ = {isa = PBXBuildFile; fileRef = 28BDA1231EFB8FB200EBD3F3 /* DefaultLexer.h */; };
|
||||||
|
28C40CA81CB7321200B089F2 /* LexJSON.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28C40CA71CB7321200B089F2 /* LexJSON.cxx */; };
|
||||||
|
28D191A21DEA72C800159938 /* LexEDIFACT.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28D191A11DEA72C800159938 /* LexEDIFACT.cxx */; };
|
||||||
28D516D81830FFCA0047C93D /* info_bar_bg@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 28D516D51830FFCA0047C93D /* info_bar_bg@2x.png */; };
|
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 */; };
|
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 */; };
|
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 */; };
|
28FDA42119B6967B00BE27D7 /* LexBibTeX.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28FDA42019B6967B00BE27D7 /* LexBibTeX.cxx */; };
|
||||||
|
3D994BD7A5EAC4FA5B3CFBDF /* LexMaxima.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 29B042978C1F93EF42F9E4AB /* LexMaxima.cxx */; };
|
||||||
8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; };
|
8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; };
|
||||||
8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */; };
|
8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */; };
|
||||||
|
F437405F9F32C7DEFCA38C11 /* LexIndent.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 282E41F3B9E2BFEDD6A05BE7 /* LexIndent.cxx */; };
|
||||||
|
FDC7442CAD70B9A67EF1639D /* LexSAS.cxx in Sources */ = {isa = PBXBuildFile; fileRef = A95147A1AB7CADB00DAFE724 /* LexSAS.cxx */; };
|
||||||
|
5F804AA6B60FE695863A39FE /* LexStata.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 7623427695416AB1270EE023 /* LexStata.cxx */; };
|
||||||
|
0ED84236A703D57578EBFD2F /* LexNim.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 47814937A6B72D2B0F065B61 /* LexNim.cxx */; };
|
||||||
|
00724A59981D34F11A3D162F /* LexCIL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 577F46B88F633198B56D088D /* LexCIL.cxx */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
@ -225,7 +242,6 @@
|
|||||||
1100F1E7178E393200105727 /* CaseConvert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CaseConvert.h; path = ../../src/CaseConvert.h; sourceTree = "<group>"; };
|
1100F1E7178E393200105727 /* CaseConvert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CaseConvert.h; path = ../../src/CaseConvert.h; sourceTree = "<group>"; };
|
||||||
1100F1E8178E393200105727 /* CaseFolder.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CaseFolder.cxx; path = ../../src/CaseFolder.cxx; sourceTree = "<group>"; };
|
1100F1E8178E393200105727 /* CaseFolder.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CaseFolder.cxx; path = ../../src/CaseFolder.cxx; sourceTree = "<group>"; };
|
||||||
1100F1E9178E393200105727 /* CaseFolder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CaseFolder.h; path = ../../src/CaseFolder.h; sourceTree = "<group>"; };
|
1100F1E9178E393200105727 /* CaseFolder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CaseFolder.h; path = ../../src/CaseFolder.h; sourceTree = "<group>"; };
|
||||||
1100F1EA178E393200105727 /* UnicodeFromUTF8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnicodeFromUTF8.h; path = ../../src/UnicodeFromUTF8.h; sourceTree = "<group>"; };
|
|
||||||
1102C31B169FB49300DC16AB /* LexLaTeX.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexLaTeX.cxx; path = ../../lexers/LexLaTeX.cxx; sourceTree = "<group>"; };
|
1102C31B169FB49300DC16AB /* LexLaTeX.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexLaTeX.cxx; path = ../../lexers/LexLaTeX.cxx; sourceTree = "<group>"; };
|
||||||
11126B8114CD3A6200803C49 /* LexAVS.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexAVS.cxx; path = ../../lexers/LexAVS.cxx; sourceTree = "<group>"; };
|
11126B8114CD3A6200803C49 /* LexAVS.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexAVS.cxx; path = ../../lexers/LexAVS.cxx; sourceTree = "<group>"; };
|
||||||
1114D6CA1602A951001DC345 /* LexPO.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPO.cxx; path = ../../lexers/LexPO.cxx; sourceTree = "<group>"; };
|
1114D6CA1602A951001DC345 /* LexPO.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPO.cxx; path = ../../lexers/LexPO.cxx; sourceTree = "<group>"; };
|
||||||
@ -277,7 +293,6 @@
|
|||||||
114B6EEB11FA7526004FB6AB /* LexNimrod.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexNimrod.cxx; path = ../../lexers/LexNimrod.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; };
|
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; };
|
114B6EED11FA7526004FB6AB /* LexOpal.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexOpal.cxx; path = ../../lexers/LexOpal.cxx; sourceTree = SOURCE_ROOT; };
|
||||||
114B6EEE11FA7526004FB6AB /* LexOthers.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexOthers.cxx; path = ../../lexers/LexOthers.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; };
|
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; };
|
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; };
|
114B6EF111FA7526004FB6AB /* LexPerl.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPerl.cxx; path = ../../lexers/LexPerl.cxx; sourceTree = SOURCE_ROOT; };
|
||||||
@ -414,6 +429,9 @@
|
|||||||
280056F9188DDD2C00F200AE /* StringCopy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringCopy.h; path = ../../lexlib/StringCopy.h; sourceTree = "<group>"; };
|
280056F9188DDD2C00F200AE /* StringCopy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringCopy.h; path = ../../lexlib/StringCopy.h; sourceTree = "<group>"; };
|
||||||
280056FA188DDD2C00F200AE /* SubStyles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SubStyles.h; path = ../../lexlib/SubStyles.h; sourceTree = "<group>"; };
|
280056FA188DDD2C00F200AE /* SubStyles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SubStyles.h; path = ../../lexlib/SubStyles.h; sourceTree = "<group>"; };
|
||||||
28064A04190F12E100E6E47F /* LexDMIS.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexDMIS.cxx; path = ../../lexers/LexDMIS.cxx; sourceTree = "<group>"; };
|
28064A04190F12E100E6E47F /* LexDMIS.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexDMIS.cxx; path = ../../lexers/LexDMIS.cxx; sourceTree = "<group>"; };
|
||||||
|
282D4A951F53FE270082E4D3 /* ILoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ILoader.h; path = ../../include/ILoader.h; sourceTree = "<group>"; };
|
||||||
|
282E41F3B9E2BFEDD6A05BE7 /* LexIndent.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexIndent.cxx; path = ../../lexers/LexIndent.cxx; sourceTree = SOURCE_ROOT; };
|
||||||
|
28804B2B1EEE232E00C0D154 /* DBCS.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DBCS.cxx; path = ../../src/DBCS.cxx; sourceTree = "<group>"; };
|
||||||
28A067101A36B42600B4966A /* LexHex.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexHex.cxx; path = ../../lexers/LexHex.cxx; sourceTree = "<group>"; };
|
28A067101A36B42600B4966A /* LexHex.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexHex.cxx; path = ../../lexers/LexHex.cxx; sourceTree = "<group>"; };
|
||||||
28A1DD4E196BE0CA006EFCDD /* EditModel.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EditModel.cxx; path = ../../src/EditModel.cxx; sourceTree = "<group>"; };
|
28A1DD4E196BE0CA006EFCDD /* EditModel.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EditModel.cxx; path = ../../src/EditModel.cxx; sourceTree = "<group>"; };
|
||||||
28A1DD4F196BE0CA006EFCDD /* EditView.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EditView.cxx; path = ../../src/EditView.cxx; sourceTree = "<group>"; };
|
28A1DD4F196BE0CA006EFCDD /* EditView.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EditView.cxx; path = ../../src/EditView.cxx; sourceTree = "<group>"; };
|
||||||
@ -422,14 +440,31 @@
|
|||||||
28A1DD55196BE0ED006EFCDD /* EditView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EditView.h; path = ../../src/EditView.h; sourceTree = "<group>"; };
|
28A1DD55196BE0ED006EFCDD /* EditView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EditView.h; path = ../../src/EditView.h; sourceTree = "<group>"; };
|
||||||
28A1DD56196BE0ED006EFCDD /* MarginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MarginView.h; path = ../../src/MarginView.h; sourceTree = "<group>"; };
|
28A1DD56196BE0ED006EFCDD /* MarginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MarginView.h; path = ../../src/MarginView.h; sourceTree = "<group>"; };
|
||||||
28A7D6041995E47D0062D204 /* LexRegistry.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexRegistry.cxx; path = ../../lexers/LexRegistry.cxx; sourceTree = "<group>"; };
|
28A7D6041995E47D0062D204 /* LexRegistry.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexRegistry.cxx; path = ../../lexers/LexRegistry.cxx; sourceTree = "<group>"; };
|
||||||
|
28B647061B54C0720009DC49 /* LexBatch.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexBatch.cxx; path = ../../lexers/LexBatch.cxx; sourceTree = "<group>"; };
|
||||||
|
28B647071B54C0720009DC49 /* LexDiff.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexDiff.cxx; path = ../../lexers/LexDiff.cxx; sourceTree = "<group>"; };
|
||||||
|
28B647081B54C0720009DC49 /* LexErrorList.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexErrorList.cxx; path = ../../lexers/LexErrorList.cxx; sourceTree = "<group>"; };
|
||||||
|
28B647091B54C0720009DC49 /* LexMake.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexMake.cxx; path = ../../lexers/LexMake.cxx; sourceTree = "<group>"; };
|
||||||
|
28B6470A1B54C0720009DC49 /* LexNull.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexNull.cxx; path = ../../lexers/LexNull.cxx; sourceTree = "<group>"; };
|
||||||
|
28B6470B1B54C0720009DC49 /* LexProps.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexProps.cxx; path = ../../lexers/LexProps.cxx; sourceTree = "<group>"; };
|
||||||
|
28BC38EB1B74C6AD008BF9EB /* Sci_Position.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Sci_Position.h; path = ../../include/Sci_Position.h; sourceTree = "<group>"; };
|
||||||
|
28BDA1211EFB8F7C00EBD3F3 /* DefaultLexer.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DefaultLexer.cxx; path = ../../lexlib/DefaultLexer.cxx; sourceTree = "<group>"; };
|
||||||
|
28BDA1231EFB8FB200EBD3F3 /* DefaultLexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DefaultLexer.h; path = ../../lexlib/DefaultLexer.h; sourceTree = "<group>"; };
|
||||||
|
28C40CA71CB7321200B089F2 /* LexJSON.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexJSON.cxx; path = ../../lexers/LexJSON.cxx; sourceTree = "<group>"; };
|
||||||
|
28D1919E1DE69FC100159938 /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = "<group>"; };
|
||||||
|
28D191A11DEA72C800159938 /* LexEDIFACT.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexEDIFACT.cxx; path = ../../lexers/LexEDIFACT.cxx; sourceTree = "<group>"; };
|
||||||
28D516D51830FFCA0047C93D /* info_bar_bg@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "info_bar_bg@2x.png"; sourceTree = "<group>"; };
|
28D516D51830FFCA0047C93D /* info_bar_bg@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "info_bar_bg@2x.png"; sourceTree = "<group>"; };
|
||||||
28D516D61830FFCA0047C93D /* mac_cursor_busy@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mac_cursor_busy@2x.png"; sourceTree = "<group>"; };
|
28D516D61830FFCA0047C93D /* mac_cursor_busy@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mac_cursor_busy@2x.png"; sourceTree = "<group>"; };
|
||||||
28D516D71830FFCA0047C93D /* mac_cursor_flipped@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mac_cursor_flipped@2x.png"; sourceTree = "<group>"; };
|
28D516D71830FFCA0047C93D /* mac_cursor_flipped@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mac_cursor_flipped@2x.png"; sourceTree = "<group>"; };
|
||||||
28FDA42019B6967B00BE27D7 /* LexBibTeX.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexBibTeX.cxx; path = ../../lexers/LexBibTeX.cxx; sourceTree = "<group>"; };
|
28FDA42019B6967B00BE27D7 /* LexBibTeX.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexBibTeX.cxx; path = ../../lexers/LexBibTeX.cxx; sourceTree = "<group>"; };
|
||||||
|
29B042978C1F93EF42F9E4AB /* LexMaxima.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexMaxima.cxx; path = ../../lexers/LexMaxima.cxx; sourceTree = SOURCE_ROOT; };
|
||||||
32DBCF5E0370ADEE00C91783 /* Scintilla_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Scintilla_Prefix.pch; sourceTree = "<group>"; };
|
32DBCF5E0370ADEE00C91783 /* Scintilla_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Scintilla_Prefix.pch; sourceTree = "<group>"; };
|
||||||
8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
8DC2EF5B0486A6940098B216 /* Scintilla.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Scintilla.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
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 = "<absolute>"; };
|
D2F7E79907B2D74100F64583 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
|
||||||
|
A95147A1AB7CADB00DAFE724 /* LexSAS.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexSAS.cxx; path = ../../lexers/LexSAS.cxx; sourceTree = SOURCE_ROOT; };
|
||||||
|
7623427695416AB1270EE023 /* LexStata.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexStata.cxx; path = ../../lexers/LexStata.cxx; sourceTree = SOURCE_ROOT; };
|
||||||
|
47814937A6B72D2B0F065B61 /* LexNim.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexNim.cxx; path = ../../lexers/LexNim.cxx; sourceTree = SOURCE_ROOT; };
|
||||||
|
577F46B88F633198B56D088D /* LexCIL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCIL.cxx; path = ../../lexers/LexCIL.cxx; sourceTree = SOURCE_ROOT; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
@ -489,6 +524,7 @@
|
|||||||
08FB77AEFE84172EC02AAC07 /* Classes */ = {
|
08FB77AEFE84172EC02AAC07 /* Classes */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
28D1919E1DE69FC100159938 /* module.modulemap */,
|
||||||
2744E4980FC167ED00E85C33 /* Source Files */,
|
2744E4980FC167ED00E85C33 /* Source Files */,
|
||||||
2744E4970FC167E400E85C33 /* Header Files */,
|
2744E4970FC167E400E85C33 /* Header Files */,
|
||||||
);
|
);
|
||||||
@ -526,7 +562,6 @@
|
|||||||
2744E47D0FC1674E00E85C33 /* Lexers */ = {
|
2744E47D0FC1674E00E85C33 /* Lexers */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
11126B8114CD3A6200803C49 /* LexAVS.cxx */,
|
|
||||||
11F35FDA12AEFAF100F0236D /* LexA68k.cxx */,
|
11F35FDA12AEFAF100F0236D /* LexA68k.cxx */,
|
||||||
114B6EBE11FA7526004FB6AB /* LexAbaqus.cxx */,
|
114B6EBE11FA7526004FB6AB /* LexAbaqus.cxx */,
|
||||||
114B6EBF11FA7526004FB6AB /* LexAda.cxx */,
|
114B6EBF11FA7526004FB6AB /* LexAda.cxx */,
|
||||||
@ -536,12 +571,15 @@
|
|||||||
114B6EC311FA7526004FB6AB /* LexASY.cxx */,
|
114B6EC311FA7526004FB6AB /* LexASY.cxx */,
|
||||||
114B6EC411FA7526004FB6AB /* LexAU3.cxx */,
|
114B6EC411FA7526004FB6AB /* LexAU3.cxx */,
|
||||||
114B6EC511FA7526004FB6AB /* LexAVE.cxx */,
|
114B6EC511FA7526004FB6AB /* LexAVE.cxx */,
|
||||||
|
11126B8114CD3A6200803C49 /* LexAVS.cxx */,
|
||||||
114B6EC611FA7526004FB6AB /* LexBaan.cxx */,
|
114B6EC611FA7526004FB6AB /* LexBaan.cxx */,
|
||||||
114B6EC711FA7526004FB6AB /* LexBash.cxx */,
|
114B6EC711FA7526004FB6AB /* LexBash.cxx */,
|
||||||
114B6EC811FA7526004FB6AB /* LexBasic.cxx */,
|
114B6EC811FA7526004FB6AB /* LexBasic.cxx */,
|
||||||
|
28B647061B54C0720009DC49 /* LexBatch.cxx */,
|
||||||
28FDA42019B6967B00BE27D7 /* LexBibTeX.cxx */,
|
28FDA42019B6967B00BE27D7 /* LexBibTeX.cxx */,
|
||||||
114B6EC911FA7526004FB6AB /* LexBullant.cxx */,
|
114B6EC911FA7526004FB6AB /* LexBullant.cxx */,
|
||||||
114B6ECA11FA7526004FB6AB /* LexCaml.cxx */,
|
114B6ECA11FA7526004FB6AB /* LexCaml.cxx */,
|
||||||
|
577F46B88F633198B56D088D /* LexCIL.cxx */,
|
||||||
114B6ECB11FA7526004FB6AB /* LexCLW.cxx */,
|
114B6ECB11FA7526004FB6AB /* LexCLW.cxx */,
|
||||||
114B6ECC11FA7526004FB6AB /* LexCmake.cxx */,
|
114B6ECC11FA7526004FB6AB /* LexCmake.cxx */,
|
||||||
114B6ECD11FA7526004FB6AB /* LexCOBOL.cxx */,
|
114B6ECD11FA7526004FB6AB /* LexCOBOL.cxx */,
|
||||||
@ -552,11 +590,14 @@
|
|||||||
114B6ED111FA7526004FB6AB /* LexCsound.cxx */,
|
114B6ED111FA7526004FB6AB /* LexCsound.cxx */,
|
||||||
114B6ED211FA7526004FB6AB /* LexCSS.cxx */,
|
114B6ED211FA7526004FB6AB /* LexCSS.cxx */,
|
||||||
114B6ED311FA7526004FB6AB /* LexD.cxx */,
|
114B6ED311FA7526004FB6AB /* LexD.cxx */,
|
||||||
|
28B647071B54C0720009DC49 /* LexDiff.cxx */,
|
||||||
11FF3FE11810EB3900E13F13 /* LexDMAP.cxx */,
|
11FF3FE11810EB3900E13F13 /* LexDMAP.cxx */,
|
||||||
28064A04190F12E100E6E47F /* LexDMIS.cxx */,
|
28064A04190F12E100E6E47F /* LexDMIS.cxx */,
|
||||||
11BEB6A114EF189600BDE92A /* LexECL.cxx */,
|
11BEB6A114EF189600BDE92A /* LexECL.cxx */,
|
||||||
|
28D191A11DEA72C800159938 /* LexEDIFACT.cxx */,
|
||||||
114B6ED411FA7526004FB6AB /* LexEiffel.cxx */,
|
114B6ED411FA7526004FB6AB /* LexEiffel.cxx */,
|
||||||
114B6ED511FA7526004FB6AB /* LexErlang.cxx */,
|
114B6ED511FA7526004FB6AB /* LexErlang.cxx */,
|
||||||
|
28B647081B54C0720009DC49 /* LexErrorList.cxx */,
|
||||||
114B6ED611FA7526004FB6AB /* LexEScript.cxx */,
|
114B6ED611FA7526004FB6AB /* LexEScript.cxx */,
|
||||||
114B6ED711FA7526004FB6AB /* LexFlagship.cxx */,
|
114B6ED711FA7526004FB6AB /* LexFlagship.cxx */,
|
||||||
114B6ED811FA7526004FB6AB /* LexForth.cxx */,
|
114B6ED811FA7526004FB6AB /* LexForth.cxx */,
|
||||||
@ -566,7 +607,9 @@
|
|||||||
114B6EDC11FA7526004FB6AB /* LexHaskell.cxx */,
|
114B6EDC11FA7526004FB6AB /* LexHaskell.cxx */,
|
||||||
28A067101A36B42600B4966A /* LexHex.cxx */,
|
28A067101A36B42600B4966A /* LexHex.cxx */,
|
||||||
114B6EDD11FA7526004FB6AB /* LexHTML.cxx */,
|
114B6EDD11FA7526004FB6AB /* LexHTML.cxx */,
|
||||||
|
282E41F3B9E2BFEDD6A05BE7 /* LexIndent.cxx */,
|
||||||
114B6EDE11FA7526004FB6AB /* LexInno.cxx */,
|
114B6EDE11FA7526004FB6AB /* LexInno.cxx */,
|
||||||
|
28C40CA71CB7321200B089F2 /* LexJSON.cxx */,
|
||||||
114B6EDF11FA7526004FB6AB /* LexKix.cxx */,
|
114B6EDF11FA7526004FB6AB /* LexKix.cxx */,
|
||||||
11FDD0DF17C480D4001541B9 /* LexKVIrc.cxx */,
|
11FDD0DF17C480D4001541B9 /* LexKVIrc.cxx */,
|
||||||
1102C31B169FB49300DC16AB /* LexLaTeX.cxx */,
|
1102C31B169FB49300DC16AB /* LexLaTeX.cxx */,
|
||||||
@ -574,19 +617,22 @@
|
|||||||
114B6EE111FA7526004FB6AB /* LexLout.cxx */,
|
114B6EE111FA7526004FB6AB /* LexLout.cxx */,
|
||||||
114B6EE211FA7526004FB6AB /* LexLua.cxx */,
|
114B6EE211FA7526004FB6AB /* LexLua.cxx */,
|
||||||
114B6EE311FA7526004FB6AB /* LexMagik.cxx */,
|
114B6EE311FA7526004FB6AB /* LexMagik.cxx */,
|
||||||
|
28B647091B54C0720009DC49 /* LexMake.cxx */,
|
||||||
114B6EE411FA7526004FB6AB /* LexMarkdown.cxx */,
|
114B6EE411FA7526004FB6AB /* LexMarkdown.cxx */,
|
||||||
114B6EE511FA7526004FB6AB /* LexMatlab.cxx */,
|
114B6EE511FA7526004FB6AB /* LexMatlab.cxx */,
|
||||||
|
29B042978C1F93EF42F9E4AB /* LexMaxima.cxx */,
|
||||||
114B6EE611FA7526004FB6AB /* LexMetapost.cxx */,
|
114B6EE611FA7526004FB6AB /* LexMetapost.cxx */,
|
||||||
114B6EE711FA7526004FB6AB /* LexMMIXAL.cxx */,
|
114B6EE711FA7526004FB6AB /* LexMMIXAL.cxx */,
|
||||||
11BB124C12FF9C1300F6BCF7 /* LexModula.cxx */,
|
11BB124C12FF9C1300F6BCF7 /* LexModula.cxx */,
|
||||||
114B6EE811FA7526004FB6AB /* LexMPT.cxx */,
|
114B6EE811FA7526004FB6AB /* LexMPT.cxx */,
|
||||||
114B6EE911FA7526004FB6AB /* LexMSSQL.cxx */,
|
114B6EE911FA7526004FB6AB /* LexMSSQL.cxx */,
|
||||||
114B6EEA11FA7526004FB6AB /* LexMySQL.cxx */,
|
114B6EEA11FA7526004FB6AB /* LexMySQL.cxx */,
|
||||||
|
47814937A6B72D2B0F065B61 /* LexNim.cxx */,
|
||||||
114B6EEB11FA7526004FB6AB /* LexNimrod.cxx */,
|
114B6EEB11FA7526004FB6AB /* LexNimrod.cxx */,
|
||||||
114B6EEC11FA7526004FB6AB /* LexNsis.cxx */,
|
114B6EEC11FA7526004FB6AB /* LexNsis.cxx */,
|
||||||
|
28B6470A1B54C0720009DC49 /* LexNull.cxx */,
|
||||||
114B6EED11FA7526004FB6AB /* LexOpal.cxx */,
|
114B6EED11FA7526004FB6AB /* LexOpal.cxx */,
|
||||||
11594BE7155B91DF0099E1FA /* LexOScript.cxx */,
|
11594BE7155B91DF0099E1FA /* LexOScript.cxx */,
|
||||||
114B6EEE11FA7526004FB6AB /* LexOthers.cxx */,
|
|
||||||
114B6EEF11FA7526004FB6AB /* LexPascal.cxx */,
|
114B6EEF11FA7526004FB6AB /* LexPascal.cxx */,
|
||||||
114B6EF011FA7526004FB6AB /* LexPB.cxx */,
|
114B6EF011FA7526004FB6AB /* LexPB.cxx */,
|
||||||
114B6EF111FA7526004FB6AB /* LexPerl.cxx */,
|
114B6EF111FA7526004FB6AB /* LexPerl.cxx */,
|
||||||
@ -596,6 +642,7 @@
|
|||||||
114B6EF411FA7526004FB6AB /* LexPowerPro.cxx */,
|
114B6EF411FA7526004FB6AB /* LexPowerPro.cxx */,
|
||||||
114B6EF511FA7526004FB6AB /* LexPowerShell.cxx */,
|
114B6EF511FA7526004FB6AB /* LexPowerShell.cxx */,
|
||||||
114B6EF611FA7526004FB6AB /* LexProgress.cxx */,
|
114B6EF611FA7526004FB6AB /* LexProgress.cxx */,
|
||||||
|
28B6470B1B54C0720009DC49 /* LexProps.cxx */,
|
||||||
114B6EF711FA7526004FB6AB /* LexPS.cxx */,
|
114B6EF711FA7526004FB6AB /* LexPS.cxx */,
|
||||||
114B6EF811FA7526004FB6AB /* LexPython.cxx */,
|
114B6EF811FA7526004FB6AB /* LexPython.cxx */,
|
||||||
114B6EF911FA7526004FB6AB /* LexR.cxx */,
|
114B6EF911FA7526004FB6AB /* LexR.cxx */,
|
||||||
@ -603,6 +650,7 @@
|
|||||||
28A7D6041995E47D0062D204 /* LexRegistry.cxx */,
|
28A7D6041995E47D0062D204 /* LexRegistry.cxx */,
|
||||||
114B6EFB11FA7526004FB6AB /* LexRuby.cxx */,
|
114B6EFB11FA7526004FB6AB /* LexRuby.cxx */,
|
||||||
1160E0371803651C00BCEBCB /* LexRust.cxx */,
|
1160E0371803651C00BCEBCB /* LexRust.cxx */,
|
||||||
|
A95147A1AB7CADB00DAFE724 /* LexSAS.cxx */,
|
||||||
114B6EFC11FA7526004FB6AB /* LexScriptol.cxx */,
|
114B6EFC11FA7526004FB6AB /* LexScriptol.cxx */,
|
||||||
114B6EFD11FA7526004FB6AB /* LexSmalltalk.cxx */,
|
114B6EFD11FA7526004FB6AB /* LexSmalltalk.cxx */,
|
||||||
114B6EFE11FA7526004FB6AB /* LexSML.cxx */,
|
114B6EFE11FA7526004FB6AB /* LexSML.cxx */,
|
||||||
@ -610,6 +658,7 @@
|
|||||||
114B6F0011FA7526004FB6AB /* LexSpecman.cxx */,
|
114B6F0011FA7526004FB6AB /* LexSpecman.cxx */,
|
||||||
114B6F0111FA7526004FB6AB /* LexSpice.cxx */,
|
114B6F0111FA7526004FB6AB /* LexSpice.cxx */,
|
||||||
114B6F0211FA7526004FB6AB /* LexSQL.cxx */,
|
114B6F0211FA7526004FB6AB /* LexSQL.cxx */,
|
||||||
|
7623427695416AB1270EE023 /* LexStata.cxx */,
|
||||||
11FDAEB6174E1A9700FA161B /* LexSTTXT.cxx */,
|
11FDAEB6174E1A9700FA161B /* LexSTTXT.cxx */,
|
||||||
114B6F0311FA7526004FB6AB /* LexTACL.cxx */,
|
114B6F0311FA7526004FB6AB /* LexTACL.cxx */,
|
||||||
114B6F0411FA7526004FB6AB /* LexTADS3.cxx */,
|
114B6F0411FA7526004FB6AB /* LexTADS3.cxx */,
|
||||||
@ -642,6 +691,7 @@
|
|||||||
114B6FA611FA7623004FB6AB /* CharClassify.h */,
|
114B6FA611FA7623004FB6AB /* CharClassify.h */,
|
||||||
114B6FA711FA7623004FB6AB /* ContractionState.h */,
|
114B6FA711FA7623004FB6AB /* ContractionState.h */,
|
||||||
114B6FA811FA7623004FB6AB /* Decoration.h */,
|
114B6FA811FA7623004FB6AB /* Decoration.h */,
|
||||||
|
28BDA1231EFB8FB200EBD3F3 /* DefaultLexer.h */,
|
||||||
114B6FA911FA7623004FB6AB /* Document.h */,
|
114B6FA911FA7623004FB6AB /* Document.h */,
|
||||||
28A1DD54196BE0ED006EFCDD /* EditModel.h */,
|
28A1DD54196BE0ED006EFCDD /* EditModel.h */,
|
||||||
114B6FAA11FA7623004FB6AB /* Editor.h */,
|
114B6FAA11FA7623004FB6AB /* Editor.h */,
|
||||||
@ -649,6 +699,7 @@
|
|||||||
114B6FAB11FA7623004FB6AB /* ExternalLexer.h */,
|
114B6FAB11FA7623004FB6AB /* ExternalLexer.h */,
|
||||||
114B6FAC11FA7623004FB6AB /* FontQuality.h */,
|
114B6FAC11FA7623004FB6AB /* FontQuality.h */,
|
||||||
114B6FA011FA75DB004FB6AB /* ILexer.h */,
|
114B6FA011FA75DB004FB6AB /* ILexer.h */,
|
||||||
|
282D4A951F53FE270082E4D3 /* ILoader.h */,
|
||||||
114B6FAD11FA7623004FB6AB /* Indicator.h */,
|
114B6FAD11FA7623004FB6AB /* Indicator.h */,
|
||||||
114B6FAE11FA7623004FB6AB /* KeyMap.h */,
|
114B6FAE11FA7623004FB6AB /* KeyMap.h */,
|
||||||
114B6FDA11FA7645004FB6AB /* LexAccessor.h */,
|
114B6FDA11FA7645004FB6AB /* LexAccessor.h */,
|
||||||
@ -673,7 +724,6 @@
|
|||||||
114B6FB811FA7623004FB6AB /* Style.h */,
|
114B6FB811FA7623004FB6AB /* Style.h */,
|
||||||
114B6FE111FA7645004FB6AB /* StyleContext.h */,
|
114B6FE111FA7645004FB6AB /* StyleContext.h */,
|
||||||
280056FA188DDD2C00F200AE /* SubStyles.h */,
|
280056FA188DDD2C00F200AE /* SubStyles.h */,
|
||||||
1100F1EA178E393200105727 /* UnicodeFromUTF8.h */,
|
|
||||||
114B6FBA11FA7623004FB6AB /* UniConversion.h */,
|
114B6FBA11FA7623004FB6AB /* UniConversion.h */,
|
||||||
114B6FBB11FA7623004FB6AB /* ViewStyle.h */,
|
114B6FBB11FA7623004FB6AB /* ViewStyle.h */,
|
||||||
114B6FE211FA7645004FB6AB /* WordList.h */,
|
114B6FE211FA7645004FB6AB /* WordList.h */,
|
||||||
@ -696,7 +746,9 @@
|
|||||||
114B6F8F11FA75BE004FB6AB /* CharacterSet.cxx */,
|
114B6F8F11FA75BE004FB6AB /* CharacterSet.cxx */,
|
||||||
114B6F6411FA7597004FB6AB /* CharClassify.cxx */,
|
114B6F6411FA7597004FB6AB /* CharClassify.cxx */,
|
||||||
114B6F6511FA7597004FB6AB /* ContractionState.cxx */,
|
114B6F6511FA7597004FB6AB /* ContractionState.cxx */,
|
||||||
|
28804B2B1EEE232E00C0D154 /* DBCS.cxx */,
|
||||||
114B6F6611FA7597004FB6AB /* Decoration.cxx */,
|
114B6F6611FA7597004FB6AB /* Decoration.cxx */,
|
||||||
|
28BDA1211EFB8F7C00EBD3F3 /* DefaultLexer.cxx */,
|
||||||
114B6F6711FA7597004FB6AB /* Document.cxx */,
|
114B6F6711FA7597004FB6AB /* Document.cxx */,
|
||||||
28A1DD4E196BE0CA006EFCDD /* EditModel.cxx */,
|
28A1DD4E196BE0CA006EFCDD /* EditModel.cxx */,
|
||||||
114B6F6811FA7597004FB6AB /* Editor.cxx */,
|
114B6F6811FA7597004FB6AB /* Editor.cxx */,
|
||||||
@ -737,6 +789,7 @@
|
|||||||
2744E59F0FC168A100E85C33 /* QuartzTextLayout.h */,
|
2744E59F0FC168A100E85C33 /* QuartzTextLayout.h */,
|
||||||
119FF1BE13C9D1820007CE42 /* QuartzTextStyle.h */,
|
119FF1BE13C9D1820007CE42 /* QuartzTextStyle.h */,
|
||||||
2744E5A00FC168A100E85C33 /* QuartzTextStyleAttribute.h */,
|
2744E5A00FC168A100E85C33 /* QuartzTextStyleAttribute.h */,
|
||||||
|
28BC38EB1B74C6AD008BF9EB /* Sci_Position.h */,
|
||||||
2744E4870FC1678600E85C33 /* SciLexer.h */,
|
2744E4870FC1678600E85C33 /* SciLexer.h */,
|
||||||
2744E4880FC1678600E85C33 /* Scintilla.h */,
|
2744E4880FC1678600E85C33 /* Scintilla.h */,
|
||||||
2744E5A20FC168A100E85C33 /* ScintillaCocoa.h */,
|
2744E5A20FC168A100E85C33 /* ScintillaCocoa.h */,
|
||||||
@ -785,9 +838,12 @@
|
|||||||
isa = PBXHeadersBuildPhase;
|
isa = PBXHeadersBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
28BC38EC1B74C6AD008BF9EB /* Sci_Position.h in Headers */,
|
||||||
|
114B6FA111FA75DB004FB6AB /* ILexer.h in Headers */,
|
||||||
2744E5A40FC168A100E85C33 /* InfoBar.h in Headers */,
|
2744E5A40FC168A100E85C33 /* InfoBar.h in Headers */,
|
||||||
2744E5AC0FC168B200E85C33 /* InfoBarCommunicator.h in Headers */,
|
2744E5AC0FC168B200E85C33 /* InfoBarCommunicator.h in Headers */,
|
||||||
2744E5AA0FC168A100E85C33 /* ScintillaView.h in Headers */,
|
2744E5AA0FC168A100E85C33 /* ScintillaView.h in Headers */,
|
||||||
|
28BDA1241EFB8FB200EBD3F3 /* DefaultLexer.h in Headers */,
|
||||||
280056FB188DDD2C00F200AE /* SparseState.h in Headers */,
|
280056FB188DDD2C00F200AE /* SparseState.h in Headers */,
|
||||||
2791F3C80FC19F71009DBCF9 /* SciLexer.h in Headers */,
|
2791F3C80FC19F71009DBCF9 /* SciLexer.h in Headers */,
|
||||||
2791F3C60FC19F71009DBCF9 /* PlatCocoa.h in Headers */,
|
2791F3C60FC19F71009DBCF9 /* PlatCocoa.h in Headers */,
|
||||||
@ -796,7 +852,6 @@
|
|||||||
2791F3E00FC1A390009DBCF9 /* ScintillaCocoa.h in Headers */,
|
2791F3E00FC1A390009DBCF9 /* ScintillaCocoa.h in Headers */,
|
||||||
2791F3C70FC19F71009DBCF9 /* Platform.h in Headers */,
|
2791F3C70FC19F71009DBCF9 /* Platform.h in Headers */,
|
||||||
2791F3C90FC19F71009DBCF9 /* Scintilla.h in Headers */,
|
2791F3C90FC19F71009DBCF9 /* Scintilla.h in Headers */,
|
||||||
114B6FA111FA75DB004FB6AB /* ILexer.h in Headers */,
|
|
||||||
114B6FBD11FA7623004FB6AB /* AutoComplete.h in Headers */,
|
114B6FBD11FA7623004FB6AB /* AutoComplete.h in Headers */,
|
||||||
114B6FBE11FA7623004FB6AB /* CallTip.h in Headers */,
|
114B6FBE11FA7623004FB6AB /* CallTip.h in Headers */,
|
||||||
114B6FBF11FA7623004FB6AB /* Catalogue.h in Headers */,
|
114B6FBF11FA7623004FB6AB /* Catalogue.h in Headers */,
|
||||||
@ -804,6 +859,7 @@
|
|||||||
114B6FC111FA7623004FB6AB /* CharClassify.h in Headers */,
|
114B6FC111FA7623004FB6AB /* CharClassify.h in Headers */,
|
||||||
114B6FC211FA7623004FB6AB /* ContractionState.h in Headers */,
|
114B6FC211FA7623004FB6AB /* ContractionState.h in Headers */,
|
||||||
114B6FC311FA7623004FB6AB /* Decoration.h in Headers */,
|
114B6FC311FA7623004FB6AB /* Decoration.h in Headers */,
|
||||||
|
282D4A961F53FE270082E4D3 /* ILoader.h in Headers */,
|
||||||
114B6FC411FA7623004FB6AB /* Document.h in Headers */,
|
114B6FC411FA7623004FB6AB /* Document.h in Headers */,
|
||||||
114B6FC511FA7623004FB6AB /* Editor.h in Headers */,
|
114B6FC511FA7623004FB6AB /* Editor.h in Headers */,
|
||||||
114B6FC611FA7623004FB6AB /* ExternalLexer.h in Headers */,
|
114B6FC611FA7623004FB6AB /* ExternalLexer.h in Headers */,
|
||||||
@ -843,7 +899,6 @@
|
|||||||
11FBA39E17817DA00048C071 /* CharacterCategory.h in Headers */,
|
11FBA39E17817DA00048C071 /* CharacterCategory.h in Headers */,
|
||||||
1100F1EC178E393200105727 /* CaseConvert.h in Headers */,
|
1100F1EC178E393200105727 /* CaseConvert.h in Headers */,
|
||||||
1100F1EE178E393200105727 /* CaseFolder.h in Headers */,
|
1100F1EE178E393200105727 /* CaseFolder.h in Headers */,
|
||||||
1100F1EF178E393200105727 /* UnicodeFromUTF8.h in Headers */,
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@ -875,7 +930,7 @@
|
|||||||
0867D690FE84028FC02AAC07 /* Project object */ = {
|
0867D690FE84028FC02AAC07 /* Project object */ = {
|
||||||
isa = PBXProject;
|
isa = PBXProject;
|
||||||
attributes = {
|
attributes = {
|
||||||
LastUpgradeCheck = 0610;
|
LastUpgradeCheck = 0930;
|
||||||
};
|
};
|
||||||
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "ScintillaFramework" */;
|
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "ScintillaFramework" */;
|
||||||
compatibilityVersion = "Xcode 3.2";
|
compatibilityVersion = "Xcode 3.2";
|
||||||
@ -923,8 +978,12 @@
|
|||||||
2744E5B30FC168C500E85C33 /* PlatCocoa.mm in Sources */,
|
2744E5B30FC168C500E85C33 /* PlatCocoa.mm in Sources */,
|
||||||
2744E5B50FC168C500E85C33 /* ScintillaCocoa.mm in Sources */,
|
2744E5B50FC168C500E85C33 /* ScintillaCocoa.mm in Sources */,
|
||||||
2744E5B60FC168C500E85C33 /* ScintillaView.mm in Sources */,
|
2744E5B60FC168C500E85C33 /* ScintillaView.mm in Sources */,
|
||||||
|
28D191A21DEA72C800159938 /* LexEDIFACT.cxx in Sources */,
|
||||||
|
28BDA1221EFB8F7C00EBD3F3 /* DefaultLexer.cxx in Sources */,
|
||||||
114B6F0D11FA7526004FB6AB /* LexAbaqus.cxx in Sources */,
|
114B6F0D11FA7526004FB6AB /* LexAbaqus.cxx in Sources */,
|
||||||
114B6F0E11FA7526004FB6AB /* LexAda.cxx in Sources */,
|
114B6F0E11FA7526004FB6AB /* LexAda.cxx in Sources */,
|
||||||
|
28B6470C1B54C0720009DC49 /* LexBatch.cxx in Sources */,
|
||||||
|
28B6470F1B54C0720009DC49 /* LexMake.cxx in Sources */,
|
||||||
114B6F0F11FA7526004FB6AB /* LexAPDL.cxx in Sources */,
|
114B6F0F11FA7526004FB6AB /* LexAPDL.cxx in Sources */,
|
||||||
114B6F1011FA7526004FB6AB /* LexAsm.cxx in Sources */,
|
114B6F1011FA7526004FB6AB /* LexAsm.cxx in Sources */,
|
||||||
114B6F1111FA7526004FB6AB /* LexAsn1.cxx in Sources */,
|
114B6F1111FA7526004FB6AB /* LexAsn1.cxx in Sources */,
|
||||||
@ -938,10 +997,13 @@
|
|||||||
114B6F1911FA7526004FB6AB /* LexCaml.cxx in Sources */,
|
114B6F1911FA7526004FB6AB /* LexCaml.cxx in Sources */,
|
||||||
114B6F1A11FA7526004FB6AB /* LexCLW.cxx in Sources */,
|
114B6F1A11FA7526004FB6AB /* LexCLW.cxx in Sources */,
|
||||||
114B6F1B11FA7526004FB6AB /* LexCmake.cxx in Sources */,
|
114B6F1B11FA7526004FB6AB /* LexCmake.cxx in Sources */,
|
||||||
|
28C40CA81CB7321200B089F2 /* LexJSON.cxx in Sources */,
|
||||||
114B6F1C11FA7526004FB6AB /* LexCOBOL.cxx in Sources */,
|
114B6F1C11FA7526004FB6AB /* LexCOBOL.cxx in Sources */,
|
||||||
114B6F1D11FA7526004FB6AB /* LexConf.cxx in Sources */,
|
114B6F1D11FA7526004FB6AB /* LexConf.cxx in Sources */,
|
||||||
|
28B647101B54C0720009DC49 /* LexNull.cxx in Sources */,
|
||||||
114B6F1E11FA7526004FB6AB /* LexCPP.cxx in Sources */,
|
114B6F1E11FA7526004FB6AB /* LexCPP.cxx in Sources */,
|
||||||
114B6F1F11FA7526004FB6AB /* LexCrontab.cxx in Sources */,
|
114B6F1F11FA7526004FB6AB /* LexCrontab.cxx in Sources */,
|
||||||
|
28B647111B54C0720009DC49 /* LexProps.cxx in Sources */,
|
||||||
114B6F2011FA7526004FB6AB /* LexCsound.cxx in Sources */,
|
114B6F2011FA7526004FB6AB /* LexCsound.cxx in Sources */,
|
||||||
114B6F2111FA7526004FB6AB /* LexCSS.cxx in Sources */,
|
114B6F2111FA7526004FB6AB /* LexCSS.cxx in Sources */,
|
||||||
114B6F2211FA7526004FB6AB /* LexD.cxx in Sources */,
|
114B6F2211FA7526004FB6AB /* LexD.cxx in Sources */,
|
||||||
@ -974,9 +1036,10 @@
|
|||||||
114B6F3911FA7526004FB6AB /* LexMySQL.cxx in Sources */,
|
114B6F3911FA7526004FB6AB /* LexMySQL.cxx in Sources */,
|
||||||
114B6F3A11FA7526004FB6AB /* LexNimrod.cxx in Sources */,
|
114B6F3A11FA7526004FB6AB /* LexNimrod.cxx in Sources */,
|
||||||
114B6F3B11FA7526004FB6AB /* LexNsis.cxx in Sources */,
|
114B6F3B11FA7526004FB6AB /* LexNsis.cxx in Sources */,
|
||||||
|
28804B2C1EEE232E00C0D154 /* DBCS.cxx in Sources */,
|
||||||
114B6F3C11FA7526004FB6AB /* LexOpal.cxx in Sources */,
|
114B6F3C11FA7526004FB6AB /* LexOpal.cxx in Sources */,
|
||||||
114B6F3D11FA7526004FB6AB /* LexOthers.cxx in Sources */,
|
|
||||||
114B6F3E11FA7526004FB6AB /* LexPascal.cxx in Sources */,
|
114B6F3E11FA7526004FB6AB /* LexPascal.cxx in Sources */,
|
||||||
|
28B6470D1B54C0720009DC49 /* LexDiff.cxx in Sources */,
|
||||||
114B6F3F11FA7526004FB6AB /* LexPB.cxx in Sources */,
|
114B6F3F11FA7526004FB6AB /* LexPB.cxx in Sources */,
|
||||||
114B6F4011FA7526004FB6AB /* LexPerl.cxx in Sources */,
|
114B6F4011FA7526004FB6AB /* LexPerl.cxx in Sources */,
|
||||||
114B6F4111FA7526004FB6AB /* LexPLM.cxx in Sources */,
|
114B6F4111FA7526004FB6AB /* LexPLM.cxx in Sources */,
|
||||||
@ -1029,6 +1092,7 @@
|
|||||||
114B6F8911FA7598004FB6AB /* Selection.cxx in Sources */,
|
114B6F8911FA7598004FB6AB /* Selection.cxx in Sources */,
|
||||||
114B6F8A11FA7598004FB6AB /* Style.cxx in Sources */,
|
114B6F8A11FA7598004FB6AB /* Style.cxx in Sources */,
|
||||||
28A7D6051995E47D0062D204 /* LexRegistry.cxx in Sources */,
|
28A7D6051995E47D0062D204 /* LexRegistry.cxx in Sources */,
|
||||||
|
28B6470E1B54C0720009DC49 /* LexErrorList.cxx in Sources */,
|
||||||
114B6F8B11FA7598004FB6AB /* UniConversion.cxx in Sources */,
|
114B6F8B11FA7598004FB6AB /* UniConversion.cxx in Sources */,
|
||||||
114B6F8C11FA7598004FB6AB /* ViewStyle.cxx in Sources */,
|
114B6F8C11FA7598004FB6AB /* ViewStyle.cxx in Sources */,
|
||||||
114B6F8D11FA7598004FB6AB /* XPM.cxx in Sources */,
|
114B6F8D11FA7598004FB6AB /* XPM.cxx in Sources */,
|
||||||
@ -1058,6 +1122,12 @@
|
|||||||
11FDD0E017C480D4001541B9 /* LexKVIrc.cxx in Sources */,
|
11FDD0E017C480D4001541B9 /* LexKVIrc.cxx in Sources */,
|
||||||
1160E0381803651C00BCEBCB /* LexRust.cxx in Sources */,
|
1160E0381803651C00BCEBCB /* LexRust.cxx in Sources */,
|
||||||
11FF3FE21810EB3900E13F13 /* LexDMAP.cxx in Sources */,
|
11FF3FE21810EB3900E13F13 /* LexDMAP.cxx in Sources */,
|
||||||
|
F437405F9F32C7DEFCA38C11 /* LexIndent.cxx in Sources */,
|
||||||
|
3D994BD7A5EAC4FA5B3CFBDF /* LexMaxima.cxx in Sources */,
|
||||||
|
FDC7442CAD70B9A67EF1639D /* LexSAS.cxx in Sources */,
|
||||||
|
5F804AA6B60FE695863A39FE /* LexStata.cxx in Sources */,
|
||||||
|
0ED84236A703D57578EBFD2F /* LexNim.cxx in Sources */,
|
||||||
|
00724A59981D34F11A3D162F /* LexCIL.cxx in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@ -1080,8 +1150,10 @@
|
|||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
COPY_PHASE_STRIP = NO;
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEFINES_MODULE = YES;
|
||||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
DYLIB_CURRENT_VERSION = 1;
|
DYLIB_CURRENT_VERSION = 1;
|
||||||
EXCLUDED_RECURSIVE_SEARCH_PATH_SUBDIRECTORIES = ".bzr *.nib *.lproj *.framework *.gch (*) CVS .svn *.xcodeproj *.xcode *.pbproj *.pbxproj";
|
EXCLUDED_RECURSIVE_SEARCH_PATH_SUBDIRECTORIES = ".bzr *.nib *.lproj *.framework *.gch (*) CVS .svn *.xcodeproj *.xcode *.pbproj *.pbxproj";
|
||||||
@ -1091,10 +1163,7 @@
|
|||||||
GCC_OPTIMIZATION_LEVEL = 0;
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||||
GCC_PREFIX_HEADER = Scintilla_Prefix.pch;
|
GCC_PREFIX_HEADER = Scintilla_Prefix.pch;
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
GCC_PREPROCESSOR_DEFINITIONS = SCI_LEXER;
|
||||||
SCI_NAMESPACE,
|
|
||||||
SCI_LEXER,
|
|
||||||
);
|
|
||||||
GCC_WARN_UNINITIALIZED_AUTOS = NO;
|
GCC_WARN_UNINITIALIZED_AUTOS = NO;
|
||||||
GCC_WARN_UNKNOWN_PRAGMAS = YES;
|
GCC_WARN_UNKNOWN_PRAGMAS = YES;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
@ -1102,6 +1171,8 @@
|
|||||||
INFOPLIST_FILE = Info.plist;
|
INFOPLIST_FILE = Info.plist;
|
||||||
INSTALL_PATH = "@executable_path/../Frameworks";
|
INSTALL_PATH = "@executable_path/../Frameworks";
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||||
|
MODULEMAP_FILE = module.modulemap;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = "com.sun.${PRODUCT_NAME:identifier}";
|
||||||
PRODUCT_NAME = Scintilla;
|
PRODUCT_NAME = Scintilla;
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
WRAPPER_EXTENSION = framework;
|
WRAPPER_EXTENSION = framework;
|
||||||
@ -1113,18 +1184,17 @@
|
|||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
DEFINES_MODULE = YES;
|
||||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
DYLIB_CURRENT_VERSION = 1;
|
DYLIB_CURRENT_VERSION = 1;
|
||||||
FRAMEWORK_VERSION = A;
|
FRAMEWORK_VERSION = A;
|
||||||
GCC_MODEL_TUNING = G5;
|
GCC_MODEL_TUNING = G5;
|
||||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||||
GCC_PREFIX_HEADER = Scintilla_Prefix.pch;
|
GCC_PREFIX_HEADER = Scintilla_Prefix.pch;
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
GCC_PREPROCESSOR_DEFINITIONS = SCI_LEXER;
|
||||||
SCI_NAMESPACE,
|
|
||||||
SCI_LEXER,
|
|
||||||
);
|
|
||||||
GCC_WARN_UNINITIALIZED_AUTOS = NO;
|
GCC_WARN_UNINITIALIZED_AUTOS = NO;
|
||||||
GCC_WARN_UNKNOWN_PRAGMAS = YES;
|
GCC_WARN_UNKNOWN_PRAGMAS = YES;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
@ -1132,6 +1202,8 @@
|
|||||||
INFOPLIST_FILE = Info.plist;
|
INFOPLIST_FILE = Info.plist;
|
||||||
INSTALL_PATH = "@executable_path/../Frameworks";
|
INSTALL_PATH = "@executable_path/../Frameworks";
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||||
|
MODULEMAP_FILE = module.modulemap;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = "com.sun.${PRODUCT_NAME:identifier}";
|
||||||
PRODUCT_NAME = Scintilla;
|
PRODUCT_NAME = Scintilla;
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
WRAPPER_EXTENSION = framework;
|
WRAPPER_EXTENSION = framework;
|
||||||
@ -1141,17 +1213,43 @@
|
|||||||
1DEB91B208733DA50010E9CD /* Debug */ = {
|
1DEB91B208733DA50010E9CD /* Debug */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = 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_C_LANGUAGE_STANDARD = c99;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
GCC_OPTIMIZATION_LEVEL = 0;
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = 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;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
HEADER_SEARCH_PATHS = (
|
HEADER_SEARCH_PATHS = (
|
||||||
../../include,
|
../../include,
|
||||||
../../src,
|
../../src,
|
||||||
../../lexlib,
|
../../lexlib,
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.5;
|
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
};
|
};
|
||||||
@ -1160,16 +1258,41 @@
|
|||||||
1DEB91B308733DA50010E9CD /* Release */ = {
|
1DEB91B308733DA50010E9CD /* Release */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = 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_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_ABOUT_RETURN_TYPE = YES;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
HEADER_SEARCH_PATHS = (
|
HEADER_SEARCH_PATHS = (
|
||||||
../../include,
|
../../include,
|
||||||
../../src,
|
../../src,
|
||||||
../../lexlib,
|
../../lexlib,
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.5;
|
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "self:ScintillaFramework.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
10
scintilla/cocoa/ScintillaFramework/module.modulemap
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
framework module Scintilla {
|
||||||
|
umbrella header "ScintillaView.h"
|
||||||
|
module InfoBar {
|
||||||
|
header "InfoBar.h"
|
||||||
|
}
|
||||||
|
// ILexer.h is not included as Swift doesn't yet interoperate with C++
|
||||||
|
exclude header "ILexer.h"
|
||||||
|
export *
|
||||||
|
module * { export * }
|
||||||
|
}
|
@ -15,10 +15,12 @@
|
|||||||
@interface AppController : NSObject {
|
@interface AppController : NSObject {
|
||||||
IBOutlet NSBox *mEditHost;
|
IBOutlet NSBox *mEditHost;
|
||||||
ScintillaView* mEditor;
|
ScintillaView* mEditor;
|
||||||
|
ScintillaView* sciExtra; // For testing Scintilla tear-down
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) awakeFromNib;
|
- (void) awakeFromNib;
|
||||||
- (void) setupEditor;
|
- (void) setupEditor;
|
||||||
- (IBAction) searchText: (id) sender;
|
- (IBAction) searchText: (id) sender;
|
||||||
|
- (IBAction) addRemoveExtra: (id) sender;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -72,20 +72,30 @@ const char user_keywords[] = // Definition of own keywords, not used by MySQL.
|
|||||||
[mEditor setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
|
[mEditor setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
|
||||||
|
|
||||||
// Let's load some text for the editor, as initial content.
|
// Let's load some text for the editor, as initial content.
|
||||||
|
NSString *sql = [self exampleText];
|
||||||
|
|
||||||
|
[mEditor setString: sql];
|
||||||
|
|
||||||
|
[self setupEditor];
|
||||||
|
|
||||||
|
sciExtra = nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) exampleText
|
||||||
|
{
|
||||||
NSError* error = nil;
|
NSError* error = nil;
|
||||||
|
|
||||||
NSString* path = [[NSBundle mainBundle] pathForResource: @"TestData"
|
NSString* path = [[NSBundle mainBundle] pathForResource: @"TestData"
|
||||||
ofType: @"sql" inDirectory: nil];
|
ofType: @"sql" inDirectory: nil];
|
||||||
|
|
||||||
NSString* sql = [NSString stringWithContentsOfFile: path
|
NSString *sql = [NSString stringWithContentsOfFile: path
|
||||||
encoding: NSUTF8StringEncoding
|
encoding: NSUTF8StringEncoding
|
||||||
error: &error];
|
error: &error];
|
||||||
|
|
||||||
if (error && [[error domain] isEqual: NSCocoaErrorDomain])
|
if (error && [[error domain] isEqual: NSCocoaErrorDomain])
|
||||||
NSLog(@"%@", error);
|
NSLog(@"%@", error);
|
||||||
|
|
||||||
[mEditor setString: sql];
|
return sql;
|
||||||
|
|
||||||
[self setupEditor];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -99,9 +109,6 @@ const char user_keywords[] = // Definition of own keywords, not used by MySQL.
|
|||||||
[mEditor setGeneralProperty: SCI_SETLEXER parameter: SCLEX_MYSQL value: 0];
|
[mEditor setGeneralProperty: SCI_SETLEXER parameter: SCLEX_MYSQL value: 0];
|
||||||
// alternatively: [mEditor setEditorProperty: SCI_SETLEXERLANGUAGE parameter: nil value: (sptr_t) "mysql"];
|
// 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:
|
// Keywords to highlight. Indices are:
|
||||||
// 0 - Major keywords (reserved keywords)
|
// 0 - Major keywords (reserved keywords)
|
||||||
// 1 - Normal keywords (everything not reserved but integral part of the language)
|
// 1 - Normal keywords (everything not reserved but integral part of the language)
|
||||||
@ -234,7 +241,7 @@ static const char * box_xpm[] = {
|
|||||||
|
|
||||||
- (void) showAutocompletion
|
- (void) showAutocompletion
|
||||||
{
|
{
|
||||||
const char *words = "Babylon-5?1 Battlestar-Galactica Millenium-Falcon?2 Moya?2 Serenity Voyager";
|
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_AUTOCSETIGNORECASE parameter: 1 value:0];
|
||||||
[mEditor setGeneralProperty: SCI_REGISTERIMAGE parameter: 1 value:(sptr_t)box_xpm];
|
[mEditor setGeneralProperty: SCI_REGISTERIMAGE parameter: 1 value:(sptr_t)box_xpm];
|
||||||
const int imSize = 12;
|
const int imSize = 12;
|
||||||
@ -271,6 +278,26 @@ static const char * box_xpm[] = {
|
|||||||
[self showAutocompletion];
|
[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];
|
||||||
|
NSString *sql = [self exampleText];
|
||||||
|
[sciExtra setString: sql];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
-(IBAction) setFontQuality: (id) sender
|
-(IBAction) setFontQuality: (id) sender
|
||||||
{
|
{
|
||||||
[ScintillaView directCall:mEditor message:SCI_SETFONTQUALITY wParam:[sender tag] lParam:0];
|
[ScintillaView directCall:mEditor message:SCI_SETFONTQUALITY wParam:[sender tag] lParam:0];
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<key>CFBundleIconFile</key>
|
<key>CFBundleIconFile</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>com.sun.${PRODUCT_NAME:identifier}</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
271FA52C0F850BE20033D021 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 271FA52B0F850BE20033D021 /* AppController.mm */; };
|
271FA52C0F850BE20033D021 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 271FA52B0F850BE20033D021 /* AppController.mm */; };
|
||||||
2791F4490FC1A8E9009DBCF9 /* TestData.sql in Resources */ = {isa = PBXBuildFile; fileRef = 2791F4480FC1A8E9009DBCF9 /* TestData.sql */; };
|
2791F4490FC1A8E9009DBCF9 /* TestData.sql in Resources */ = {isa = PBXBuildFile; fileRef = 2791F4480FC1A8E9009DBCF9 /* TestData.sql */; };
|
||||||
27AF7EC30FC2C351007160EF /* Scintilla.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2744E5EA0FC16BE200E85C33 /* Scintilla.framework */; };
|
27AF7EC30FC2C351007160EF /* Scintilla.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2744E5EA0FC16BE200E85C33 /* Scintilla.framework */; };
|
||||||
27AF7ECA0FC2C388007160EF /* Scintilla.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2744E5EA0FC16BE200E85C33 /* Scintilla.framework */; };
|
27AF7ECA0FC2C388007160EF /* Scintilla.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2744E5EA0FC16BE200E85C33 /* Scintilla.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
|
||||||
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
|
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
|
||||||
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
|
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
|
||||||
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
|
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
|
||||||
@ -191,7 +191,7 @@
|
|||||||
29B97313FDCFA39411CA2CEA /* Project object */ = {
|
29B97313FDCFA39411CA2CEA /* Project object */ = {
|
||||||
isa = PBXProject;
|
isa = PBXProject;
|
||||||
attributes = {
|
attributes = {
|
||||||
LastUpgradeCheck = 0510;
|
LastUpgradeCheck = 0930;
|
||||||
};
|
};
|
||||||
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ScintillaTest" */;
|
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ScintillaTest" */;
|
||||||
compatibilityVersion = "Xcode 3.2";
|
compatibilityVersion = "Xcode 3.2";
|
||||||
@ -285,7 +285,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
COPY_PHASE_STRIP = NO;
|
COPY_PHASE_STRIP = NO;
|
||||||
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
|
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
|
||||||
@ -294,15 +294,13 @@
|
|||||||
GCC_OPTIMIZATION_LEVEL = 0;
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||||
GCC_PREFIX_HEADER = ScintillaTest_Prefix.pch;
|
GCC_PREFIX_HEADER = ScintillaTest_Prefix.pch;
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
GCC_PREPROCESSOR_DEFINITIONS = SCI_LEXER;
|
||||||
SCI_LEXER,
|
|
||||||
SCI_NAMESPACE,
|
|
||||||
);
|
|
||||||
HEADER_SEARCH_PATHS = "";
|
HEADER_SEARCH_PATHS = "";
|
||||||
INFOPLIST_FILE = Info.plist;
|
INFOPLIST_FILE = Info.plist;
|
||||||
INSTALL_PATH = "$(HOME)/Applications";
|
INSTALL_PATH = "$(HOME)/Applications";
|
||||||
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
||||||
OTHER_LDFLAGS = "";
|
OTHER_LDFLAGS = "";
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = "com.sun.${PRODUCT_NAME:identifier}";
|
||||||
PRODUCT_NAME = ScintillaTest;
|
PRODUCT_NAME = ScintillaTest;
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
USER_HEADER_SEARCH_PATHS = "";
|
USER_HEADER_SEARCH_PATHS = "";
|
||||||
@ -313,22 +311,20 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
|
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
|
||||||
GCC_MODEL_TUNING = G5;
|
GCC_MODEL_TUNING = G5;
|
||||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||||
GCC_PREFIX_HEADER = ScintillaTest_Prefix.pch;
|
GCC_PREFIX_HEADER = ScintillaTest_Prefix.pch;
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
GCC_PREPROCESSOR_DEFINITIONS = SCI_LEXER;
|
||||||
SCI_LEXER,
|
|
||||||
SCI_NAMESPACE,
|
|
||||||
);
|
|
||||||
HEADER_SEARCH_PATHS = "";
|
HEADER_SEARCH_PATHS = "";
|
||||||
INFOPLIST_FILE = Info.plist;
|
INFOPLIST_FILE = Info.plist;
|
||||||
INSTALL_PATH = "$(HOME)/Applications";
|
INSTALL_PATH = "$(HOME)/Applications";
|
||||||
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
||||||
OTHER_LDFLAGS = "";
|
OTHER_LDFLAGS = "";
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = "com.sun.${PRODUCT_NAME:identifier}";
|
||||||
PRODUCT_NAME = ScintillaTest;
|
PRODUCT_NAME = ScintillaTest;
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
USER_HEADER_SEARCH_PATHS = "";
|
USER_HEADER_SEARCH_PATHS = "";
|
||||||
@ -338,14 +334,28 @@
|
|||||||
C01FCF4F08A954540054247B /* Debug */ = {
|
C01FCF4F08A954540054247B /* Debug */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
CLANG_WARN_EMPTY_BODY = YES;
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
CLANG_WARN_INT_CONVERSION = YES;
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_TESTABILITY = YES;
|
||||||
GCC_C_LANGUAGE_STANDARD = c99;
|
GCC_C_LANGUAGE_STANDARD = c99;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
GCC_OPTIMIZATION_LEVEL = 0;
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
@ -363,14 +373,27 @@
|
|||||||
C01FCF5008A954540054247B /* Release */ = {
|
C01FCF5008A954540054247B /* Release */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
CLANG_WARN_EMPTY_BODY = YES;
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
CLANG_WARN_INT_CONVERSION = YES;
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
GCC_C_LANGUAGE_STANDARD = c99;
|
GCC_C_LANGUAGE_STANDARD = c99;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "self:ScintillaTest.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
@ -23,7 +23,6 @@
|
|||||||
#define WM_COMMAND 1001
|
#define WM_COMMAND 1001
|
||||||
#define WM_NOTIFY 1002
|
#define WM_NOTIFY 1002
|
||||||
|
|
||||||
namespace Scintilla {
|
|
||||||
/**
|
/**
|
||||||
* On the Mac, there is no WM_COMMAND or WM_NOTIFY message that can be sent
|
* 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
|
* back to the parent. Therefore, there must be a callback handler that acts
|
||||||
@ -35,34 +34,25 @@ namespace Scintilla {
|
|||||||
* <br>
|
* <br>
|
||||||
* WM_NOTIFY: wParam = control ID, lParam = ptr to SCNotification structure, with hwndFrom set to 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);
|
typedef void(*SciNotifyFunc)(intptr_t windowid, unsigned int iMessage, uintptr_t wParam, uintptr_t lParam);
|
||||||
|
|
||||||
class ScintillaCocoa;
|
|
||||||
}
|
|
||||||
|
|
||||||
@class ScintillaView;
|
|
||||||
|
|
||||||
extern NSString *const SCIUpdateUINotification;
|
extern NSString *const SCIUpdateUINotification;
|
||||||
|
|
||||||
@protocol ScintillaNotificationProtocol
|
@protocol ScintillaNotificationProtocol
|
||||||
- (void)notification: (Scintilla::SCNotification*)notification;
|
- (void) notification: (SCNotification *) notification;
|
||||||
|
@end
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SCIScrollView provides pre-macOS 10.14 tiling behavior.
|
||||||
|
*/
|
||||||
|
@interface SCIScrollView : NSScrollView;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SCIMarginView draws line numbers and other margins next to the text view.
|
* SCIMarginView draws line numbers and other margins next to the text view.
|
||||||
*/
|
*/
|
||||||
@interface SCIMarginView : NSRulerView
|
@interface SCIMarginView : NSRulerView;
|
||||||
{
|
|
||||||
@private
|
|
||||||
int marginWidth;
|
|
||||||
ScintillaView *owner;
|
|
||||||
NSMutableArray *currentCursors;
|
|
||||||
}
|
|
||||||
|
|
||||||
@property (assign) int marginWidth;
|
|
||||||
@property (assign) ScintillaView *owner;
|
|
||||||
|
|
||||||
- (id)initWithScrollView:(NSScrollView *)aScrollView;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@ -74,85 +64,59 @@ extern NSString *const SCIUpdateUINotification;
|
|||||||
NSTextInputClient,
|
NSTextInputClient,
|
||||||
NSUserInterfaceValidations,
|
NSUserInterfaceValidations,
|
||||||
NSDraggingSource,
|
NSDraggingSource,
|
||||||
NSDraggingDestination>
|
NSDraggingDestination,
|
||||||
{
|
NSAccessibilityStaticText>;
|
||||||
@private
|
|
||||||
ScintillaView* mOwner;
|
|
||||||
NSCursor* mCurrentCursor;
|
|
||||||
NSTrackingArea *trackingArea;
|
|
||||||
|
|
||||||
// Set when we are in composition mode and partial input is displayed.
|
- (void) setCursor: (int) cursor; // Needed by ScintillaCocoa
|
||||||
NSRange mMarkedTextRange;
|
|
||||||
}
|
|
||||||
|
|
||||||
@property (nonatomic, assign) ScintillaView* owner;
|
|
||||||
|
|
||||||
- (void) setCursor: (int) cursor;
|
|
||||||
|
|
||||||
- (BOOL) canUndo;
|
|
||||||
- (BOOL) canRedo;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface ScintillaView : NSView <InfoBarCommunicator, ScintillaNotificationProtocol>
|
/**
|
||||||
{
|
* ScintillaView is the class instantiated by client code.
|
||||||
@private
|
* It contains an NSScrollView which contains a SCIMarginView and a SCIContentView.
|
||||||
// The back end is kind of a controller and model in one.
|
* It is responsible for providing an API and communicating to a delegate.
|
||||||
// It uses the content view for display.
|
*/
|
||||||
Scintilla::ScintillaCocoa* mBackend;
|
@interface ScintillaView : NSView <InfoBarCommunicator, ScintillaNotificationProtocol>;
|
||||||
|
|
||||||
// This is the actual content to which the backend renders itself.
|
@property(nonatomic, unsafe_unretained) id<ScintillaNotificationProtocol> delegate;
|
||||||
SCIContentView* mContent;
|
@property(nonatomic, readonly) NSScrollView *scrollView;
|
||||||
|
|
||||||
NSScrollView *scrollView;
|
|
||||||
SCIMarginView *marginView;
|
|
||||||
|
|
||||||
CGFloat zoomDelta;
|
|
||||||
|
|
||||||
// Area to display additional controls (e.g. zoom info, caret position, status info).
|
|
||||||
NSView <InfoBarCommunicator>* mInfoBar;
|
|
||||||
BOOL mInfoBarAtTop;
|
|
||||||
|
|
||||||
id<ScintillaNotificationProtocol> mDelegate;
|
|
||||||
}
|
|
||||||
|
|
||||||
@property (nonatomic, readonly) Scintilla::ScintillaCocoa* backend;
|
|
||||||
@property (nonatomic, assign) id<ScintillaNotificationProtocol> delegate;
|
|
||||||
@property (nonatomic, readonly) NSScrollView *scrollView;
|
|
||||||
|
|
||||||
+ (Class) contentViewClass;
|
+ (Class) contentViewClass;
|
||||||
|
|
||||||
- (void) notify: (NotificationType) type message: (NSString*) message location: (NSPoint) location
|
- (void) notify: (NotificationType) type message: (NSString *) message location: (NSPoint) location
|
||||||
value: (float) value;
|
value: (float) value;
|
||||||
- (void) setCallback: (id <InfoBarCommunicator>) callback;
|
- (void) setCallback: (id <InfoBarCommunicator>) callback;
|
||||||
|
|
||||||
- (void) suspendDrawing: (BOOL) suspend;
|
- (void) suspendDrawing: (BOOL) suspend;
|
||||||
- (void) notification: (Scintilla::SCNotification*) notification;
|
- (void) notification: (SCNotification *) notification;
|
||||||
|
|
||||||
|
- (void) updateIndicatorIME;
|
||||||
|
|
||||||
// Scroller handling
|
// Scroller handling
|
||||||
- (void) setMarginWidth: (int) width;
|
- (void) setMarginWidth: (int) width;
|
||||||
- (SCIContentView*) content;
|
- (SCIContentView *) content;
|
||||||
- (void) updateMarginCursors;
|
- (void) updateMarginCursors;
|
||||||
|
|
||||||
// NSTextView compatibility layer.
|
// NSTextView compatibility layer.
|
||||||
- (NSString*) string;
|
- (NSString *) string;
|
||||||
- (void) setString: (NSString*) aString;
|
- (void) setString: (NSString *) aString;
|
||||||
- (void) insertText: (id) aString;
|
- (void) insertText: (id) aString;
|
||||||
- (void) setEditable: (BOOL) editable;
|
- (void) setEditable: (BOOL) editable;
|
||||||
- (BOOL) isEditable;
|
- (BOOL) isEditable;
|
||||||
- (NSRange) selectedRange;
|
- (NSRange) selectedRange;
|
||||||
|
- (NSRange) selectedRangePositions;
|
||||||
|
|
||||||
- (NSString*) selectedString;
|
- (NSString *) selectedString;
|
||||||
|
|
||||||
- (void) deleteRange: (NSRange) range;
|
- (void) deleteRange: (NSRange) range;
|
||||||
|
|
||||||
- (void)setFontName: (NSString*) font
|
- (void) setFontName: (NSString *) font
|
||||||
size: (int) size
|
size: (int) size
|
||||||
bold: (BOOL) bold
|
bold: (BOOL) bold
|
||||||
italic: (BOOL) italic;
|
italic: (BOOL) italic;
|
||||||
|
|
||||||
// Native call through to the backend.
|
// Native call through to the backend.
|
||||||
+ (sptr_t) directCall: (ScintillaView*) sender message: (unsigned int) message wParam: (uptr_t) wParam
|
+ (sptr_t) directCall: (ScintillaView *) sender message: (unsigned int) message wParam: (uptr_t) wParam
|
||||||
lParam: (sptr_t) lParam;
|
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 lParam: (sptr_t) lParam;
|
||||||
- (sptr_t) message: (unsigned int) message wParam: (uptr_t) wParam;
|
- (sptr_t) message: (unsigned int) message wParam: (uptr_t) wParam;
|
||||||
@ -165,38 +129,38 @@ extern NSString *const SCIUpdateUINotification;
|
|||||||
- (long) getGeneralProperty: (int) property;
|
- (long) getGeneralProperty: (int) property;
|
||||||
- (long) getGeneralProperty: (int) property parameter: (long) parameter;
|
- (long) getGeneralProperty: (int) property parameter: (long) parameter;
|
||||||
- (long) getGeneralProperty: (int) property parameter: (long) parameter extra: (long) extra;
|
- (long) getGeneralProperty: (int) property parameter: (long) parameter extra: (long) extra;
|
||||||
- (long) getGeneralProperty: (int) property ref: (const void*) ref;
|
- (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 value: (NSColor *) value;
|
||||||
- (void) setColorProperty: (int) property parameter: (long) parameter fromHTML: (NSString*) fromHTML;
|
- (void) setColorProperty: (int) property parameter: (long) parameter fromHTML: (NSString *) fromHTML;
|
||||||
- (NSColor*) getColorProperty: (int) property parameter: (long) parameter;
|
- (NSColor *) getColorProperty: (int) property parameter: (long) parameter;
|
||||||
- (void) setReferenceProperty: (int) property parameter: (long) parameter value: (const void*) value;
|
- (void) setReferenceProperty: (int) property parameter: (long) parameter value: (const void *) value;
|
||||||
- (const void*) getReferenceProperty: (int) property parameter: (long) parameter;
|
- (const void *) getReferenceProperty: (int) property parameter: (long) parameter;
|
||||||
- (void) setStringProperty: (int) property parameter: (long) parameter value: (NSString*) value;
|
- (void) setStringProperty: (int) property parameter: (long) parameter value: (NSString *) value;
|
||||||
- (NSString*) getStringProperty: (int) property parameter: (long) parameter;
|
- (NSString *) getStringProperty: (int) property parameter: (long) parameter;
|
||||||
- (void) setLexerProperty: (NSString*) name value: (NSString*) value;
|
- (void) setLexerProperty: (NSString *) name value: (NSString *) value;
|
||||||
- (NSString*) getLexerProperty: (NSString*) name;
|
- (NSString *) getLexerProperty: (NSString *) name;
|
||||||
|
|
||||||
// The delegate property should be used instead of registerNotifyCallback which is deprecated.
|
// The delegate property should be used instead of registerNotifyCallback which is deprecated.
|
||||||
- (void) registerNotifyCallback: (intptr_t) windowid value: (Scintilla::SciNotifyFunc) callback __attribute__((deprecated));
|
- (void) registerNotifyCallback: (intptr_t) windowid value: (SciNotifyFunc) callback __attribute__ ( (deprecated)) ;
|
||||||
|
|
||||||
- (void) setInfoBar: (NSView <InfoBarCommunicator>*) aView top: (BOOL) top;
|
- (void) setInfoBar: (NSView <InfoBarCommunicator> *) aView top: (BOOL) top;
|
||||||
- (void) setStatusText: (NSString*) text;
|
- (void) setStatusText: (NSString *) text;
|
||||||
|
|
||||||
- (BOOL) findAndHighlightText: (NSString*) searchText
|
- (BOOL) findAndHighlightText: (NSString *) searchText
|
||||||
matchCase: (BOOL) matchCase
|
matchCase: (BOOL) matchCase
|
||||||
wholeWord: (BOOL) wholeWord
|
wholeWord: (BOOL) wholeWord
|
||||||
scrollTo: (BOOL) scrollTo
|
scrollTo: (BOOL) scrollTo
|
||||||
wrap: (BOOL) wrap;
|
wrap: (BOOL) wrap;
|
||||||
|
|
||||||
- (BOOL) findAndHighlightText: (NSString*) searchText
|
- (BOOL) findAndHighlightText: (NSString *) searchText
|
||||||
matchCase: (BOOL) matchCase
|
matchCase: (BOOL) matchCase
|
||||||
wholeWord: (BOOL) wholeWord
|
wholeWord: (BOOL) wholeWord
|
||||||
scrollTo: (BOOL) scrollTo
|
scrollTo: (BOOL) scrollTo
|
||||||
wrap: (BOOL) wrap
|
wrap: (BOOL) wrap
|
||||||
backwards: (BOOL) backwards;
|
backwards: (BOOL) backwards;
|
||||||
|
|
||||||
- (int) findAndReplaceText: (NSString*) searchText
|
- (int) findAndReplaceText: (NSString *) searchText
|
||||||
byText: (NSString*) newText
|
byText: (NSString *) newText
|
||||||
matchCase: (BOOL) matchCase
|
matchCase: (BOOL) matchCase
|
||||||
wholeWord: (BOOL) wholeWord
|
wholeWord: (BOOL) wholeWord
|
||||||
doAll: (BOOL) doAll;
|
doAll: (BOOL) doAll;
|
||||||
|
@ -14,7 +14,7 @@ make test
|
|||||||
cd ../../..
|
cd ../../..
|
||||||
|
|
||||||
# ************************************************************
|
# ************************************************************
|
||||||
# Target 2: build framework and test app with Xcode targetting OS X 10.n with n from 9 to 5
|
# 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
|
# Only SDK versions that are installed will be built
|
||||||
# Clean both then build both -- if perform clean in ScintillaTest, also cleans ScintillaFramework
|
# Clean both then build both -- if perform clean in ScintillaTest, also cleans ScintillaFramework
|
||||||
# which can cause double build
|
# which can cause double build
|
||||||
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 1.3 KiB |
@ -1 +1 @@
|
|||||||
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:
|
@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:
|
||||||
|
@ -1 +0,0 @@
|
|||||||
del /S /Q .cvsignore
|
|
@ -6,6 +6,7 @@
|
|||||||
<meta name="generator" content="HTML Tidy, see www.w3.org" />
|
<meta name="generator" content="HTML Tidy, see www.w3.org" />
|
||||||
<meta name="generator" content="SciTE" />
|
<meta name="generator" content="SciTE" />
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title>
|
<title>
|
||||||
Scintilla and SciTE
|
Scintilla and SciTE
|
||||||
</title>
|
</title>
|
||||||
@ -48,14 +49,14 @@
|
|||||||
library and with limited use of templates.
|
library and with limited use of templates.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
The currently supported platforms, Windows, GTK+/Linux and wxWindows are fairly similar in
|
The currently supported platforms, Windows, GTK+/Linux, Cocoa and wxWidgets are fairly similar in
|
||||||
many ways.
|
many ways.
|
||||||
Each has windows, menus and bitmaps. These features generally work in similar ways so each
|
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
|
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
|
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
|
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.
|
call that will be asynchronously answered with a message containing the clipboard data.
|
||||||
The wxWindows platform is available from the <a href="http://wxwindows.org/">wxWindows site</a>
|
The wxWidgets platform is available from the <a href="http://wxwidgets.org/">wxWidgets site</a>
|
||||||
</p>
|
</p>
|
||||||
<br />
|
<br />
|
||||||
<h3>
|
<h3>
|
||||||
@ -86,25 +87,21 @@
|
|||||||
the name of a macro on Windows.
|
the name of a macro on Windows.
|
||||||
</p>
|
</p>
|
||||||
<h4>
|
<h4>
|
||||||
Colour, ColourPair, Palette
|
ColourDesired
|
||||||
</h4>
|
</h4>
|
||||||
<p>
|
<p>
|
||||||
Colour holds a platform specific colour identifier - COLORREF for Windows and GdkColor for
|
This is a simple class holding an expected colour. It is internally represented as a single
|
||||||
GTK+. The red, green and blue components that make up the colour are limited to the 8 bits of
|
32 bit integer in BGR format with 8 bits per colour, but also provides a convenient API to fetch
|
||||||
precision available on Windows. ColourPairs are used because not all possible colours are
|
each component separately.
|
||||||
always available. Using an 8 bit colour mode, which is a common setting for both Windows and
|
As a platform might not be able to represent the exact desired colour if it doesn't have 24 bit
|
||||||
GTK+, only 256 colours are possible on the display. Thus when an application asks for a dull
|
depth available, it might not actually represent the exact desired colour but select a best fit
|
||||||
red, say #400000, it may only be allocated an already available colour such as #800000 or
|
that it can actually render.
|
||||||
#330000. With 16 or 2 colour modes even less choice is available and the application will
|
|
||||||
have to use the limited set of already available colours.
|
|
||||||
</p>
|
</p>
|
||||||
A Palette object holds a set of colour pairs and can make the appropriate calls to ask to
|
|
||||||
allocate these colours and to see what the platform has decided will be allowed.
|
|
||||||
<h4>
|
<h4>
|
||||||
Font
|
Font
|
||||||
</h4>
|
</h4>
|
||||||
<p>
|
<p>
|
||||||
Font holds a platform specific font identifier - HFONT for Windows, GdkFont* for GTK+. It
|
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
|
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.
|
destructor. Client code should call Destroy at appropriate times.
|
||||||
</p>
|
</p>
|
||||||
@ -115,8 +112,8 @@
|
|||||||
Surface is an abstraction over each platform's concept of somewhere that graphical drawing
|
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
|
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
|
used to create a bitmap that can be drawn into and later copied onto another surface. On
|
||||||
Windows it wraps a HDC and possibly a HBITMAP. On GTK+ it wraps a GdkDrawable* and possibly a
|
Windows it wraps a HDC and possibly a HBITMAP. On GTK+ it wraps a cairo_surface_t*.
|
||||||
GdkPixmap*. Other platform specific objects are created (and correctly destroyed) whenever
|
Other platform specific objects are created (and correctly destroyed) whenever
|
||||||
required to perform drawing actions.
|
required to perform drawing actions.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
@ -146,7 +143,7 @@
|
|||||||
</h4>
|
</h4>
|
||||||
<p>
|
<p>
|
||||||
Menu is a small helper class for constructing popup menus. It contains the platform specific
|
Menu is a small helper class for constructing popup menus. It contains the platform specific
|
||||||
menu identifier - HMENU for Windows, GtkItemFactory* for GTK+. Most of the work in
|
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
|
constructing menus requires access to platform events and so is done in the Platform Events
|
||||||
and API layer.
|
and API layer.
|
||||||
</p>
|
</p>
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<meta name="generator" content="HTML Tidy, see www.w3.org" />
|
<meta name="generator" content="HTML Tidy, see www.w3.org" />
|
||||||
<meta name="generator" content="SciTE" />
|
<meta name="generator" content="SciTE" />
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title>
|
<title>
|
||||||
Scintilla icons
|
Scintilla icons
|
||||||
</title>
|
</title>
|
||||||
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 8.2 KiB |
70
scintilla/doc/Privacy.html
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta name="generator" content="SciTE" />
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<title>
|
||||||
|
Privacy Policy
|
||||||
|
</title>
|
||||||
|
</head>
|
||||||
|
<body bgcolor="#FFFFFF" text="#000000">
|
||||||
|
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="index.html" style="color:white;text-decoration:none"><font size="5">Scintilla
|
||||||
|
and SciTE</font></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<h2>
|
||||||
|
Privacy Policy for scintilla.org
|
||||||
|
</h2>
|
||||||
|
<h3>
|
||||||
|
Information Collected
|
||||||
|
</h3>
|
||||||
|
<p>
|
||||||
|
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.
|
||||||
|
</p>
|
||||||
|
<h3>
|
||||||
|
External Links
|
||||||
|
</h3>
|
||||||
|
<p>
|
||||||
|
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.
|
||||||
|
</p>
|
||||||
|
<h3>
|
||||||
|
Cookies
|
||||||
|
</h3>
|
||||||
|
<p>
|
||||||
|
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.
|
||||||
|
</p>
|
||||||
|
<h3>
|
||||||
|
Contact
|
||||||
|
</h3>
|
||||||
|
<p>
|
||||||
|
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.
|
||||||
|
</p>
|
||||||
|
<h3>
|
||||||
|
Changes to this Policy
|
||||||
|
</h3>
|
||||||
|
<p>
|
||||||
|
This policy may change. If it does then this page will be updated and the date at the bottom will change.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
This policy was last updated 2 June 2015.
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -5,6 +5,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="SciTE" />
|
<meta name="generator" content="SciTE" />
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title>
|
<title>
|
||||||
Scintilla and SciTE Code Style Preferences
|
Scintilla and SciTE Code Style Preferences
|
||||||
</title>
|
</title>
|
||||||
@ -123,6 +124,8 @@
|
|||||||
compilers on diverse platforms with high performance and low resource usage.
|
compilers on diverse platforms with high performance and low resource usage.
|
||||||
Scintilla has stricter portability requirements to SciTE as it may be ported to
|
Scintilla has stricter portability requirements to SciTE as it may be ported to
|
||||||
low capability platforms.
|
low capability platforms.
|
||||||
|
Scintilla code must build with C++17 which can be checked with "g++ --std=c++17".
|
||||||
|
SciTE can use C++17 features that are widely available from g++ 7.1, MSVC 2017.6 and Clang 5.0 compilers.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
To achieve portability, only a subset of C++ features are used.
|
To achieve portability, only a subset of C++ features are used.
|
||||||
@ -130,22 +133,28 @@
|
|||||||
C++, exceptions may not be thrown out of Scintilla and all exceptions should be caught
|
C++, exceptions may not be thrown out of Scintilla and all exceptions should be caught
|
||||||
before returning from Scintilla.
|
before returning from Scintilla.
|
||||||
Run-time type information adds to memory use so is turned off.
|
Run-time type information adds to memory use so is turned off.
|
||||||
A 'Scintilla' name spaces is optionally used based on the SCI_NAMESPACE
|
A 'Scintilla' name space is used. This helps with name clashes on OS X.
|
||||||
definition. This helps with name clashes on OS X.
|
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
The goto statement is not used because of bad memories from my first job
|
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
|
maintaining FORTRAN programs. The union feature is not used as it can lead to
|
||||||
non-type-safe value access.
|
non-type-safe value access.
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
The SCI_METHOD preprocessor definition should be used when implementing
|
||||||
|
interfaces which include it like ILexer and only there.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Headers should always be included in the same order as given by the
|
||||||
|
scripts/HeaderOrder.txt file.
|
||||||
|
</p>
|
||||||
<h3>
|
<h3>
|
||||||
Casting
|
Casting
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
Do not use old C style casts like (char *)s. Instead use the most strict form of C++
|
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
|
cast possible like const_cast<char *>(s). Use static_cast and const_cast
|
||||||
where possible rather than reinterpret_cast. Because the code is compiled with
|
where possible rather than reinterpret_cast.
|
||||||
run-time type information turned off, dynamic_cast will not work.
|
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
The benefit to using the new style casts is that they explicitly detail what evil is
|
The benefit to using the new style casts is that they explicitly detail what evil is
|
||||||
@ -255,5 +264,31 @@
|
|||||||
<p>Ensure there are no warnings under the compiler you use. Warnings from other compilers
|
<p>Ensure there are no warnings under the compiler you use. Warnings from other compilers
|
||||||
will be noted on the feature request.</p>
|
will be noted on the feature request.</p>
|
||||||
<p>sc.ch is an int: do not pass this around as a char.</p>
|
<p>sc.ch is an int: do not pass this around as a char.</p>
|
||||||
|
<p>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*.</p>
|
||||||
|
<p>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.</p>
|
||||||
|
<p>If you copy from an existing lexer, remove any code that is not needed since it makes it
|
||||||
|
more difficult to maintain and review.</p>
|
||||||
|
<p>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.</p>
|
||||||
|
<h4>
|
||||||
|
Properties
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
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".
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
The properties "fold" and "fold.comment" are generic and can be used by
|
||||||
|
any lexer.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
See LexPython for examples of properties in an object lexer and LexHTML for a functional lexer.
|
||||||
|
</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 9.5 KiB |
@ -6,6 +6,7 @@
|
|||||||
<meta name="generator" content="HTML Tidy, see www.w3.org" />
|
<meta name="generator" content="HTML Tidy, see www.w3.org" />
|
||||||
<meta name="generator" content="SciTE" />
|
<meta name="generator" content="SciTE" />
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title>
|
<title>
|
||||||
Download Scintilla
|
Download Scintilla
|
||||||
</title>
|
</title>
|
||||||
@ -25,9 +26,9 @@
|
|||||||
<table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
|
<table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<font size="4"> <a href="http://prdownloads.sourceforge.net/scintilla/scintilla356.zip?download">
|
<font size="4"> <a href="https://www.scintilla.org/scintilla414.zip">
|
||||||
Windows</a>
|
Windows</a>
|
||||||
<a href="http://prdownloads.sourceforge.net/scintilla/scintilla356.tgz?download">
|
<a href="https://www.scintilla.org/scintilla414.tgz">
|
||||||
GTK+/Linux</a>
|
GTK+/Linux</a>
|
||||||
</font>
|
</font>
|
||||||
</td>
|
</td>
|
||||||
@ -41,7 +42,7 @@
|
|||||||
containing very few restrictions.
|
containing very few restrictions.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<h3>
|
||||||
Release 3.5.6
|
Release 4.1.4
|
||||||
</h3>
|
</h3>
|
||||||
<h4>
|
<h4>
|
||||||
Source Code
|
Source Code
|
||||||
@ -49,8 +50,8 @@
|
|||||||
The source code package contains all of the source code for Scintilla but no binary
|
The source code package contains all of the source code for Scintilla but no binary
|
||||||
executable code and is available in
|
executable code and is available in
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla356.zip?download">zip format</a> (1450K) commonly used on Windows</li>
|
<li><a href="https://www.scintilla.org/scintilla414.zip">zip format</a> (1700K) commonly used on Windows</li>
|
||||||
<li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla356.tgz?download">tgz format</a> (1300K) commonly used on Linux and compatible operating systems</li>
|
<li><a href="https://www.scintilla.org/scintilla414.tgz">tgz format</a> (1500K) commonly used on Linux and compatible operating systems</li>
|
||||||
</ul>
|
</ul>
|
||||||
Instructions for building on both Windows and Linux are included in the readme file.
|
Instructions for building on both Windows and Linux are included in the readme file.
|
||||||
<h4>
|
<h4>
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<meta name="generator" content="HTML Tidy, see www.w3.org" />
|
<meta name="generator" content="HTML Tidy, see www.w3.org" />
|
||||||
<meta name="generator" content="SciTE" />
|
<meta name="generator" content="SciTE" />
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title>
|
<title>
|
||||||
Scintilla and SciTE Related Sites
|
Scintilla and SciTE Related Sites
|
||||||
</title>
|
</title>
|
||||||
@ -37,7 +38,7 @@
|
|||||||
is a port to MorphOS.
|
is a port to MorphOS.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="https://metacpan.org/module/Wx::Scintilla">Wx::Scintilla</a>
|
<a href="https://metacpan.org/pod/Wx::Scintilla">Wx::Scintilla</a>
|
||||||
is a Perl Binding for Scintilla on wxWidgets.
|
is a Perl Binding for Scintilla on wxWidgets.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
@ -49,7 +50,7 @@
|
|||||||
these programs, using all the typical GObject conventions.
|
these programs, using all the typical GObject conventions.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://mewsoft.com/cgi-bin/forum/forum.cgi?action=ViewTopic&Topic=1494&Forum=1&Page=1&Period=0a&Lang=English">Editawy</a>
|
<a href="http://www.mewsoft.com/forums/source-code-editor-activex-control-released-scintilla-activex-wrapper-control&action=ViewTopic&Topic=1494&Forum=1&Page=1&Period=0a&Lang=English">Editawy</a>
|
||||||
is an ActiveX Control wrapper that support all Scintilla functions and additional high level functions.
|
is an ActiveX Control wrapper that support all Scintilla functions and additional high level functions.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
@ -75,7 +76,7 @@
|
|||||||
</a> is an encapsulation of Scintilla for use within the .NET framework.
|
</a> is an encapsulation of Scintilla for use within the .NET framework.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.riverbankcomputing.co.uk/software/qscintilla/intro">QScintilla
|
<a href="https://riverbankcomputing.com/software/qscintilla/intro">QScintilla
|
||||||
</a> is a port of Scintilla to the Qt platform. It has a similar license to Qt: GPL for use in
|
</a> 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.
|
free software and commercial for use in close-source applications.
|
||||||
</p>
|
</p>
|
||||||
@ -127,7 +128,24 @@
|
|||||||
Projects using Scintilla
|
Projects using Scintilla
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://rhaberkorn.github.com/sciteco/">SciTECO</a>
|
<a href="https://github.com/martinrotter/textilosaurus">Textilosaurus</a>
|
||||||
|
is simple cross-platform UTF-8 text editor based on Qt and Scintilla.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<a href="http://stefanstools.sourceforge.net/BowPad.html">BowPad</a>
|
||||||
|
is a small and fast text editor with a modern ribbon user interface (Windows7 or later).
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<a href="http://studio.zerobrane.com">ZeroBrane Studio Lua IDE</a>
|
||||||
|
is a lightweight Lua IDE with code completion, syntax highlighting, live
|
||||||
|
coding, remote debugger, and code analyzer (Windows, OSX, and Linux).
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<a href="http://www.xml-buddy.com/">XML Validator Buddy</a>
|
||||||
|
is an XML/JSON editor and XML validator for Windows.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<a href="http://sciteco.sf.net/">SciTECO</a>
|
||||||
is an advanced TECO dialect and interactive screen editor based on Scintilla.
|
is an advanced TECO dialect and interactive screen editor based on Scintilla.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
@ -153,7 +171,7 @@
|
|||||||
is a cross-platform, visual database design, sql coding and administration tool.
|
is a cross-platform, visual database design, sql coding and administration tool.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://liveditor.com/index.html">LIVEditor</a>
|
<a href="http://liveditor.com/index.php">LIVEditor</a>
|
||||||
is for web front end coders editing html/css/js code.
|
is for web front end coders editing html/css/js code.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
@ -161,8 +179,8 @@
|
|||||||
is a wxWidgets-based Perl IDE.
|
is a wxWidgets-based Perl IDE.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://manoscoder.gr/CoderStudio/CoderStudio.asp">CoderStudio</a>
|
<a href="http://www.manoscoder.gr/wintools/viewtopic.php?f=20&t=84">CoderStudio</a>
|
||||||
is an IDE for Assembly programming similar to Visual Studio 6.0.
|
is an IDE for plain C and Assembly programming similar to Visual Studio.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.sparxsystems.com/products/ea/index.html">Enterprise Architect</a>
|
<a href="http://www.sparxsystems.com/products/ea/index.html">Enterprise Architect</a>
|
||||||
@ -170,14 +188,14 @@
|
|||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="https://launchpad.net/codeassistor">The CodeAssistor Editor</a>
|
<a href="https://launchpad.net/codeassistor">The CodeAssistor Editor</a>
|
||||||
is a small and simple MacOSX source code editor.
|
is a small and simple source code editor for MacOSX, Windows, and GTK/Linux.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.topwizprogramming.com/freecode_pbeditor.html">PBEditor</a>
|
<a href="http://www.topwizprogramming.com/freecode_pbeditor.html">PBEditor</a>
|
||||||
is a text editor for PowerBuilder.
|
is a text editor for PowerBuilder.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.cryptool.org/">CrypTool</a>
|
<a href="https://www.cryptool.org/en/">CrypTool</a>
|
||||||
is an application for applying and analyzing cryptographic algorithms.
|
is an application for applying and analyzing cryptographic algorithms.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
@ -190,34 +208,22 @@
|
|||||||
is a simple programming language with a Visual Basic like syntax.
|
is a simple programming language with a Visual Basic like syntax.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.daansystems.com/lispide">LispIDE</a>
|
<a href="http://www.daansystems.com/lispide/">LispIDE</a>
|
||||||
is a basic Lisp editor for Windows 2000, XP and Vista.
|
is a basic Lisp editor for Windows 2000, XP and Vista.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.flexsoft.cc/download.htm">FlexEdit</a>
|
<a href="https://www.assembla.com/wiki/show/FileWorkbench">File Workbench:</a>
|
||||||
is Free Text/Hex Editor for Windows.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<a href="http://www.assembla.com/wiki/show/FileWorkbench">File Workbench:</a>
|
|
||||||
a file manager / text editor environment with Squirrel scripting.
|
a file manager / text editor environment with Squirrel scripting.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://kephra.sf.net">Kephra</a>
|
<a href="http://kephra.sf.net">Kephra</a>
|
||||||
is a free, easy and comfortable cross-platform editor written in Perl.
|
is a free, easy and comfortable cross-platform editor written in Perl.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
|
||||||
<a href="http://top.gresham-computing.com">TOP</a>
|
|
||||||
is an interface to HP's NonStop servers which run a proprietary OS.
|
|
||||||
</p>
|
|
||||||
<p>
|
<p>
|
||||||
<a href="http://universalindent.sourceforge.net/">UniversalIndentGUI</a>
|
<a href="http://universalindent.sourceforge.net/">UniversalIndentGUI</a>
|
||||||
is a cross platform GUI for several code formatters, beautifiers and indenters
|
is a cross platform GUI for several code formatters, beautifiers and indenters
|
||||||
like GreatCode, AStyle (Artistic Styler), GNU Indent, BCPP and so on.
|
like GreatCode, AStyle (Artistic Styler), GNU Indent, BCPP and so on.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
|
||||||
<a href="http://scitools.com/products/trackback/product.php">TrackBack</a>
|
|
||||||
watches and backs up every change made in your source code.
|
|
||||||
</p>
|
|
||||||
<p>
|
<p>
|
||||||
<a href="http://elementaryreports.com/">Elementary Reports</a>
|
<a href="http://elementaryreports.com/">Elementary Reports</a>
|
||||||
is designed to reduce the time to compose detailed and professional primary school reports.
|
is designed to reduce the time to compose detailed and professional primary school reports.
|
||||||
@ -233,12 +239,12 @@
|
|||||||
class diagrams.
|
class diagrams.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
The <a href="http://www.adobe.com/devnet/bridge/">ExtendScript Toolkit</a>
|
The <a href="http://www.adobe.com/devnet/bridge.html">ExtendScript Toolkit</a>
|
||||||
is a development and debugging tool for JavaScript
|
is a development and debugging tool for JavaScript
|
||||||
scripts included with Adobe CS3 Suites.
|
scripts included with Adobe CS3 Suites.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://tortoisesvn.net/">TortoiseSVN</a>
|
<a href="https://tortoisesvn.net/">TortoiseSVN</a>
|
||||||
is a Windows GUI client for the Subversion source control software.
|
is a Windows GUI client for the Subversion source control software.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
@ -263,7 +269,7 @@
|
|||||||
is a graphical user interface for changing SciTE properties files.
|
is a graphical user interface for changing SciTE properties files.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.totalcmd.net/plugring/SciLister.html">Scintilla Lister</a>
|
<a href="http://totalcmd.net/plugring/SciLister.html">Scintilla Lister</a>
|
||||||
is a plugin for Total Commander allowing viewing all documents with syntax highlighting
|
is a plugin for Total Commander allowing viewing all documents with syntax highlighting
|
||||||
inside Total Commander.
|
inside Total Commander.
|
||||||
</p>
|
</p>
|
||||||
@ -279,7 +285,7 @@
|
|||||||
Code::Blocks</a> is an open source, cross platform free C++ IDE.
|
Code::Blocks</a> is an open source, cross platform free C++ IDE.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://notepad-plus.sourceforge.net/uk/site.htm">
|
<a href="https://notepad-plus-plus.org/">
|
||||||
Notepad++</a> is a free source code editor under Windows.
|
Notepad++</a> is a free source code editor under Windows.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
@ -291,7 +297,7 @@
|
|||||||
LSW DotNet-Lab</a> is a development environment for the .NET platform.
|
LSW DotNet-Lab</a> is a development environment for the .NET platform.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://glintercept.nutty.org/">
|
<a href="https://github.com/dtrebilco/glintercept">
|
||||||
GLIntercept</a> is an OpenGL function call interceptor that uses SciTE as a
|
GLIntercept</a> is an OpenGL function call interceptor that uses SciTE as a
|
||||||
run-time shader editor.
|
run-time shader editor.
|
||||||
</p>
|
</p>
|
||||||
@ -308,7 +314,7 @@
|
|||||||
PyCrash Viewer</a> can examine crash dumps of Python programs.
|
PyCrash Viewer</a> can examine crash dumps of Python programs.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.cabletest.com/mpt-wa-software-discovery.shtml">
|
<a href="http://www.cabletest.com/en/featured_products_MPT2.aspx">
|
||||||
MPT series Wire Analyzers</a> use Scintilla and SciTE.
|
MPT series Wire Analyzers</a> use Scintilla and SciTE.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
@ -330,18 +336,14 @@
|
|||||||
is a user-friendly source code editor easily extended using Python.
|
is a user-friendly source code editor easily extended using Python.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.spaceblue.com/venis/">
|
<a href="http://www.spaceblue.com/products/venis/index.html">
|
||||||
Venis IX</a>,
|
Venis IX</a>,
|
||||||
the Visual Environment for NSIS (Nullsoft Scriptable Install System).
|
the Visual Environment for NSIS (Nullsoft Scriptable Install System).
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.die-offenbachs.de/detlev/eric.html">Eric3</a>
|
<a href="http://eric-ide.python-projects.org/">Eric3</a>
|
||||||
is a Python IDE written using PyQt and QScintilla.
|
is a Python IDE written using PyQt and QScintilla.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
|
||||||
<a href="http://www.bomberstudios.com/sciteflash/">SciTE|Flash</a>
|
|
||||||
is a free Scintilla-based ActionScript editor for Windows.
|
|
||||||
</p>
|
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.computersciencelab.com/CppIde.htm">CPPIDE</a>
|
<a href="http://www.computersciencelab.com/CppIde.htm">CPPIDE</a>
|
||||||
is part of some commercial high-school oriented programming course software.
|
is part of some commercial high-school oriented programming course software.
|
||||||
@ -358,26 +360,18 @@
|
|||||||
<a href="http://wxbasic.sourceforge.net/">wxBasic</a> is an open source
|
<a href="http://wxbasic.sourceforge.net/">wxBasic</a> is an open source
|
||||||
Basic interpreter that uses the wxWidgets toolkit. A small IDE is under construction.
|
Basic interpreter that uses the wxWidgets toolkit. A small IDE is under construction.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
|
||||||
<a href="http://freeride.rubyforge.org/wiki/wiki.pl">FreeRIDE</a> will be a
|
|
||||||
cross-platform IDE for the Ruby programming language.
|
|
||||||
</p>
|
|
||||||
<p>
|
<p>
|
||||||
<a href="http://visual-mingw.sourceforge.net/">Visual MinGW</a> is an
|
<a href="http://visual-mingw.sourceforge.net/">Visual MinGW</a> is an
|
||||||
IDE for the MinGW compiler system.This runs on Windows with gcc.
|
IDE for the MinGW compiler system.This runs on Windows with gcc.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
The <a href="http://archaeopteryx.com/wingide">Wing IDE</a> is a
|
The <a href="http://archaeopteryx.com/">Wing IDE</a> is a
|
||||||
complete integrated development environment for the Python programming
|
complete integrated development environment for the Python programming
|
||||||
language.
|
language.
|
||||||
Available on Intel based Linux and Windows and on MacOS X through XDarwin.
|
Available on Intel based Linux and Windows and on MacOS X through XDarwin.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.gorlice.net.pl/~rybak/luaide/">LuaIDE</a>
|
<a href="http://www.spheredev.org/">Sphere</a>
|
||||||
is an IDE for Lua on Windows.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<a href="http://www.aegisknight.org/sphere/">Sphere</a>
|
|
||||||
is 2D RPG engine with a development environment.
|
is 2D RPG engine with a development environment.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
@ -398,20 +392,10 @@
|
|||||||
is a Python debugger that can run on one Windows machine debugging a Python program running
|
is a Python debugger that can run on one Windows machine debugging a Python program running
|
||||||
on either the same or another machine.
|
on either the same or another machine.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
|
||||||
<a href="http://www.rexx.com/~dkuhlman/">pyeditor and wxEditor</a>
|
|
||||||
are scriptable editors implemented in Python. pyeditor is based on GTK+ and
|
|
||||||
the pyscintilla wrapper. wxEditor is based on wxWidgets, wxPython and
|
|
||||||
wxStyledTextControl.
|
|
||||||
</p>
|
|
||||||
<p>
|
<p>
|
||||||
<a href="http://sourceforge.net/projects/pycrust/">PyCrust</a> is an interactive
|
<a href="http://sourceforge.net/projects/pycrust/">PyCrust</a> is an interactive
|
||||||
Python shell based on wxPython.
|
Python shell based on wxPython.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
|
||||||
<a href="http://www.thekompany.com/products/blackadder/">Black Adder</a> is a
|
|
||||||
Qt based development environment for Python and Ruby.
|
|
||||||
</p>
|
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.activestate.com/Products/Komodo/">Komodo</a>
|
<a href="http://www.activestate.com/Products/Komodo/">Komodo</a>
|
||||||
is a cross-platform multi-language development environment built
|
is a cross-platform multi-language development environment built
|
||||||
@ -424,16 +408,16 @@
|
|||||||
will be of interest to others wanting to control SciTE.
|
will be of interest to others wanting to control SciTE.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://anjuta.sourceforge.net/">Anjuta</a>
|
<a href="http://anjuta.org/">Anjuta</a>
|
||||||
is an open source C/C++ IDE for Linux/GNOME.
|
is an open source C/C++ IDE for Linux/GNOME.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
A <a href="http://www.burgaud.com">version of SciTE for Win32</a> enhanced
|
A <a href="https://www.burgaud.com">version of SciTE for Win32</a> enhanced
|
||||||
with a tab control to allow easy movement between buffers.
|
with a tab control to allow easy movement between buffers.
|
||||||
Go to the "Goodies" area on this site.
|
Go to the "Goodies" area on this site.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.suneido.com">
|
<a href="http://suneido.com">
|
||||||
Suneido</a> is an integrated application platform currently available for Win32 that includes an
|
Suneido</a> is an integrated application platform currently available for Win32 that includes an
|
||||||
object-oriented language, client-server database, and user interface and reporting frameworks.
|
object-oriented language, client-server database, and user interface and reporting frameworks.
|
||||||
</p>
|
</p>
|
||||||
@ -448,18 +432,22 @@
|
|||||||
wxStyledTextCtrl used as its editor.
|
wxStyledTextCtrl used as its editor.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.python.org/download/windows/">PythonWin</a>, a Win32 IDE for Python, uses
|
<a href="https://www.python.org/download/windows/">PythonWin</a>, a Win32 IDE for Python, uses
|
||||||
Scintilla for both its editing and interactive windows.
|
Scintilla for both its editing and interactive windows.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<h3>
|
||||||
Editing Components
|
Editing Components
|
||||||
</h3>
|
</h3>
|
||||||
|
<p>
|
||||||
|
<a href="https://codemirror.net/">CodeMirror</a>
|
||||||
|
is a versatile text editor implemented in JavaScript for the browser.
|
||||||
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.soft-gems.net/index.php/controls/unicodeeditor-formerly-unicode-syntax-editor">UniCodeEditor</a>
|
<a href="http://www.soft-gems.net/index.php/controls/unicodeeditor-formerly-unicode-syntax-editor">UniCodeEditor</a>
|
||||||
is a Unicode aware syntax editor control for Delphi and C++ Builder.
|
is a Unicode aware syntax editor control for Delphi and C++ Builder.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://projects.gnome.org/gtksourceview/">GtkSourceView</a>
|
<a href="https://wiki.gnome.org/Projects/GtkSourceView">GtkSourceView</a>
|
||||||
is a text widget that extends the standard GTK+ 2.x text widget and improves it
|
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.
|
by implementing syntax highlighting and other features typical of a source editor.
|
||||||
</p>
|
</p>
|
||||||
@ -468,7 +456,7 @@
|
|||||||
is a free source code editing component implemented in Ruby.
|
is a free source code editing component implemented in Ruby.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.actiprosoftware.com/Products/DotNet/SyntaxEditor/Default.aspx">SyntaxEditor</a>
|
<a href="http://www.actiprosoftware.com/products/controls/wpf/syntaxeditor">SyntaxEditor</a>
|
||||||
is a commercial native .Net source code editing component.
|
is a commercial native .Net source code editing component.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
@ -478,7 +466,7 @@
|
|||||||
<p>
|
<p>
|
||||||
<a href="http://www.gtk.org/">GTK+</a>, the GIMP Toolkit, contains a rich text editing
|
<a href="http://www.gtk.org/">GTK+</a>, the GIMP Toolkit, contains a rich text editing
|
||||||
widget.<br />
|
widget.<br />
|
||||||
<a href="http://gedit.sourceforge.net/">Gedit</a> is an editor for GTK+/GNOME.<br />
|
<a href="https://wiki.gnome.org/Apps/Gedit">Gedit</a> is an editor for GTK+/GNOME.<br />
|
||||||
<!--
|
<!--
|
||||||
<a href="http://www.daimi.au.dk/~mailund/gtk.html">GtkEditor</a> is a source code editing
|
<a href="http://www.daimi.au.dk/~mailund/gtk.html">GtkEditor</a> is a source code editing
|
||||||
widget based on the GTK+ text widget.<br />
|
widget based on the GTK+ text widget.<br />
|
||||||
@ -491,15 +479,12 @@
|
|||||||
<a href="http://www.codeguru.com/">CodeGuru</a> has source code for several Win32 MFC based
|
<a href="http://www.codeguru.com/">CodeGuru</a> has source code for several Win32 MFC based
|
||||||
editors.
|
editors.
|
||||||
</p>
|
</p>
|
||||||
<a href="http://synedit.sourceforge.net/">SynEdit</a> is a Win32 edit control written
|
<a href="http://sourceforge.net/projects/synedit/">SynEdit</a> is a Win32 edit control written
|
||||||
in Delphi.
|
in Delphi.
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.tetradyne.com/srcvwax.htm">SourceView</a> is a commercial editing
|
<a href="http://www.tetradyne.com/srcvwax.htm">SourceView</a> is a commercial editing
|
||||||
component for Win32.
|
component for Win32.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
|
||||||
<a href="http://www.winmain.com/">CodeMax</a> is another commercial component for Win32.
|
|
||||||
</p>
|
|
||||||
<h3>
|
<h3>
|
||||||
Documents
|
Documents
|
||||||
</h3>
|
</h3>
|
||||||
@ -535,9 +520,9 @@
|
|||||||
WinMerge over the files to work out how to merge.
|
WinMerge over the files to work out how to merge.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.python.org">Python</a> is my favourite programming language. Scintilla
|
<a href="https://www.python.org">Python</a> is my favourite programming language. Scintilla
|
||||||
was started after I tried to improve the editor built into <a
|
was started after I tried to improve the editor built into <a
|
||||||
href="http://www.python.org/download/windows/">PythonWin</a>, but was frustrated by the limitations of
|
href="https://www.python.org/download/windows/">PythonWin</a>, but was frustrated by the limitations of
|
||||||
the Windows Richedit control which PythonWin used.
|
the Windows Richedit control which PythonWin used.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
@ -545,7 +530,7 @@
|
|||||||
implementation of regular expression pattern matching used in Scintilla.
|
implementation of regular expression pattern matching used in Scintilla.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Inspirational coding soundscapes by <a href="http://www.davidbridie.com.au">David Bridie</a>.
|
Inspirational coding soundscapes by <a href="http://www.davidbridie.com/">David Bridie</a>.
|
||||||
</p>
|
</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<meta name="generator" content="HTML Tidy, see www.w3.org" />
|
<meta name="generator" content="HTML Tidy, see www.w3.org" />
|
||||||
<meta name="generator" content="SciTE" />
|
<meta name="generator" content="SciTE" />
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title>
|
<title>
|
||||||
Scintilla and SciTE To Do
|
Scintilla and SciTE To Do
|
||||||
</title>
|
</title>
|
||||||
@ -29,8 +30,8 @@
|
|||||||
Feedback
|
Feedback
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
Issues can be reported on the <a href="http://sourceforge.net/p/scintilla/bugs/">Bug Tracker</a>
|
Issues can be reported on the <a href="https://sourceforge.net/p/scintilla/bugs/">Bug Tracker</a>
|
||||||
and features requested on the <a href="http://sourceforge.net/p/scintilla/feature-requests/">Feature Request Tracker</a>.
|
and features requested on the <a href="https://sourceforge.net/p/scintilla/feature-requests/">Feature Request Tracker</a>.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<h3>
|
||||||
Scintilla Bugs
|
Scintilla Bugs
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<meta name="generator" content="HTML Tidy, see www.w3.org" />
|
<meta name="generator" content="HTML Tidy, see www.w3.org" />
|
||||||
<meta name="generator" content="SciTE" />
|
<meta name="generator" content="SciTE" />
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title>
|
<title>
|
||||||
Scintilla Usage Notes
|
Scintilla Usage Notes
|
||||||
</title>
|
</title>
|
||||||
|
204
scintilla/doc/StyleMetadata.html
Normal file
@ -0,0 +1,204 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta name="generator" content="HTML Tidy, see www.w3.org" />
|
||||||
|
<meta name="generator" content="SciTE" />
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<title>
|
||||||
|
Scintilla Style Metadata
|
||||||
|
</title>
|
||||||
|
<style type="text/css">
|
||||||
|
<!--
|
||||||
|
/*<![CDATA[*/
|
||||||
|
CODE { font-weight: bold; font-family: Menlo,Consolas,Bitstream Vera Sans Mono,Courier New,monospace; }
|
||||||
|
/*]]>*/
|
||||||
|
-->
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body bgcolor="#FFFFFF" text="#000000">
|
||||||
|
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="index.html" style="color:white;text-decoration:none"><font size="5">Scintilla</font></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<h2>
|
||||||
|
Language Types
|
||||||
|
</h2>
|
||||||
|
<p>
|
||||||
|
Scintilla contains lexers for various types of languages:
|
||||||
|
<ul>
|
||||||
|
<li>Programming languages like C++, Java, and Python.</li>
|
||||||
|
<li>Assembler languages are low-level programming languages which may additionally include instructions and registers.</li>
|
||||||
|
<li>Markup languages like HTML, TeX, and Markdown.</li>
|
||||||
|
<li>Data languages like EDIFACT and YAML.</li>
|
||||||
|
</ul>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Some languages can be used in different ways. JavaScript is a programming language but also
|
||||||
|
the basis of JSON data files. Similarly,
|
||||||
|
<a href="https://en.wikipedia.org/wiki/S-expression">Lisp s expressions</a> can be used for both source code and data.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Each language type has common elements such as identifiers in programming languages.
|
||||||
|
These common elements should be identified so that languages can be displayed with common
|
||||||
|
styles for these elements.
|
||||||
|
Style tags are used for this purpose in Scintilla.
|
||||||
|
</p>
|
||||||
|
<h2>
|
||||||
|
Style Tags
|
||||||
|
</h2>
|
||||||
|
<p>
|
||||||
|
Every style has a list of tags where a tag is a lower-case word containing only the common ASCII letters 'a'-'z'
|
||||||
|
such as "comment" or "operator".
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Tags are ordered from most important to least important.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
While applications may assign visual attributes for tag lists in many different ways, one reasonable technique is to
|
||||||
|
apply tag-specific attributes in reverse order so that earlier and more important tags override less important tags.
|
||||||
|
For example, the tag list <code>"error comment documentation keyword"</code> with
|
||||||
|
a set of tag attributes <br />
|
||||||
|
<code>{ comment=fore:green,back:very-light-green,font:Serif documentation=fore:light-green error=strikethrough keyword=bold }</code><br />
|
||||||
|
could be rendered as <br />
|
||||||
|
<code>bold,fore:light-green,back:very-light-green,font:Serif,strikethrough</code>.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Alternative renderings could check for multi-tag combinations like
|
||||||
|
<code>{ comment.documentation=fore:light-green comment.line=dark-green comment=green }.</code>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Commonly, a tag list will contain an optional embedded language; optional statuses; a base type; and a set of type modifiers:<br />
|
||||||
|
<code>embedded-language? status* base-type modifiers*</code>
|
||||||
|
</p>
|
||||||
|
<h3>Embedded language</h3>
|
||||||
|
<p>
|
||||||
|
The embedded language may be a source <code>(client | server)</code> followed by a language name
|
||||||
|
<code>(javascript | php | python | basic)</code>.
|
||||||
|
This may be extended in the future with other programming languages and style-definition languages like CSS.
|
||||||
|
</p>
|
||||||
|
<h3>Status</h3>
|
||||||
|
<p>
|
||||||
|
The statuses may be <code>(error | unused | predefined | inactive)</code>.<br />
|
||||||
|
The <code>error</code> status is used for lexical statuses that indicate errors in the source code such as unterminated quoted strings.<br />
|
||||||
|
The <code>unused</code> status may indicate a gap in the lexical states, possibly because an old lexical class is no longer used or an upcoming lexical class may fill that position.<br />
|
||||||
|
The <code>predefined</code> status indicates a style in the range 32.39 that is used for non-lexical purposes in Scintilla.<br />
|
||||||
|
The <code>inactive</code> status is used for text that is not currently interpreted such as C++ code that is contained within a '#if 0' preprocessor block.
|
||||||
|
</p>
|
||||||
|
<h3>Basic Types</h3>
|
||||||
|
<p>
|
||||||
|
The basic types for programming languages are <code>(default | operator | keyword | identifier | literal | comment | preprocessor | label)</code>.<br />
|
||||||
|
The <code>default</code> type is commonly used for spaces and tabs between tokens although it may cover other characters in some languages.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Assembler languages add <code>(instruction | register)</code>. to the basic types from programming languages.<br />
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
The basic types for markup languages are <code>(default | tag | attribute | comment | preprocessor)</code>.<br />
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
The basic types for data languages are <code>(default | key | data | comment)</code>.<br />
|
||||||
|
</p>
|
||||||
|
<h3>Comments</h3>
|
||||||
|
<p>
|
||||||
|
Programming languages may differentiate between line and stream comments and treat documentation comments as distinct from other comments.
|
||||||
|
Documentation comments may be marked up with documentation keywords.<br />
|
||||||
|
The additional attributes commonly used are <code>(line | documentation | keyword | taskmarker)</code>.
|
||||||
|
</p>
|
||||||
|
<h3>Literals</h3>
|
||||||
|
<p>
|
||||||
|
Programming and assembler languages contain a rich set of literals including numbers like <code>7</code> and <code>3.89e23</code>; <code>"string\n"</code>; and <code>nullptr</code>
|
||||||
|
and differentiating between these is often wanted.<br />
|
||||||
|
The common literal types are <code>(numeric | boolean | string | regex | date | time | uuid | nil | compound)</code>.<br />
|
||||||
|
Numeric literal types are subdivided into <code>(integer | real)</code>.<br />
|
||||||
|
String literal types may add (perhaps multiple) further attributes from <code> (heredoc | character | escapesequence | interpolated | multiline | raw)</code>.<br />
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
An escape sequence within an interpolated heredoc may thus be <code>literal string heredoc escapesequence</code>.
|
||||||
|
</p>
|
||||||
|
<h3>
|
||||||
|
List of known tags
|
||||||
|
</h3>
|
||||||
|
<table>
|
||||||
|
<tr><td><code>attribute</code></td><td>Markup attribute</td></tr>
|
||||||
|
<tr><td><code>basic</code></td><td>Embedded Basic</td></tr>
|
||||||
|
<tr><td><code>boolean</code></td><td>True or false literal</td></tr>
|
||||||
|
<tr><td><code>character</code></td><td>Single character literal as opposed to a string literal</td></tr>
|
||||||
|
<tr><td><code>client</code></td><td>Script executed on client</td></tr>
|
||||||
|
<tr><td><code>comment</code></td><td>The standard comment type in a language: may be stream or line</td></tr>
|
||||||
|
<tr><td><code>compound</code></td><td>Literal containing multiple subliterals such as a tuple or complex number</td></tr>
|
||||||
|
<tr><td><code>data</code></td><td>A value in a data file</td></tr>
|
||||||
|
<tr><td><code>date</code></td><td>Literal representing a data such as '19/November/1975'</td></tr>
|
||||||
|
<tr><td><code>default</code></td><td>Starting state commonly also used for white space</td></tr>
|
||||||
|
<tr><td><code>documentation</code></td><td>Comment that can be extracted into documentation</td></tr>
|
||||||
|
<tr><td><code>error</code></td><td>State indicating an invalid or erroneous element</td></tr>
|
||||||
|
<tr><td><code>escapesequence</code></td><td>Parts of a string that are not literal such as '\t' for tab in C</td></tr>
|
||||||
|
<tr><td><code>heredoc</code></td><td>Lengthy text literal marked by a word at both ends</td></tr>
|
||||||
|
<tr><td><code>identifier</code></td><td>Name that identifies an object or class of object</td></tr>
|
||||||
|
<tr><td><code>inactive</code></td><td>Code that is not currently interpreted</td></tr>
|
||||||
|
<tr><td><code>instruction</code></td><td>Mnemonic in assembler languages like 'addc'</td></tr>
|
||||||
|
<tr><td><code>integer</code></td><td>Numeric literal with no fraction or exponent like '738'</td></tr>
|
||||||
|
<tr><td><code>interpolated</code></td><td>String that can contain expressions</td></tr>
|
||||||
|
<tr><td><code>javascript</code></td><td>Embedded Javascript</td></tr>
|
||||||
|
<tr><td><code>key</code></td><td>Element which allows finding associated data</td></tr>
|
||||||
|
<tr><td><code>keyword</code></td><td>Reserved word with special meaning like 'while'</td></tr>
|
||||||
|
<tr><td><code>label</code></td><td>Destination for jumps in programming and assembler languages</td></tr>
|
||||||
|
<tr><td><code>line</code></td><td>Differentiates between stream comments and line comments in languages that have both</td></tr>
|
||||||
|
<tr><td><code>literal</code></td><td>Fixed value in source code</td></tr>
|
||||||
|
<tr><td><code>multiline</code></td><td>Differentiates between single line and multiline elements, commonly strings</td></tr>
|
||||||
|
<tr><td><code>nil</code></td><td>Literal for the null pointer such as nullptr in C++ or NULL in C</td></tr>
|
||||||
|
<tr><td><code>numeric</code></td><td>Literal number like '16'</td></tr>
|
||||||
|
<tr><td><code>operator</code></td><td>Punctuation character such as '&' or '['</td></tr>
|
||||||
|
<tr><td><code>php</code></td><td>Embedded PHP</td></tr>
|
||||||
|
<tr><td><code>predefined</code></td><td>Style in the range 32.39 that is used for non-lexical purposes</td></tr>
|
||||||
|
<tr><td><code>preprocessor</code></td><td>Element that is recognized in an early stage of translation</td></tr>
|
||||||
|
<tr><td><code>python</code></td><td>Embedded Python</td></tr>
|
||||||
|
<tr><td><code>raw</code></td><td>String type that avoids interpretation: may be used for regular expressions in languages without a specific regex type</td></tr>
|
||||||
|
<tr><td><code>real</code></td><td>Numeric literal which may have a fraction or exponent like '3.84e-15'</td></tr>
|
||||||
|
<tr><td><code>regex</code></td><td>Regular expression literal like '^[a-z]+'</td></tr>
|
||||||
|
<tr><td><code>register</code></td><td>CPU register in assembler languages</td></tr>
|
||||||
|
<tr><td><code>server</code></td><td>Script executed on server</td></tr>
|
||||||
|
<tr><td><code>string</code></td><td>Sequence of characters</td></tr>
|
||||||
|
<tr><td><code>tag</code></td><td>Markup tag like '<br />'</td></tr>
|
||||||
|
<tr><td><code>taskmarker</code></td><td>Word in comment that marks future work like 'FIXME'</td></tr>
|
||||||
|
<tr><td><code>time</code></td><td>Literal representing a time such as '9:34:31'</td></tr>
|
||||||
|
<tr><td><code>unused</code></td><td>Style that is not currently used</td></tr>
|
||||||
|
<tr><td><code>uuid</code></td><td>Universally unique identifier often used in interface definition files which may look like '{098f2470-bae0-11cd-b579-08002b30bfeb}'</td></tr>
|
||||||
|
</table>
|
||||||
|
<h2>
|
||||||
|
Extension
|
||||||
|
</h2>
|
||||||
|
<p>
|
||||||
|
Each element in this scheme may be extended in the future. This may be done by revising this document to provide a common approach to new features.
|
||||||
|
Individual lexers may also choose to expose unique language features through new tags.
|
||||||
|
</p>
|
||||||
|
<h2>
|
||||||
|
Translation
|
||||||
|
</h2>
|
||||||
|
<p>
|
||||||
|
Tags could be exposed directly in user interfaces or configuration languages.
|
||||||
|
However, an application may also translate these to match its naming schema.
|
||||||
|
Capitalization and punctuation could be different (like <code>Here-Doc</code> instead of <code>heredoc</code>),
|
||||||
|
terminology changed ("constant" instead of "literal"),
|
||||||
|
or human language changed from English to Chinese or Spanish.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Starting from a common set of tags makes these modifications tractable.
|
||||||
|
</p>
|
||||||
|
<h2>
|
||||||
|
Open issues
|
||||||
|
</h2>
|
||||||
|
<p>
|
||||||
|
The C++ lexer (for example) has inactive states and dynamically allocated substyles.
|
||||||
|
These should be exposed through the metadata mechanism but are not currently.
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 25 KiB |
@ -9,7 +9,8 @@
|
|||||||
<meta name="keywords" content="Scintilla, SciTE, Editing Component, Text Editor" />
|
<meta name="keywords" content="Scintilla, SciTE, Editing Component, Text Editor" />
|
||||||
<meta name="Description"
|
<meta name="Description"
|
||||||
content="www.scintilla.org is the home of the Scintilla editing component and SciTE text editor application." />
|
content="www.scintilla.org is the home of the Scintilla editing component and SciTE text editor application." />
|
||||||
<meta name="Date.Modified" content="20150526" />
|
<meta name="Date.Modified" content="20190307" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#versionlist {
|
#versionlist {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@ -37,7 +38,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function IsRemote() {
|
function IsRemote() {
|
||||||
var loc = '' + window.location;
|
var loc = '' + window.location;
|
||||||
return loc.indexOf('http:') != -1;
|
return (loc.indexOf('http:')) != -1 || (loc.indexOf('https:') != -1);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<title>
|
<title>
|
||||||
@ -55,8 +56,8 @@
|
|||||||
GTK+, and OS X</font>
|
GTK+, and OS X</font>
|
||||||
</td>
|
</td>
|
||||||
<td width="40%" align="right">
|
<td width="40%" align="right">
|
||||||
<font color="#FFCC99" size="3"> Release version 3.5.6<br />
|
<font color="#FFCC99" size="3"> Release version 4.1.4<br />
|
||||||
Site last modified May 26 2015</font>
|
Site last modified March 7 2019</font>
|
||||||
</td>
|
</td>
|
||||||
<td width="20%">
|
<td width="20%">
|
||||||
|
|
||||||
@ -65,40 +66,39 @@
|
|||||||
</table>
|
</table>
|
||||||
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
|
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td width="100%" style="background: url(http://www.scintilla.org/SciBreak.jpg) no-repeat;height:150px;">
|
<td width="100%" style="background: url(https://www.scintilla.org/SciBreak.jpg) no-repeat;height:150px;">
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<ul id="versionlist">
|
<ul id="versionlist">
|
||||||
<li>Version 3.5.6 fixes a bug with undo on Cocoa that could lose data.</li>
|
<li>Version 4.1.4 makes calltips work on Qt and adds a lexer for .NET's Common Intermediate Language CIL.</li>
|
||||||
<li>Version 3.5.5 improves IME on Qt and fixes minor bugs.</li>
|
<li>Version 4.1.3 is compatible with macOS 10.14, improves performance, and adds a new lexer for Nim which will replace the "nimrod" lexer.</li>
|
||||||
<li>Version 3.5.4 improves indicators to be able to change appearance on mouse-over and to use a wide variety of colours together.</li>
|
<li>Version 4.1.2 is a minor release.</li>
|
||||||
<li>Version 3.5.3 removes support for Windows 95, 98, and ME.</li>
|
<li>Version 4.1.1 adds optional indexing of line starts in UTF-8 documents by UTF-32 code points and UTF-16 code units.</li>
|
||||||
<li>Version 3.5.2 only supports 64-bit builds for OS X 10.7+ Cocoa. Provisional support of C++11 <regex>.</li>
|
<li>Version 4.1.0 adds experimental support for bidirectional text as used by Arabic and Hebrew on Win32 and Cocoa.</li>
|
||||||
<li>Version 3.5.1 fixes minor bugs and includes a lexer for BibTeX.</li>
|
|
||||||
<li>Version 3.5.0 can share space vertically so that extreme ascenders and descenders are not cut off.
|
|
||||||
Separate timers are used to minimize wake ups and thus power use.</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<ul id="menu">
|
<ul id="menu">
|
||||||
<li id="remote1"><a href="http://www.scintilla.org/SciTEImage.html">Screenshot</a></li>
|
<li id="remote1"><a href="https://www.scintilla.org/SciTEImage.html">Screenshot</a></li>
|
||||||
<li id="remote2"><a href="http://www.scintilla.org/ScintillaDownload.html">Download</a></li>
|
<li id="remote2"><a href="https://www.scintilla.org/ScintillaDownload.html">Download</a></li>
|
||||||
<li><a href="http://www.scintilla.org/ScintillaDoc.html">Documentation</a></li>
|
<li><a href="https://www.scintilla.org/ScintillaDoc.html">Documentation</a></li>
|
||||||
<li><a href="http://www.scintilla.org/ScintillaToDo.html">Bugs</a></li>
|
<li><a href="https://www.scintilla.org/ScintillaToDo.html">Bugs</a></li>
|
||||||
<li id="remote3"><a href="http://www.scintilla.org/SciTE.html">SciTE</a></li>
|
<li id="remote3"><a href="https://www.scintilla.org/SciTE.html">SciTE</a></li>
|
||||||
<li><a href="http://www.scintilla.org/ScintillaHistory.html">History</a></li>
|
<li><a href="https://www.scintilla.org/ScintillaHistory.html">History</a></li>
|
||||||
<li><a href="http://www.scintilla.org/ScintillaRelated.html">Related</a></li>
|
<li><a href="https://www.scintilla.org/ScintillaRelated.html">Related</a></li>
|
||||||
|
<li id="remote4"><a href="https://www.scintilla.org/Privacy.html">Privacy</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<script type="text/javascript" language="JavaScript"><!--
|
<script type="text/javascript" language="JavaScript"><!--
|
||||||
if (!IsRemote()) { //if NOT remote...
|
if (!IsRemote()) { //if NOT remote...
|
||||||
document.getElementById('remote1').style.display='none';
|
document.getElementById('remote1').style.display='none';
|
||||||
document.getElementById('remote2').style.display='none';
|
document.getElementById('remote2').style.display='none';
|
||||||
document.getElementById('remote3').style.display='none';
|
document.getElementById('remote3').style.display='none';
|
||||||
|
document.getElementById('remote4').style.display='none';
|
||||||
}
|
}
|
||||||
//--></script>
|
//--></script>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.scintilla.org/ScintillaDoc.html">Scintilla</a> is a free source code editing component.
|
<a href="https://www.scintilla.org/ScintillaDoc.html">Scintilla</a> is a free source code editing component.
|
||||||
It comes with complete source code and a <a href="http://www.scintilla.org/License.txt">license</a> that
|
It comes with complete source code and a <a href="https://www.scintilla.org/License.txt">license</a> that
|
||||||
permits use in any free project or commercial product.
|
permits use in any free project or commercial product.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
@ -111,7 +111,14 @@ if (!IsRemote()) { //if NOT remote...
|
|||||||
colours and multiple fonts.
|
colours and multiple fonts.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.scintilla.org/SciTE.html">SciTE</a> is a SCIntilla based Text Editor. Originally built to
|
Current development occurs on the default branch as 4.* which requires a recent
|
||||||
|
C++ compiler that supports C++17.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
For projects that need to work with older systems, a LongTerm3 branch is available which uses only features from C++11.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<a href="https://www.scintilla.org/SciTE.html">SciTE</a> is a SCIntilla based Text Editor. Originally built to
|
||||||
demonstrate Scintilla, it has grown to be a generally useful editor with facilities for
|
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
|
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.
|
for building test and demonstration programs as well as SciTE and Scintilla, themselves.
|
||||||
@ -126,32 +133,36 @@ if (!IsRemote()) { //if NOT remote...
|
|||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Scintilla and SciTE are currently available for Intel Win32, OS X, and Linux compatible operating
|
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
|
systems with GTK+. They have been run on Windows XP, Windows 7, OS X 10.7+, and on Ubuntu 14.04
|
||||||
with GTK+ 2.20. <a href="http://www.scintilla.org/SciTEImage.html">Here is a screenshot of
|
with GTK+ 2.24. <a href="https://www.scintilla.org/SciTEImage.html">Here is a screenshot of
|
||||||
SciTE.</a><br />
|
SciTE.</a><br />
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
You can <a href="http://www.scintilla.org/ScintillaDownload.html">download Scintilla.</a>
|
You can <a href="https://www.scintilla.org/ScintillaDownload.html">download Scintilla.</a>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
The source code can be downloaded via Mercurial at the Source Forge
|
The source code can be downloaded via Mercurial at the Source Forge
|
||||||
<a href="http://sourceforge.net/projects/scintilla/">Scintilla project page</a>.
|
<a href="https://sourceforge.net/projects/scintilla/">Scintilla project page</a>.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.scintilla.org/ScintillaRelated.html">Related sites.</a>
|
<a href="https://www.scintilla.org/ScintillaRelated.html">Related sites.</a>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.scintilla.org/ScintillaToDo.html">Bugs and To Do list.</a>
|
<a href="https://www.scintilla.org/ScintillaToDo.html">Bugs and To Do list.</a>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.scintilla.org/ScintillaHistory.html">History and contribution credits.</a>
|
<a href="https://www.scintilla.org/ScintillaHistory.html">History and contribution credits.</a>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://www.scintilla.org/Icons.html">Icons that can be used with Scintilla.</a>
|
<a href="https://www.scintilla.org/Icons.html">Icons that can be used with Scintilla.</a>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
The <a href="https://scintilla.sourceforge.io/LongTermDownload.html">LongTerm3</a>
|
||||||
|
branch of Scintilla avoids using features from C++14 or later in order to support older systems.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Questions and comments about Scintilla should be directed to the
|
Questions and comments about Scintilla should be directed to the
|
||||||
<a href="http://groups.google.com/group/scintilla-interest">scintilla-interest</a>
|
<a href="https://groups.google.com/forum/#!forum/scintilla-interest">scintilla-interest</a>
|
||||||
mailing list,
|
mailing list,
|
||||||
which is for discussion of Scintilla and related projects, their bugs and future features.
|
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.
|
This is a low traffic list, averaging less than 20 messages per week.
|
||||||
@ -163,21 +174,21 @@ if (!IsRemote()) { //if NOT remote...
|
|||||||
may receive no response.
|
may receive no response.
|
||||||
<br />
|
<br />
|
||||||
</p>
|
</p>
|
||||||
There is a <a href="http://sourceforge.net/projects/scintilla/">Scintilla project page</a>
|
There is a <a href="https://sourceforge.net/projects/scintilla/">Scintilla project page</a>
|
||||||
hosted on
|
hosted on
|
||||||
<script type="text/javascript" language="JavaScript">
|
<script type="text/javascript" language="JavaScript">
|
||||||
<!--
|
<!--
|
||||||
if (IsRemote()) {
|
if (IsRemote()) {
|
||||||
document.write('<a href="http://sourceforge.net/projects/scintilla/">');
|
document.write('<a href="https://sourceforge.net/projects/scintilla/">');
|
||||||
document.write('<img src="http://sflogo.sourceforge.net/sflogo.php?group_id=2439&type=8" width="80" height="15" alt="Get Scintilla at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a> ');
|
document.write('<img src="https://sflogo.sourceforge.net/sflogo.php?group_id=2439&type=8" width="80" height="15" alt="Get Scintilla at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a> ');
|
||||||
} else {
|
} else {
|
||||||
document.write('<a href="http://sourceforge.net/projects/scintilla/">SourceForge<\/a>');
|
document.write('<a href="https://sourceforge.net/projects/scintilla/">SourceForge<\/a>');
|
||||||
}
|
}
|
||||||
//-->
|
//-->
|
||||||
</script>
|
</script>
|
||||||
<noscript>
|
<noscript>
|
||||||
<a href="http://sourceforge.net/projects/scintilla">
|
<a href="https://sourceforge.net/projects/scintilla/">
|
||||||
<img src="http://sflogo.sourceforge.net/sflogo.php?group_id=2439&type=8" width="80" height="15" alt="Get Scintilla at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a>
|
<img src="https://sflogo.sourceforge.net/sflogo.php?group_id=2439&type=8" width="80" height="15" alt="Get Scintilla at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a>
|
||||||
</noscript>
|
</noscript>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 14 KiB |
@ -6,25 +6,15 @@
|
|||||||
#ifndef CONVERTER_H
|
#ifndef CONVERTER_H
|
||||||
#define CONVERTER_H
|
#define CONVERTER_H
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
namespace Scintilla {
|
namespace Scintilla {
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef GIConv ConverterHandle;
|
const GIConv iconvhBad = (GIConv)(-1);
|
||||||
const ConverterHandle iconvhBad = (ConverterHandle)(-1);
|
const gsize sizeFailure = static_cast<gsize>(-1);
|
||||||
// Since various versions of iconv can not agree on whether the src argument
|
|
||||||
// is char ** or const char ** provide a templatised adaptor.
|
|
||||||
template<typename T>
|
|
||||||
size_t iconv_adaptor(size_t(*f_iconv)(ConverterHandle, T, size_t *, char **, size_t *),
|
|
||||||
ConverterHandle cd, char** src, size_t *srcleft,
|
|
||||||
char **dst, size_t *dstleft) {
|
|
||||||
return f_iconv(cd, (T)src, srcleft, dst, dstleft);
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Encapsulate iconv safely and avoid iconv_adaptor complexity in client code.
|
* Encapsulate g_iconv safely.
|
||||||
*/
|
*/
|
||||||
class Converter {
|
class Converter {
|
||||||
ConverterHandle iconvh;
|
GIConv iconvh;
|
||||||
void OpenHandle(const char *fullDestination, const char *charSetSource) {
|
void OpenHandle(const char *fullDestination, const char *charSetSource) {
|
||||||
iconvh = g_iconv_open(fullDestination, charSetSource);
|
iconvh = g_iconv_open(fullDestination, charSetSource);
|
||||||
}
|
}
|
||||||
@ -45,15 +35,14 @@ public:
|
|||||||
operator bool() const {
|
operator bool() const {
|
||||||
return Succeeded();
|
return Succeeded();
|
||||||
}
|
}
|
||||||
void Open(const char *charSetDestination, const char *charSetSource, bool transliterations=true) {
|
void Open(const char *charSetDestination, const char *charSetSource, bool transliterations) {
|
||||||
Close();
|
Close();
|
||||||
if (*charSetSource) {
|
if (*charSetSource) {
|
||||||
// Try allowing approximate transliterations
|
// Try allowing approximate transliterations
|
||||||
if (transliterations) {
|
if (transliterations) {
|
||||||
char fullDest[200];
|
std::string fullDest(charSetDestination);
|
||||||
g_strlcpy(fullDest, charSetDestination, sizeof(fullDest));
|
fullDest.append("//TRANSLIT");
|
||||||
g_strlcat(fullDest, "//TRANSLIT", sizeof(fullDest));
|
OpenHandle(fullDest.c_str(), charSetSource);
|
||||||
OpenHandle(fullDest, charSetSource);
|
|
||||||
}
|
}
|
||||||
if (!Succeeded()) {
|
if (!Succeeded()) {
|
||||||
// Transliterations failed so try basic name
|
// Transliterations failed so try basic name
|
||||||
@ -67,17 +56,15 @@ public:
|
|||||||
iconvh = iconvhBad;
|
iconvh = iconvhBad;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
size_t Convert(char** src, size_t *srcleft, char **dst, size_t *dstleft) const {
|
gsize Convert(char** src, gsize *srcleft, char **dst, gsize *dstleft) const {
|
||||||
if (!Succeeded()) {
|
if (!Succeeded()) {
|
||||||
return (size_t)(-1);
|
return sizeFailure;
|
||||||
} else {
|
} else {
|
||||||
return iconv_adaptor(g_iconv, iconvh, src, srcleft, dst, dstleft);
|
return g_iconv(iconvh, src, srcleft, dst, dstleft);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
290
scintilla/gtk/ScintillaGTK.h
Normal file
@ -0,0 +1,290 @@
|
|||||||
|
// Scintilla source code edit control
|
||||||
|
// ScintillaGTK.h - GTK+ specific subclass of ScintillaBase
|
||||||
|
// Copyright 1998-2004 by Neil Hodgson <neilh@scintilla.org>
|
||||||
|
// The License.txt file describes the conditions under which this software may be distributed.
|
||||||
|
|
||||||
|
#ifndef SCINTILLAGTK_H
|
||||||
|
#define SCINTILLAGTK_H
|
||||||
|
|
||||||
|
namespace Scintilla {
|
||||||
|
|
||||||
|
class ScintillaGTKAccessible;
|
||||||
|
|
||||||
|
#define OBJECT_CLASS GObjectClass
|
||||||
|
|
||||||
|
class ScintillaGTK : public ScintillaBase {
|
||||||
|
friend class ScintillaGTKAccessible;
|
||||||
|
|
||||||
|
_ScintillaObject *sci;
|
||||||
|
Window wText;
|
||||||
|
Window scrollbarv;
|
||||||
|
Window scrollbarh;
|
||||||
|
GtkAdjustment *adjustmentv;
|
||||||
|
GtkAdjustment *adjustmenth;
|
||||||
|
Window wSelection;
|
||||||
|
int verticalScrollBarWidth;
|
||||||
|
int horizontalScrollBarHeight;
|
||||||
|
|
||||||
|
SelectionText primary;
|
||||||
|
|
||||||
|
GdkEvent *evbtn;
|
||||||
|
guint buttonMouse;
|
||||||
|
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;
|
||||||
|
gdouble smoothScrollY;
|
||||||
|
gdouble smoothScrollX;
|
||||||
|
|
||||||
|
#if GTK_CHECK_VERSION(3,0,0)
|
||||||
|
cairo_rectangle_list_t *rgnUpdate;
|
||||||
|
#else
|
||||||
|
GdkRegion *rgnUpdate;
|
||||||
|
#endif
|
||||||
|
bool repaintFullWindow;
|
||||||
|
|
||||||
|
guint styleIdleID;
|
||||||
|
int accessibilityEnabled;
|
||||||
|
AtkObject *accessible;
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit ScintillaGTK(_ScintillaObject *sci_);
|
||||||
|
// Deleted so ScintillaGTK objects can not be copied.
|
||||||
|
ScintillaGTK(const ScintillaGTK &) = delete;
|
||||||
|
ScintillaGTK(ScintillaGTK &&) = delete;
|
||||||
|
ScintillaGTK &operator=(const ScintillaGTK &) = delete;
|
||||||
|
ScintillaGTK &operator=(ScintillaGTK &&) = delete;
|
||||||
|
virtual ~ScintillaGTK();
|
||||||
|
static ScintillaGTK *FromWidget(GtkWidget *widget);
|
||||||
|
static void ClassInit(OBJECT_CLASS* object_class, GtkWidgetClass *widget_class, GtkContainerClass *container_class);
|
||||||
|
private:
|
||||||
|
void Init();
|
||||||
|
void Finalise() override;
|
||||||
|
bool AbandonPaint() override;
|
||||||
|
void DisplayCursor(Window::Cursor c) override;
|
||||||
|
bool DragThreshold(Point ptStart, Point ptNow) override;
|
||||||
|
void StartDrag() override;
|
||||||
|
Sci::Position TargetAsUTF8(char *text) const;
|
||||||
|
Sci::Position EncodedFromUTF8(const char *utf8, char *encoded) const;
|
||||||
|
bool ValidCodePage(int codePage) const override;
|
||||||
|
public: // Public for scintilla_send_message
|
||||||
|
sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) override;
|
||||||
|
private:
|
||||||
|
sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) override;
|
||||||
|
struct TimeThunk {
|
||||||
|
TickReason reason;
|
||||||
|
ScintillaGTK *scintilla;
|
||||||
|
guint timer;
|
||||||
|
TimeThunk() : reason(tickCaret), scintilla(NULL), timer(0) {}
|
||||||
|
};
|
||||||
|
TimeThunk timers[tickDwell+1];
|
||||||
|
bool FineTickerRunning(TickReason reason) override;
|
||||||
|
void FineTickerStart(TickReason reason, int millis, int tolerance) override;
|
||||||
|
void FineTickerCancel(TickReason reason) override;
|
||||||
|
bool SetIdle(bool on) override;
|
||||||
|
void SetMouseCapture(bool on) override;
|
||||||
|
bool HaveMouseCapture() override;
|
||||||
|
bool PaintContains(PRectangle rc) override;
|
||||||
|
void FullPaint();
|
||||||
|
PRectangle GetClientRectangle() const override;
|
||||||
|
void ScrollText(Sci::Line linesToMove) override;
|
||||||
|
void SetVerticalScrollPos() override;
|
||||||
|
void SetHorizontalScrollPos() override;
|
||||||
|
bool ModifyScrollBars(Sci::Line nMax, Sci::Line nPage) override;
|
||||||
|
void ReconfigureScrollBars() override;
|
||||||
|
void NotifyChange() override;
|
||||||
|
void NotifyFocus(bool focus) override;
|
||||||
|
void NotifyParent(SCNotification scn) override;
|
||||||
|
void NotifyKey(int key, int modifiers);
|
||||||
|
void NotifyURIDropped(const char *list);
|
||||||
|
const char *CharacterSetID() const;
|
||||||
|
CaseFolder *CaseFolderForEncoding() override;
|
||||||
|
std::string CaseMapString(const std::string &s, int caseMapping) override;
|
||||||
|
int KeyDefault(int key, int modifiers) override;
|
||||||
|
void CopyToClipboard(const SelectionText &selectedText) override;
|
||||||
|
void Copy() override;
|
||||||
|
void Paste() override;
|
||||||
|
void CreateCallTipWindow(PRectangle rc) override;
|
||||||
|
void AddToPopUp(const char *label, int cmd = 0, bool enabled = true) override;
|
||||||
|
bool OwnPrimarySelection();
|
||||||
|
void ClaimSelection() override;
|
||||||
|
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 *text);
|
||||||
|
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);
|
||||||
|
static void PrimarySelection(GtkWidget *widget, GtkSelectionData *selection_data, guint info, guint time_stamp, ScintillaGTK *sciThis);
|
||||||
|
static gboolean PrimaryClear(GtkWidget *widget, GdkEventSelection *event, ScintillaGTK *sciThis);
|
||||||
|
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
|
||||||
|
AtkObject* GetAccessibleThis(GtkWidget *widget);
|
||||||
|
static AtkObject* GetAccessible(GtkWidget *widget);
|
||||||
|
|
||||||
|
bool KoreanIME();
|
||||||
|
void CommitThis(char *commitStr);
|
||||||
|
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 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);
|
||||||
|
void IdleWork() override;
|
||||||
|
void QueueIdleWork(WorkNeeded::workItems items, Sci::Position upTo) override;
|
||||||
|
void SetDocPointer(Document *document) override;
|
||||||
|
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 *ctip);
|
||||||
|
#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);
|
||||||
|
};
|
||||||
|
|
||||||
|
// helper class to watch a GObject lifetime and get notified when it dies
|
||||||
|
class GObjectWatcher {
|
||||||
|
GObject *weakRef;
|
||||||
|
|
||||||
|
void WeakNotifyThis(GObject *obj G_GNUC_UNUSED) {
|
||||||
|
PLATFORM_ASSERT(obj == weakRef);
|
||||||
|
|
||||||
|
Destroyed();
|
||||||
|
weakRef = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void WeakNotify(gpointer data, GObject *obj) {
|
||||||
|
static_cast<GObjectWatcher*>(data)->WeakNotifyThis(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
GObjectWatcher(GObject *obj) :
|
||||||
|
weakRef(obj) {
|
||||||
|
g_object_weak_ref(weakRef, WeakNotify, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~GObjectWatcher() {
|
||||||
|
if (weakRef) {
|
||||||
|
g_object_weak_unref(weakRef, WeakNotify, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void Destroyed() {}
|
||||||
|
|
||||||
|
bool IsDestroyed() const {
|
||||||
|
return weakRef != 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
std::string ConvertText(const char *s, size_t len, const char *charSetDest,
|
||||||
|
const char *charSetSource, bool transliterations, bool silent=false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
1261
scintilla/gtk/ScintillaGTKAccessible.cxx
Normal file
192
scintilla/gtk/ScintillaGTKAccessible.h
Normal file
@ -0,0 +1,192 @@
|
|||||||
|
/* Scintilla source code edit control */
|
||||||
|
/* ScintillaGTKAccessible.h - GTK+ accessibility for ScintillaGTK */
|
||||||
|
/* Copyright 2016 by Colomban Wendling <colomban@geany.org>
|
||||||
|
* The License.txt file describes the conditions under which this software may be distributed. */
|
||||||
|
|
||||||
|
#ifndef SCINTILLAGTKACCESSIBLE_H
|
||||||
|
#define SCINTILLAGTKACCESSIBLE_H
|
||||||
|
|
||||||
|
namespace Scintilla {
|
||||||
|
|
||||||
|
#ifndef ATK_CHECK_VERSION
|
||||||
|
# define ATK_CHECK_VERSION(x, y, z) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
class ScintillaGTKAccessible {
|
||||||
|
private:
|
||||||
|
// weak references to related objects
|
||||||
|
GtkAccessible *accessible;
|
||||||
|
ScintillaGTK *sci;
|
||||||
|
|
||||||
|
// cache holding character offset for each line start, see CharacterOffsetFromByteOffset()
|
||||||
|
std::vector<Sci::Position> character_offsets;
|
||||||
|
|
||||||
|
// cached length of the deletion, in characters (see Notify())
|
||||||
|
int deletionLengthChar;
|
||||||
|
// local state for comparing
|
||||||
|
Sci::Position old_pos;
|
||||||
|
std::vector<SelectionRange> old_sels;
|
||||||
|
|
||||||
|
bool Enabled() const;
|
||||||
|
void UpdateCursor();
|
||||||
|
void Notify(GtkWidget *widget, gint code, SCNotification *nt);
|
||||||
|
static void SciNotify(GtkWidget *widget, gint code, SCNotification *nt, gpointer data) {
|
||||||
|
try {
|
||||||
|
static_cast<ScintillaGTKAccessible*>(data)->Notify(widget, code, nt);
|
||||||
|
} catch (...) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Sci::Position ByteOffsetFromCharacterOffset(Sci::Position startByte, int characterOffset) {
|
||||||
|
Sci::Position pos = sci->pdoc->GetRelativePosition(startByte, characterOffset);
|
||||||
|
if (pos == INVALID_POSITION) {
|
||||||
|
// clamp invalid positions inside the document
|
||||||
|
if (characterOffset > 0) {
|
||||||
|
return sci->pdoc->Length();
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
Sci::Position ByteOffsetFromCharacterOffset(Sci::Position characterOffset) {
|
||||||
|
return ByteOffsetFromCharacterOffset(0, characterOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
Sci::Position CharacterOffsetFromByteOffset(Sci::Position byteOffset) {
|
||||||
|
const Sci::Line line = sci->pdoc->LineFromPosition(byteOffset);
|
||||||
|
if (character_offsets.size() <= static_cast<size_t>(line)) {
|
||||||
|
if (character_offsets.empty())
|
||||||
|
character_offsets.push_back(0);
|
||||||
|
for (Sci::Position i = character_offsets.size(); i <= line; i++) {
|
||||||
|
const Sci::Position start = sci->pdoc->LineStart(i - 1);
|
||||||
|
const Sci::Position end = sci->pdoc->LineStart(i);
|
||||||
|
character_offsets.push_back(character_offsets[i - 1] + sci->pdoc->CountCharacters(start, end));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const Sci::Position lineStart = sci->pdoc->LineStart(line);
|
||||||
|
return character_offsets[line] + sci->pdoc->CountCharacters(lineStart, byteOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CharacterRangeFromByteRange(Sci::Position startByte, Sci::Position endByte, int *startChar, int *endChar) {
|
||||||
|
*startChar = CharacterOffsetFromByteOffset(startByte);
|
||||||
|
*endChar = *startChar + sci->pdoc->CountCharacters(startByte, endByte);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ByteRangeFromCharacterRange(int startChar, int endChar, Sci::Position& startByte, Sci::Position& endByte) {
|
||||||
|
startByte = ByteOffsetFromCharacterOffset(startChar);
|
||||||
|
endByte = ByteOffsetFromCharacterOffset(startByte, endChar - startChar);
|
||||||
|
}
|
||||||
|
|
||||||
|
Sci::Position PositionBefore(Sci::Position pos) {
|
||||||
|
return sci->pdoc->MovePositionOutsideChar(pos - 1, -1, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
Sci::Position PositionAfter(Sci::Position pos) {
|
||||||
|
return sci->pdoc->MovePositionOutsideChar(pos + 1, 1, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
int StyleAt(Sci::Position position, bool ensureStyle = false) {
|
||||||
|
if (ensureStyle)
|
||||||
|
sci->pdoc->EnsureStyledTo(position);
|
||||||
|
return sci->pdoc->StyleAt(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
// For AtkText
|
||||||
|
gchar *GetTextRangeUTF8(Sci::Position startByte, Sci::Position endByte);
|
||||||
|
gchar *GetText(int startChar, int endChar);
|
||||||
|
gchar *GetTextAfterOffset(int charOffset, AtkTextBoundary boundaryType, int *startChar, int *endChar);
|
||||||
|
gchar *GetTextBeforeOffset(int charOffset, AtkTextBoundary boundaryType, int *startChar, int *endChar);
|
||||||
|
gchar *GetTextAtOffset(int charOffset, AtkTextBoundary boundaryType, int *startChar, int *endChar);
|
||||||
|
#if ATK_CHECK_VERSION(2, 10, 0)
|
||||||
|
gchar *GetStringAtOffset(int charOffset, AtkTextGranularity granularity, int *startChar, int *endChar);
|
||||||
|
#endif
|
||||||
|
gunichar GetCharacterAtOffset(int charOffset);
|
||||||
|
gint GetCharacterCount();
|
||||||
|
gint GetCaretOffset();
|
||||||
|
gboolean SetCaretOffset(int charOffset);
|
||||||
|
gint GetOffsetAtPoint(gint x, gint y, AtkCoordType coords);
|
||||||
|
void GetCharacterExtents(int charOffset, gint *x, gint *y, gint *width, gint *height, AtkCoordType coords);
|
||||||
|
AtkAttributeSet *GetAttributesForStyle(unsigned int styleNum);
|
||||||
|
AtkAttributeSet *GetRunAttributes(int charOffset, int *startChar, int *endChar);
|
||||||
|
AtkAttributeSet *GetDefaultAttributes();
|
||||||
|
gint GetNSelections();
|
||||||
|
gchar *GetSelection(gint selection_num, int *startChar, int *endChar);
|
||||||
|
gboolean AddSelection(int startChar, int endChar);
|
||||||
|
gboolean RemoveSelection(int selection_num);
|
||||||
|
gboolean SetSelection(gint selection_num, int startChar, int endChar);
|
||||||
|
// for AtkEditableText
|
||||||
|
bool InsertStringUTF8(Sci::Position bytePos, const gchar *utf8, Sci::Position lengthBytes);
|
||||||
|
void SetTextContents(const gchar *contents);
|
||||||
|
void InsertText(const gchar *text, int lengthBytes, int *charPosition);
|
||||||
|
void CopyText(int startChar, int endChar);
|
||||||
|
void CutText(int startChar, int endChar);
|
||||||
|
void DeleteText(int startChar, int endChar);
|
||||||
|
void PasteText(int charPosition);
|
||||||
|
|
||||||
|
public:
|
||||||
|
ScintillaGTKAccessible(GtkAccessible *accessible_, GtkWidget *widget_);
|
||||||
|
~ScintillaGTKAccessible();
|
||||||
|
|
||||||
|
static ScintillaGTKAccessible *FromAccessible(GtkAccessible *accessible);
|
||||||
|
static ScintillaGTKAccessible *FromAccessible(AtkObject *accessible) {
|
||||||
|
return FromAccessible(GTK_ACCESSIBLE(accessible));
|
||||||
|
}
|
||||||
|
// So ScintillaGTK can notify us
|
||||||
|
void ChangeDocument(Document *oldDoc, Document *newDoc);
|
||||||
|
void NotifyReadOnly();
|
||||||
|
void SetAccessibility();
|
||||||
|
|
||||||
|
// Helper GtkWidget methods
|
||||||
|
static AtkObject *WidgetGetAccessibleImpl(GtkWidget *widget, AtkObject **cache, gpointer widget_parent_class);
|
||||||
|
|
||||||
|
// ATK methods
|
||||||
|
|
||||||
|
class AtkTextIface {
|
||||||
|
public:
|
||||||
|
static void init(::AtkTextIface *iface);
|
||||||
|
|
||||||
|
private:
|
||||||
|
AtkTextIface();
|
||||||
|
|
||||||
|
static gchar *GetText(AtkText *text, int start_offset, int end_offset);
|
||||||
|
static gchar *GetTextAfterOffset(AtkText *text, int offset, AtkTextBoundary boundary_type, int *start_offset, int *end_offset);
|
||||||
|
static gchar *GetTextBeforeOffset(AtkText *text, int offset, AtkTextBoundary boundary_type, int *start_offset, int *end_offset);
|
||||||
|
static gchar *GetTextAtOffset(AtkText *text, gint offset, AtkTextBoundary boundary_type, gint *start_offset, gint *end_offset);
|
||||||
|
#if ATK_CHECK_VERSION(2, 10, 0)
|
||||||
|
static gchar *GetStringAtOffset(AtkText *text, gint offset, AtkTextGranularity granularity, gint *start_offset, gint *end_offset);
|
||||||
|
#endif
|
||||||
|
static gunichar GetCharacterAtOffset(AtkText *text, gint offset);
|
||||||
|
static gint GetCharacterCount(AtkText *text);
|
||||||
|
static gint GetCaretOffset(AtkText *text);
|
||||||
|
static gboolean SetCaretOffset(AtkText *text, gint offset);
|
||||||
|
static gint GetOffsetAtPoint(AtkText *text, gint x, gint y, AtkCoordType coords);
|
||||||
|
static void GetCharacterExtents(AtkText *text, gint offset, gint *x, gint *y, gint *width, gint *height, AtkCoordType coords);
|
||||||
|
static AtkAttributeSet *GetRunAttributes(AtkText *text, gint offset, gint *start_offset, gint *end_offset);
|
||||||
|
static AtkAttributeSet *GetDefaultAttributes(AtkText *text);
|
||||||
|
static gint GetNSelections(AtkText *text);
|
||||||
|
static gchar *GetSelection(AtkText *text, gint selection_num, gint *start_pos, gint *end_pos);
|
||||||
|
static gboolean AddSelection(AtkText *text, gint start, gint end);
|
||||||
|
static gboolean RemoveSelection(AtkText *text, gint selection_num);
|
||||||
|
static gboolean SetSelection(AtkText *text, gint selection_num, gint start, gint end);
|
||||||
|
};
|
||||||
|
class AtkEditableTextIface {
|
||||||
|
public:
|
||||||
|
static void init(::AtkEditableTextIface *iface);
|
||||||
|
|
||||||
|
private:
|
||||||
|
AtkEditableTextIface();
|
||||||
|
|
||||||
|
static void SetTextContents(AtkEditableText *text, const gchar *contents);
|
||||||
|
static void InsertText(AtkEditableText *text, const gchar *contents, gint length, gint *position);
|
||||||
|
static void CopyText(AtkEditableText *text, gint start, gint end);
|
||||||
|
static void CutText(AtkEditableText *text, gint start, gint end);
|
||||||
|
static void DeleteText(AtkEditableText *text, gint start, gint end);
|
||||||
|
static void PasteText(AtkEditableText *text, gint position);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* SCINTILLAGTKACCESSIBLE_H */
|
@ -6,15 +6,22 @@
|
|||||||
# Builds for GTK+ 2 and no longer supports GTK+ 1.
|
# Builds for GTK+ 2 and no longer supports GTK+ 1.
|
||||||
# Also works with ming32-make on Windows.
|
# Also works with ming32-make on Windows.
|
||||||
|
|
||||||
.SUFFIXES: .cxx .c .o .h .a
|
.SUFFIXES: .cxx .c .o .h .a .list
|
||||||
|
|
||||||
|
srcdir ?= .
|
||||||
|
|
||||||
ifdef CLANG
|
ifdef CLANG
|
||||||
CXX = clang++ -Wno-deprecated-register
|
CXX = clang++
|
||||||
|
CXXWARNFLAGS = -Wall -pedantic -Wno-deprecated-register -Wno-missing-braces
|
||||||
CC = clang
|
CC = clang
|
||||||
# Can choose aspect to sanitize: address and undefined can simply change SANITIZE but for
|
# 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
|
# thread also need to create Position Independent Executable -> search online documentation
|
||||||
SANITIZE = address
|
SANITIZE = address
|
||||||
#SANITIZE = undefined
|
#SANITIZE = undefined
|
||||||
|
else
|
||||||
|
CXXWARNFLAGS = -Wall -pedantic
|
||||||
endif
|
endif
|
||||||
|
ARFLAGS = rc
|
||||||
RANLIB = touch
|
RANLIB = touch
|
||||||
|
|
||||||
ifdef GTK3
|
ifdef GTK3
|
||||||
@ -31,22 +38,29 @@ RANLIB = ranlib
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef windir
|
# Enable Position Independent Code except on Windows where it is the default so the flag produces a warning
|
||||||
DEL = del /q
|
ifndef windir
|
||||||
COMPLIB=..\bin\scintilla.a
|
PICFLAGS = -fPIC
|
||||||
else
|
|
||||||
DEL = rm -f
|
|
||||||
COMPLIB=../bin/scintilla.a
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
vpath %.h ../src ../include ../lexlib
|
ifdef windir
|
||||||
vpath %.cxx ../src ../lexlib ../lexers
|
CC = gcc
|
||||||
|
DEL = del /q
|
||||||
|
COMPLIB=$(srcdir)\..\bin\scintilla.a
|
||||||
|
else
|
||||||
|
DEL = rm -f
|
||||||
|
COMPLIB=$(srcdir)/../bin/scintilla.a
|
||||||
|
endif
|
||||||
|
|
||||||
INCLUDEDIRS=-I ../include -I ../src -I ../lexlib
|
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
|
ifdef CHECK_DEPRECATED
|
||||||
DEPRECATED=-DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DDISABLE_GDK_FONT
|
DEPRECATED=-DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DDISABLE_GDK_FONT
|
||||||
endif
|
endif
|
||||||
CXXBASEFLAGS=-Wall -pedantic -DGTK -DSCI_LEXER $(INCLUDEDIRS) $(DEPRECATED)
|
CXXBASEFLAGS=$(CXXWARNFLAGS) $(PICFLAGS) -DGTK -DSCI_LEXER $(INCLUDEDIRS) $(DEPRECATED)
|
||||||
|
|
||||||
ifdef NOTHREADS
|
ifdef NOTHREADS
|
||||||
THREADFLAGS=-DG_THREADS_IMPL_NONE
|
THREADFLAGS=-DG_THREADS_IMPL_NONE
|
||||||
@ -54,8 +68,8 @@ else
|
|||||||
THREADFLAGS=
|
THREADFLAGS=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef CXX11_REGEX
|
ifdef NO_CXX11_REGEX
|
||||||
REFLAGS=-DCXX11_REGEX
|
REFLAGS=-DNO_CXX11_REGEX
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef DEBUG
|
ifdef DEBUG
|
||||||
@ -68,38 +82,49 @@ else
|
|||||||
CTFLAGS=-DNDEBUG -Os $(CXXBASEFLAGS) $(THREADFLAGS)
|
CTFLAGS=-DNDEBUG -Os $(CXXBASEFLAGS) $(THREADFLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS:=$(CTFLAGS)
|
CXXTFLAGS:=--std=gnu++17 $(CTFLAGS) $(REFLAGS)
|
||||||
CXXTFLAGS:=--std=c++0x $(CTFLAGS) $(REFLAGS)
|
|
||||||
|
|
||||||
CONFIGFLAGS:=$(shell pkg-config --cflags $(GTKVERSION))
|
CONFIGFLAGS:=$(shell pkg-config --cflags $(GTKVERSION))
|
||||||
MARSHALLER=scintilla-marshal.o
|
MARSHALLER=scintilla-marshal.o
|
||||||
|
|
||||||
.cxx.o:
|
|
||||||
$(CXX) $(CONFIGFLAGS) $(CXXTFLAGS) $(CXXFLAGS) -c $<
|
|
||||||
.c.o:
|
|
||||||
$(CC) $(CONFIGFLAGS) $(CFLAGS) -w -c $<
|
|
||||||
|
|
||||||
LEXOBJS:=$(addsuffix .o,$(basename $(notdir $(wildcard ../lexers/Lex*.cxx))))
|
|
||||||
|
|
||||||
all: $(COMPLIB)
|
all: $(COMPLIB)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(DEL) *.o $(COMPLIB) *.plist
|
$(DEL) *.o $(COMPLIB) *.plist
|
||||||
|
|
||||||
|
.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 $(sort $(notdir $(wildcard $(srcdir)/../lexers/Lex*.cxx)))))
|
||||||
|
|
||||||
analyze:
|
analyze:
|
||||||
clang --analyze $(CONFIGFLAGS) $(CXXTFLAGS) $(CXXFLAGS) *.cxx ../src/*.cxx ../lexlib/*.cxx ../lexers/*.cxx
|
clang --analyze $(CONFIGFLAGS) $(CXXTFLAGS) $(CXXFLAGS) $(srcdir)/*.cxx $(srcdir)/../src/*.cxx $(srcdir)/../lexlib/*.cxx $(srcdir)/../lexers/*.cxx
|
||||||
|
|
||||||
deps:
|
# To minimize deltas, including between Unix and Windows, the lexer file names are sorted case-insensitively
|
||||||
$(CXX) -MM $(CONFIGFLAGS) $(CXXTFLAGS) *.cxx ../src/*.cxx ../lexlib/*.cxx ../lexers/*.cxx | sed -e 's/\/usr.* //' | grep [a-zA-Z] >deps.mak
|
LEXSORTED=$(shell ls $(srcdir)/../lexers/Lex*.cxx | sort -f)
|
||||||
|
DEPSRCS=$(srcdir)/*.cxx $(srcdir)/../src/*.cxx $(srcdir)/../lexlib/*.cxx $(LEXSORTED)
|
||||||
|
deps: deps.mak
|
||||||
|
deps.mak:
|
||||||
|
$(CXX) -MM $(CONFIGFLAGS) $(CXXTFLAGS) $(DEPSRCS) | sed -e 's/\/usr.* //' | grep [a-zA-Z] > $@
|
||||||
|
|
||||||
$(COMPLIB): Accessor.o CharacterSet.o LexerBase.o LexerModule.o LexerSimple.o StyleContext.o WordList.o \
|
$(COMPLIB): Accessor.o CharacterSet.o DefaultLexer.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 \
|
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 \
|
ScintillaBase.o ContractionState.o EditModel.o Editor.o EditView.o ExternalLexer.o MarginView.o \
|
||||||
PropSetSimple.o PlatGTK.o \
|
PropSetSimple.o PlatGTK.o \
|
||||||
KeyMap.o LineMarker.o PositionCache.o ScintillaGTK.o CellBuffer.o CharacterCategory.o ViewStyle.o \
|
KeyMap.o LineMarker.o PositionCache.o ScintillaGTK.o ScintillaGTKAccessible.o CellBuffer.o CharacterCategory.o ViewStyle.o \
|
||||||
RESearch.o RunStyles.o Selection.o Style.o Indicator.o AutoComplete.o UniConversion.o XPM.o \
|
RESearch.o RunStyles.o Selection.o Style.o Indicator.o AutoComplete.o UniConversion.o XPM.o \
|
||||||
$(MARSHALLER) $(LEXOBJS)
|
$(MARSHALLER) $(LEXOBJS)
|
||||||
$(AR) rc $@ $^
|
$(AR) $(ARFLAGS) $@ $^
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
# Automatically generate header dependencies with "make deps"
|
# Automatically generate header dependencies with "make deps"
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
|
||||||
#ifdef G_ENABLE_DEBUG
|
#ifdef G_ENABLE_DEBUG
|
||||||
#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v)
|
#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v)
|
||||||
#define g_marshal_value_peek_char(v) g_value_get_char (v)
|
#define g_marshal_value_peek_char(v) g_value_get_schar (v)
|
||||||
#define g_marshal_value_peek_uchar(v) g_value_get_uchar (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_int(v) g_value_get_int (v)
|
||||||
#define g_marshal_value_peek_uint(v) g_value_get_uint (v)
|
#define g_marshal_value_peek_uint(v) g_value_get_uint (v)
|
||||||
@ -21,6 +19,7 @@
|
|||||||
#define g_marshal_value_peek_boxed(v) g_value_get_boxed (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_pointer(v) g_value_get_pointer (v)
|
||||||
#define g_marshal_value_peek_object(v) g_value_get_object (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 */
|
#else /* !G_ENABLE_DEBUG */
|
||||||
/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
|
/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
|
||||||
* Do not access GValues directly in your code. Instead, use the
|
* Do not access GValues directly in your code. Instead, use the
|
||||||
@ -35,8 +34,8 @@
|
|||||||
#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong
|
#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_int64(v) (v)->data[0].v_int64
|
||||||
#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64
|
#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64
|
||||||
#define g_marshal_value_peek_enum(v) (v)->data[0].v_int
|
#define g_marshal_value_peek_enum(v) (v)->data[0].v_long
|
||||||
#define g_marshal_value_peek_flags(v) (v)->data[0].v_uint
|
#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_float(v) (v)->data[0].v_float
|
||||||
#define g_marshal_value_peek_double(v) (v)->data[0].v_double
|
#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_string(v) (v)->data[0].v_pointer
|
||||||
@ -44,25 +43,25 @@
|
|||||||
#define g_marshal_value_peek_boxed(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_pointer(v) (v)->data[0].v_pointer
|
||||||
#define g_marshal_value_peek_object(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 */
|
#endif /* !G_ENABLE_DEBUG */
|
||||||
|
|
||||||
|
/* VOID:INT,OBJECT (scintilla-marshal.list:1) */
|
||||||
/* NONE:INT,POINTER (scintilla-marshal.list:1) */
|
|
||||||
void
|
void
|
||||||
scintilla_marshal_VOID__INT_POINTER (GClosure *closure,
|
scintilla_marshal_VOID__INT_OBJECT (GClosure *closure,
|
||||||
GValue *return_value,
|
GValue *return_value G_GNUC_UNUSED,
|
||||||
guint n_param_values,
|
guint n_param_values,
|
||||||
const GValue *param_values,
|
const GValue *param_values,
|
||||||
gpointer invocation_hint,
|
gpointer invocation_hint G_GNUC_UNUSED,
|
||||||
gpointer marshal_data)
|
gpointer marshal_data)
|
||||||
{
|
{
|
||||||
typedef void (*GMarshalFunc_VOID__INT_POINTER) (gpointer data1,
|
typedef void (*GMarshalFunc_VOID__INT_OBJECT) (gpointer data1,
|
||||||
gint arg_1,
|
gint arg1,
|
||||||
gpointer arg_2,
|
gpointer arg2,
|
||||||
gpointer data2);
|
gpointer data2);
|
||||||
register GMarshalFunc_VOID__INT_POINTER callback;
|
GCClosure *cc = (GCClosure *) closure;
|
||||||
register GCClosure *cc = (GCClosure*) closure;
|
gpointer data1, data2;
|
||||||
register gpointer data1, data2;
|
GMarshalFunc_VOID__INT_OBJECT callback;
|
||||||
|
|
||||||
g_return_if_fail (n_param_values == 3);
|
g_return_if_fail (n_param_values == 3);
|
||||||
|
|
||||||
@ -76,11 +75,48 @@ scintilla_marshal_VOID__INT_POINTER (GClosure *closure,
|
|||||||
data1 = g_value_peek_pointer (param_values + 0);
|
data1 = g_value_peek_pointer (param_values + 0);
|
||||||
data2 = closure->data;
|
data2 = closure->data;
|
||||||
}
|
}
|
||||||
callback = (GMarshalFunc_VOID__INT_POINTER) (marshal_data ? marshal_data : cc->callback);
|
callback = (GMarshalFunc_VOID__INT_OBJECT) (marshal_data ? marshal_data : cc->callback);
|
||||||
|
|
||||||
callback (data1,
|
callback (data1,
|
||||||
g_marshal_value_peek_int (param_values + 1),
|
g_marshal_value_peek_int (param_values + 1),
|
||||||
g_marshal_value_peek_pointer (param_values + 2),
|
g_marshal_value_peek_object (param_values + 2),
|
||||||
|
data2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* VOID: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 arg1,
|
||||||
|
gpointer arg2,
|
||||||
|
gpointer data2);
|
||||||
|
GCClosure *cc = (GCClosure *) closure;
|
||||||
|
gpointer data1, data2;
|
||||||
|
GMarshalFunc_VOID__INT_BOXED callback;
|
||||||
|
|
||||||
|
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);
|
data2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,21 +1,30 @@
|
|||||||
|
/* This file is generated, all changes will be lost */
|
||||||
#ifndef __scintilla_marshal_MARSHAL_H__
|
#ifndef __SCINTILLA_MARSHAL_MARSHAL_H__
|
||||||
#define __scintilla_marshal_MARSHAL_H__
|
#define __SCINTILLA_MARSHAL_MARSHAL_H__
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
/* NONE:INT,POINTER (scintilla-marshal.list:1) */
|
/* VOID:INT,OBJECT (scintilla-marshal.list:1) */
|
||||||
extern void scintilla_marshal_VOID__INT_POINTER (GClosure *closure,
|
extern
|
||||||
|
void scintilla_marshal_VOID__INT_OBJECT (GClosure *closure,
|
||||||
GValue *return_value,
|
GValue *return_value,
|
||||||
guint n_param_values,
|
guint n_param_values,
|
||||||
const GValue *param_values,
|
const GValue *param_values,
|
||||||
gpointer invocation_hint,
|
gpointer invocation_hint,
|
||||||
gpointer marshal_data);
|
gpointer marshal_data);
|
||||||
#define scintilla_marshal_NONE__INT_POINTER scintilla_marshal_VOID__INT_POINTER
|
|
||||||
|
/* VOID: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);
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __scintilla_marshal_MARSHAL_H__ */
|
#endif /* __SCINTILLA_MARSHAL_MARSHAL_H__ */
|
||||||
|
|
||||||
|
@ -1 +1,2 @@
|
|||||||
NONE:INT,POINTER
|
VOID:INT,OBJECT
|
||||||
|
VOID:INT,BOXED
|
||||||
|
@ -8,69 +8,55 @@
|
|||||||
#ifndef ILEXER_H
|
#ifndef ILEXER_H
|
||||||
#define ILEXER_H
|
#define ILEXER_H
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
#include "Sci_Position.h"
|
||||||
|
|
||||||
namespace Scintilla {
|
namespace Scintilla {
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
enum { dvRelease4=2 };
|
||||||
#define SCI_METHOD __stdcall
|
|
||||||
#else
|
|
||||||
#define SCI_METHOD
|
|
||||||
#endif
|
|
||||||
|
|
||||||
enum { dvOriginal=0, dvLineEnd=1 };
|
|
||||||
|
|
||||||
class IDocument {
|
class IDocument {
|
||||||
public:
|
public:
|
||||||
virtual int SCI_METHOD Version() const = 0;
|
virtual int SCI_METHOD Version() const = 0;
|
||||||
virtual void SCI_METHOD SetErrorStatus(int status) = 0;
|
virtual void SCI_METHOD SetErrorStatus(int status) = 0;
|
||||||
virtual int SCI_METHOD Length() const = 0;
|
virtual Sci_Position SCI_METHOD Length() const = 0;
|
||||||
virtual void SCI_METHOD GetCharRange(char *buffer, int position, int lengthRetrieve) const = 0;
|
virtual void SCI_METHOD GetCharRange(char *buffer, Sci_Position position, Sci_Position lengthRetrieve) const = 0;
|
||||||
virtual char SCI_METHOD StyleAt(int position) const = 0;
|
virtual char SCI_METHOD StyleAt(Sci_Position position) const = 0;
|
||||||
virtual int SCI_METHOD LineFromPosition(int position) const = 0;
|
virtual Sci_Position SCI_METHOD LineFromPosition(Sci_Position position) const = 0;
|
||||||
virtual int SCI_METHOD LineStart(int line) const = 0;
|
virtual Sci_Position SCI_METHOD LineStart(Sci_Position line) const = 0;
|
||||||
virtual int SCI_METHOD GetLevel(int line) const = 0;
|
virtual int SCI_METHOD GetLevel(Sci_Position line) const = 0;
|
||||||
virtual int SCI_METHOD SetLevel(int line, int level) = 0;
|
virtual int SCI_METHOD SetLevel(Sci_Position line, int level) = 0;
|
||||||
virtual int SCI_METHOD GetLineState(int line) const = 0;
|
virtual int SCI_METHOD GetLineState(Sci_Position line) const = 0;
|
||||||
virtual int SCI_METHOD SetLineState(int line, int state) = 0;
|
virtual int SCI_METHOD SetLineState(Sci_Position line, int state) = 0;
|
||||||
virtual void SCI_METHOD StartStyling(int position, char mask) = 0;
|
virtual void SCI_METHOD StartStyling(Sci_Position position) = 0;
|
||||||
virtual bool SCI_METHOD SetStyleFor(int length, char style) = 0;
|
virtual bool SCI_METHOD SetStyleFor(Sci_Position length, char style) = 0;
|
||||||
virtual bool SCI_METHOD SetStyles(int length, const char *styles) = 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 DecorationSetCurrentIndicator(int indicator) = 0;
|
||||||
virtual void SCI_METHOD DecorationFillRange(int position, int value, int fillLength) = 0;
|
virtual void SCI_METHOD DecorationFillRange(Sci_Position position, int value, Sci_Position fillLength) = 0;
|
||||||
virtual void SCI_METHOD ChangeLexerState(int start, int end) = 0;
|
virtual void SCI_METHOD ChangeLexerState(Sci_Position start, Sci_Position end) = 0;
|
||||||
virtual int SCI_METHOD CodePage() const = 0;
|
virtual int SCI_METHOD CodePage() const = 0;
|
||||||
virtual bool SCI_METHOD IsDBCSLeadByte(char ch) const = 0;
|
virtual bool SCI_METHOD IsDBCSLeadByte(char ch) const = 0;
|
||||||
virtual const char * SCI_METHOD BufferPointer() = 0;
|
virtual const char * SCI_METHOD BufferPointer() = 0;
|
||||||
virtual int SCI_METHOD GetLineIndentation(int line) = 0;
|
virtual int SCI_METHOD GetLineIndentation(Sci_Position line) = 0;
|
||||||
|
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;
|
||||||
};
|
};
|
||||||
|
|
||||||
class IDocumentWithLineEnd : public IDocument {
|
enum { lvRelease4=2 };
|
||||||
public:
|
|
||||||
virtual int SCI_METHOD LineEnd(int line) const = 0;
|
|
||||||
virtual int SCI_METHOD GetRelativePosition(int positionStart, int characterOffset) const = 0;
|
|
||||||
virtual int SCI_METHOD GetCharacterAndWidth(int position, int *pWidth) const = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum { lvOriginal=0, lvSubStyles=1 };
|
class ILexer4 {
|
||||||
|
|
||||||
class ILexer {
|
|
||||||
public:
|
public:
|
||||||
virtual int SCI_METHOD Version() const = 0;
|
virtual int SCI_METHOD Version() const = 0;
|
||||||
virtual void SCI_METHOD Release() = 0;
|
virtual void SCI_METHOD Release() = 0;
|
||||||
virtual const char * SCI_METHOD PropertyNames() = 0;
|
virtual const char * SCI_METHOD PropertyNames() = 0;
|
||||||
virtual int SCI_METHOD PropertyType(const char *name) = 0;
|
virtual int SCI_METHOD PropertyType(const char *name) = 0;
|
||||||
virtual const char * SCI_METHOD DescribeProperty(const char *name) = 0;
|
virtual const char * SCI_METHOD DescribeProperty(const char *name) = 0;
|
||||||
virtual int SCI_METHOD PropertySet(const char *key, const char *val) = 0;
|
virtual Sci_Position SCI_METHOD PropertySet(const char *key, const char *val) = 0;
|
||||||
virtual const char * SCI_METHOD DescribeWordListSets() = 0;
|
virtual const char * SCI_METHOD DescribeWordListSets() = 0;
|
||||||
virtual int SCI_METHOD WordListSet(int n, const char *wl) = 0;
|
virtual Sci_Position SCI_METHOD WordListSet(int n, const char *wl) = 0;
|
||||||
virtual void SCI_METHOD Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) = 0;
|
virtual void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) = 0;
|
||||||
virtual void SCI_METHOD Fold(unsigned int startPos, int 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;
|
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 LineEndTypesSupported() = 0;
|
||||||
virtual int SCI_METHOD AllocateSubStyles(int styleBase, int numberStyles) = 0;
|
virtual int SCI_METHOD AllocateSubStyles(int styleBase, int numberStyles) = 0;
|
||||||
virtual int SCI_METHOD SubStylesStart(int styleBase) = 0;
|
virtual int SCI_METHOD SubStylesStart(int styleBase) = 0;
|
||||||
@ -81,18 +67,12 @@ public:
|
|||||||
virtual void SCI_METHOD SetIdentifiers(int style, const char *identifiers) = 0;
|
virtual void SCI_METHOD SetIdentifiers(int style, const char *identifiers) = 0;
|
||||||
virtual int SCI_METHOD DistanceToSecondaryStyles() = 0;
|
virtual int SCI_METHOD DistanceToSecondaryStyles() = 0;
|
||||||
virtual const char * SCI_METHOD GetSubStyleBases() = 0;
|
virtual const char * SCI_METHOD GetSubStyleBases() = 0;
|
||||||
|
virtual int SCI_METHOD NamedStyles() = 0;
|
||||||
|
virtual const char * SCI_METHOD NameOfStyle(int style) = 0;
|
||||||
|
virtual const char * SCI_METHOD TagsOfStyle(int style) = 0;
|
||||||
|
virtual const char * SCI_METHOD DescriptionOfStyle(int style) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
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;
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
21
scintilla/include/ILoader.h
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
// Scintilla source code edit control
|
||||||
|
/** @file ILoader.h
|
||||||
|
** Interface for loading into a Scintilla document from a background thread.
|
||||||
|
**/
|
||||||
|
// Copyright 1998-2017 by Neil Hodgson <neilh@scintilla.org>
|
||||||
|
// The License.txt file describes the conditions under which this software may be distributed.
|
||||||
|
|
||||||
|
#ifndef ILOADER_H
|
||||||
|
#define ILOADER_H
|
||||||
|
|
||||||
|
#include "Sci_Position.h"
|
||||||
|
|
||||||
|
class ILoader {
|
||||||
|
public:
|
||||||
|
virtual int SCI_METHOD Release() = 0;
|
||||||
|
// Returns a status code from SC_STATUS_*
|
||||||
|
virtual int SCI_METHOD AddData(const char *data, Sci_Position length) = 0;
|
||||||
|
virtual void * SCI_METHOD ConvertToDocument() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -25,6 +25,7 @@
|
|||||||
#define PLAT_FOX 0
|
#define PLAT_FOX 0
|
||||||
#define PLAT_CURSES 0
|
#define PLAT_CURSES 0
|
||||||
#define PLAT_TK 0
|
#define PLAT_TK 0
|
||||||
|
#define PLAT_HAIKU 0
|
||||||
|
|
||||||
#if defined(FOX)
|
#if defined(FOX)
|
||||||
#undef PLAT_FOX
|
#undef PLAT_FOX
|
||||||
@ -38,6 +39,10 @@
|
|||||||
#undef PLAT_CURSES
|
#undef PLAT_CURSES
|
||||||
#define PLAT_CURSES 1
|
#define PLAT_CURSES 1
|
||||||
|
|
||||||
|
#elif defined(__HAIKU__)
|
||||||
|
#undef PLAT_HAIKU
|
||||||
|
#define PLAT_HAIKU 1
|
||||||
|
|
||||||
#elif defined(SCINTILLA_QT)
|
#elif defined(SCINTILLA_QT)
|
||||||
#undef PLAT_QT
|
#undef PLAT_QT
|
||||||
#define PLAT_QT 1
|
#define PLAT_QT 1
|
||||||
@ -71,15 +76,10 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
namespace Scintilla {
|
namespace Scintilla {
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef float XYPOSITION;
|
typedef float XYPOSITION;
|
||||||
typedef double XYACCUMULATOR;
|
typedef double XYACCUMULATOR;
|
||||||
inline int RoundXYPosition(XYPOSITION xyPos) {
|
|
||||||
return int(xyPos + 0.5);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Underlying the implementation of the platform classes are platform specific types.
|
// 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
|
// Sometimes these need to be passed around by client code so they are defined here
|
||||||
@ -101,21 +101,19 @@ public:
|
|||||||
XYPOSITION x;
|
XYPOSITION x;
|
||||||
XYPOSITION y;
|
XYPOSITION y;
|
||||||
|
|
||||||
explicit Point(XYPOSITION x_=0, XYPOSITION y_=0) : x(x_), y(y_) {
|
constexpr explicit Point(XYPOSITION x_=0, XYPOSITION y_=0) noexcept : x(x_), y(y_) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static Point FromInts(int x_, int y_) {
|
static Point FromInts(int x_, int y_) noexcept {
|
||||||
return Point(static_cast<XYPOSITION>(x_), static_cast<XYPOSITION>(y_));
|
return Point(static_cast<XYPOSITION>(x_), static_cast<XYPOSITION>(y_));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Other automatically defined methods (assignment, copy constructor, destructor) are fine
|
// Other automatically defined methods (assignment, copy constructor, destructor) are fine
|
||||||
|
|
||||||
static Point FromLong(long lpoint);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A geometric rectangle class.
|
* A geometric rectangle class.
|
||||||
* PRectangle is similar to the Win32 RECT.
|
* PRectangle is similar to Win32 RECT.
|
||||||
* PRectangles contain their top and left sides, but not their right and bottom sides.
|
* PRectangles contain their top and left sides, but not their right and bottom sides.
|
||||||
*/
|
*/
|
||||||
class PRectangle {
|
class PRectangle {
|
||||||
@ -125,113 +123,147 @@ public:
|
|||||||
XYPOSITION right;
|
XYPOSITION right;
|
||||||
XYPOSITION bottom;
|
XYPOSITION bottom;
|
||||||
|
|
||||||
explicit PRectangle(XYPOSITION left_=0, XYPOSITION top_=0, XYPOSITION right_=0, XYPOSITION bottom_ = 0) :
|
constexpr explicit PRectangle(XYPOSITION left_=0, XYPOSITION top_=0, XYPOSITION right_=0, XYPOSITION bottom_ = 0) noexcept :
|
||||||
left(left_), top(top_), right(right_), bottom(bottom_) {
|
left(left_), top(top_), right(right_), bottom(bottom_) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static PRectangle FromInts(int left_, int top_, int right_, int bottom_) {
|
static PRectangle FromInts(int left_, int top_, int right_, int bottom_) noexcept {
|
||||||
return PRectangle(static_cast<XYPOSITION>(left_), static_cast<XYPOSITION>(top_),
|
return PRectangle(static_cast<XYPOSITION>(left_), static_cast<XYPOSITION>(top_),
|
||||||
static_cast<XYPOSITION>(right_), static_cast<XYPOSITION>(bottom_));
|
static_cast<XYPOSITION>(right_), static_cast<XYPOSITION>(bottom_));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Other automatically defined methods (assignment, copy constructor, destructor) are fine
|
// Other automatically defined methods (assignment, copy constructor, destructor) are fine
|
||||||
|
|
||||||
bool operator==(PRectangle &rc) const {
|
bool operator==(const PRectangle &rc) const noexcept {
|
||||||
return (rc.left == left) && (rc.right == right) &&
|
return (rc.left == left) && (rc.right == right) &&
|
||||||
(rc.top == top) && (rc.bottom == bottom);
|
(rc.top == top) && (rc.bottom == bottom);
|
||||||
}
|
}
|
||||||
bool Contains(Point pt) const {
|
bool Contains(Point pt) const noexcept {
|
||||||
return (pt.x >= left) && (pt.x <= right) &&
|
return (pt.x >= left) && (pt.x <= right) &&
|
||||||
(pt.y >= top) && (pt.y <= bottom);
|
(pt.y >= top) && (pt.y <= bottom);
|
||||||
}
|
}
|
||||||
bool ContainsWholePixel(Point pt) const {
|
bool ContainsWholePixel(Point pt) const noexcept {
|
||||||
// Does the rectangle contain all of the pixel to left/below the point
|
// Does the rectangle contain all of the pixel to left/below the point
|
||||||
return (pt.x >= left) && ((pt.x+1) <= right) &&
|
return (pt.x >= left) && ((pt.x+1) <= right) &&
|
||||||
(pt.y >= top) && ((pt.y+1) <= bottom);
|
(pt.y >= top) && ((pt.y+1) <= bottom);
|
||||||
}
|
}
|
||||||
bool Contains(PRectangle rc) const {
|
bool Contains(PRectangle rc) const noexcept {
|
||||||
return (rc.left >= left) && (rc.right <= right) &&
|
return (rc.left >= left) && (rc.right <= right) &&
|
||||||
(rc.top >= top) && (rc.bottom <= bottom);
|
(rc.top >= top) && (rc.bottom <= bottom);
|
||||||
}
|
}
|
||||||
bool Intersects(PRectangle other) const {
|
bool Intersects(PRectangle other) const noexcept {
|
||||||
return (right > other.left) && (left < other.right) &&
|
return (right > other.left) && (left < other.right) &&
|
||||||
(bottom > other.top) && (top < other.bottom);
|
(bottom > other.top) && (top < other.bottom);
|
||||||
}
|
}
|
||||||
void Move(XYPOSITION xDelta, XYPOSITION yDelta) {
|
void Move(XYPOSITION xDelta, XYPOSITION yDelta) noexcept {
|
||||||
left += xDelta;
|
left += xDelta;
|
||||||
top += yDelta;
|
top += yDelta;
|
||||||
right += xDelta;
|
right += xDelta;
|
||||||
bottom += yDelta;
|
bottom += yDelta;
|
||||||
}
|
}
|
||||||
XYPOSITION Width() const { return right - left; }
|
XYPOSITION Width() const noexcept { return right - left; }
|
||||||
XYPOSITION Height() const { return bottom - top; }
|
XYPOSITION Height() const noexcept { return bottom - top; }
|
||||||
bool Empty() const {
|
bool Empty() const noexcept {
|
||||||
return (Height() <= 0) || (Width() <= 0);
|
return (Height() <= 0) || (Width() <= 0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds a desired RGB colour.
|
* Holds an RGB colour with 8 bits for each component.
|
||||||
*/
|
*/
|
||||||
|
constexpr const float componentMaximum = 255.0f;
|
||||||
class ColourDesired {
|
class ColourDesired {
|
||||||
long co;
|
int co;
|
||||||
public:
|
public:
|
||||||
ColourDesired(long lcol=0) {
|
explicit ColourDesired(int co_=0) noexcept : co(co_) {
|
||||||
co = lcol;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ColourDesired(unsigned int red, unsigned int green, unsigned int blue) {
|
ColourDesired(unsigned int red, unsigned int green, unsigned int blue) noexcept :
|
||||||
Set(red, green, blue);
|
co(red | (green << 8) | (blue << 16)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const ColourDesired &other) const {
|
bool operator==(const ColourDesired &other) const noexcept {
|
||||||
return co == other.co;
|
return co == other.co;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Set(long lcol) {
|
int AsInteger() const noexcept {
|
||||||
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;
|
return co;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int GetRed() const {
|
// Red, green and blue values as bytes 0..255
|
||||||
|
unsigned char GetRed() const noexcept {
|
||||||
return co & 0xff;
|
return co & 0xff;
|
||||||
}
|
}
|
||||||
|
unsigned char GetGreen() const noexcept {
|
||||||
unsigned int GetGreen() const {
|
|
||||||
return (co >> 8) & 0xff;
|
return (co >> 8) & 0xff;
|
||||||
}
|
}
|
||||||
|
unsigned char GetBlue() const noexcept {
|
||||||
unsigned int GetBlue() const {
|
|
||||||
return (co >> 16) & 0xff;
|
return (co >> 16) & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Red, green and blue values as float 0..1.0
|
||||||
|
float GetRedComponent() const noexcept {
|
||||||
|
return GetRed() / componentMaximum;
|
||||||
|
}
|
||||||
|
float GetGreenComponent() const noexcept {
|
||||||
|
return GetGreen() / componentMaximum;
|
||||||
|
}
|
||||||
|
float GetBlueComponent() const noexcept {
|
||||||
|
return GetBlue() / componentMaximum;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Holds an RGBA colour.
|
||||||
|
*/
|
||||||
|
class ColourAlpha : public ColourDesired {
|
||||||
|
public:
|
||||||
|
explicit ColourAlpha(int co_ = 0) noexcept : ColourDesired(co_) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ColourAlpha(unsigned int red, unsigned int green, unsigned int blue) noexcept :
|
||||||
|
ColourDesired(red | (green << 8) | (blue << 16)) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ColourAlpha(unsigned int red, unsigned int green, unsigned int blue, unsigned int alpha) noexcept :
|
||||||
|
ColourDesired(red | (green << 8) | (blue << 16) | (alpha << 24)) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ColourAlpha(ColourDesired cd, unsigned int alpha) noexcept :
|
||||||
|
ColourDesired(cd.AsInteger() | (alpha << 24)) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ColourDesired GetColour() const noexcept {
|
||||||
|
return ColourDesired(AsInteger() & 0xffffff);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char GetAlpha() const noexcept {
|
||||||
|
return (AsInteger() >> 24) & 0xff;
|
||||||
|
}
|
||||||
|
|
||||||
|
float GetAlphaComponent() const noexcept {
|
||||||
|
return GetAlpha() / componentMaximum;
|
||||||
|
}
|
||||||
|
|
||||||
|
ColourAlpha MixedWith(ColourAlpha other) const noexcept {
|
||||||
|
const unsigned int red = (GetRed() + other.GetRed()) / 2;
|
||||||
|
const unsigned int green = (GetGreen() + other.GetGreen()) / 2;
|
||||||
|
const unsigned int blue = (GetBlue() + other.GetBlue()) / 2;
|
||||||
|
const unsigned int alpha = (GetAlpha() + other.GetAlpha()) / 2;
|
||||||
|
return ColourAlpha(red, green, blue, alpha);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Holds an element of a gradient with an RGBA colour and a relative position.
|
||||||
|
*/
|
||||||
|
class ColourStop {
|
||||||
|
public:
|
||||||
|
float position;
|
||||||
|
ColourAlpha colour;
|
||||||
|
ColourStop(float position_, ColourAlpha colour_) noexcept :
|
||||||
|
position(position_), colour(colour_) {
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -254,7 +286,7 @@ struct FontParameters {
|
|||||||
bool italic_=false,
|
bool italic_=false,
|
||||||
int extraFontFlag_=0,
|
int extraFontFlag_=0,
|
||||||
int technology_=0,
|
int technology_=0,
|
||||||
int characterSet_=0) :
|
int characterSet_=0) noexcept :
|
||||||
|
|
||||||
faceName(faceName_),
|
faceName(faceName_),
|
||||||
size(size_),
|
size(size_),
|
||||||
@ -271,33 +303,62 @@ struct FontParameters {
|
|||||||
class Font {
|
class Font {
|
||||||
protected:
|
protected:
|
||||||
FontID fid;
|
FontID fid;
|
||||||
// Private so Font objects can not be copied
|
|
||||||
Font(const Font &);
|
|
||||||
Font &operator=(const Font &);
|
|
||||||
public:
|
public:
|
||||||
Font();
|
Font() noexcept;
|
||||||
|
// Deleted so Font objects can not be copied
|
||||||
|
Font(const Font &) = delete;
|
||||||
|
Font(Font &&) = delete;
|
||||||
|
Font &operator=(const Font &) = delete;
|
||||||
|
Font &operator=(Font &&) = delete;
|
||||||
virtual ~Font();
|
virtual ~Font();
|
||||||
|
|
||||||
virtual void Create(const FontParameters &fp);
|
virtual void Create(const FontParameters &fp);
|
||||||
virtual void Release();
|
virtual void Release();
|
||||||
|
|
||||||
FontID GetID() { return fid; }
|
FontID GetID() const noexcept { return fid; }
|
||||||
// Alias another font - caller guarantees not to Release
|
// Alias another font - caller guarantees not to Release
|
||||||
void SetID(FontID fid_) { fid = fid_; }
|
void SetID(FontID fid_) noexcept { fid = fid_; }
|
||||||
friend class Surface;
|
friend class Surface;
|
||||||
friend class SurfaceImpl;
|
friend class SurfaceImpl;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class IScreenLine {
|
||||||
|
public:
|
||||||
|
virtual std::string_view Text() const = 0;
|
||||||
|
virtual size_t Length() const = 0;
|
||||||
|
virtual size_t RepresentationCount() const = 0;
|
||||||
|
virtual XYPOSITION Width() const = 0;
|
||||||
|
virtual XYPOSITION Height() const = 0;
|
||||||
|
virtual XYPOSITION TabWidth() const = 0;
|
||||||
|
virtual XYPOSITION TabWidthMinimumPixels() const = 0;
|
||||||
|
virtual const Font *FontOfPosition(size_t position) const = 0;
|
||||||
|
virtual XYPOSITION RepresentationWidth(size_t position) const = 0;
|
||||||
|
virtual XYPOSITION TabPositionAfter(XYPOSITION xPosition) const = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Interval {
|
||||||
|
XYPOSITION left;
|
||||||
|
XYPOSITION right;
|
||||||
|
};
|
||||||
|
|
||||||
|
class IScreenLineLayout {
|
||||||
|
public:
|
||||||
|
virtual ~IScreenLineLayout() = default;
|
||||||
|
virtual size_t PositionFromX(XYPOSITION xDistance, bool charPosition) = 0;
|
||||||
|
virtual XYPOSITION XFromPosition(size_t caretPosition) = 0;
|
||||||
|
virtual std::vector<Interval> FindRangeIntervals(size_t start, size_t end) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A surface abstracts a place to draw.
|
* A surface abstracts a place to draw.
|
||||||
*/
|
*/
|
||||||
class Surface {
|
class Surface {
|
||||||
private:
|
|
||||||
// Private so Surface objects can not be copied
|
|
||||||
Surface(const Surface &) {}
|
|
||||||
Surface &operator=(const Surface &) { return *this; }
|
|
||||||
public:
|
public:
|
||||||
Surface() {}
|
Surface() noexcept = default;
|
||||||
|
Surface(const Surface &) = delete;
|
||||||
|
Surface(Surface &&) = delete;
|
||||||
|
Surface &operator=(const Surface &) = delete;
|
||||||
|
Surface &operator=(Surface &&) = delete;
|
||||||
virtual ~Surface() {}
|
virtual ~Surface() {}
|
||||||
static Surface *Allocate(int technology);
|
static Surface *Allocate(int technology);
|
||||||
|
|
||||||
@ -312,27 +373,29 @@ public:
|
|||||||
virtual int DeviceHeightFont(int points)=0;
|
virtual int DeviceHeightFont(int points)=0;
|
||||||
virtual void MoveTo(int x_, int y_)=0;
|
virtual void MoveTo(int x_, int y_)=0;
|
||||||
virtual void LineTo(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 Polygon(Point *pts, size_t npts, ColourDesired fore, ColourDesired back)=0;
|
||||||
virtual void RectangleDraw(PRectangle rc, 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, ColourDesired back)=0;
|
||||||
virtual void FillRectangle(PRectangle rc, Surface &surfacePattern)=0;
|
virtual void FillRectangle(PRectangle rc, Surface &surfacePattern)=0;
|
||||||
virtual void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back)=0;
|
virtual void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back)=0;
|
||||||
virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill,
|
virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill,
|
||||||
ColourDesired outline, int alphaOutline, int flags)=0;
|
ColourDesired outline, int alphaOutline, int flags)=0;
|
||||||
|
enum class GradientOptions { leftToRight, topToBottom };
|
||||||
|
virtual void GradientRectangle(PRectangle rc, const std::vector<ColourStop> &stops, GradientOptions options)=0;
|
||||||
virtual void DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage) = 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 Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back)=0;
|
||||||
virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource)=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 std::unique_ptr<IScreenLineLayout> Layout(const IScreenLine *screenLine) = 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 DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, std::string_view text, ColourDesired fore, ColourDesired back) = 0;
|
||||||
virtual void MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions)=0;
|
virtual void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, std::string_view text, ColourDesired fore, ColourDesired back) = 0;
|
||||||
virtual XYPOSITION WidthText(Font &font_, const char *s, int len)=0;
|
virtual void DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, std::string_view text, ColourDesired fore) = 0;
|
||||||
virtual XYPOSITION WidthChar(Font &font_, char ch)=0;
|
virtual void MeasureWidths(Font &font_, std::string_view text, XYPOSITION *positions) = 0;
|
||||||
|
virtual XYPOSITION WidthText(Font &font_, std::string_view text) = 0;
|
||||||
virtual XYPOSITION Ascent(Font &font_)=0;
|
virtual XYPOSITION Ascent(Font &font_)=0;
|
||||||
virtual XYPOSITION Descent(Font &font_)=0;
|
virtual XYPOSITION Descent(Font &font_)=0;
|
||||||
virtual XYPOSITION InternalLeading(Font &font_)=0;
|
virtual XYPOSITION InternalLeading(Font &font_)=0;
|
||||||
virtual XYPOSITION ExternalLeading(Font &font_)=0;
|
|
||||||
virtual XYPOSITION Height(Font &font_)=0;
|
virtual XYPOSITION Height(Font &font_)=0;
|
||||||
virtual XYPOSITION AverageCharWidth(Font &font_)=0;
|
virtual XYPOSITION AverageCharWidth(Font &font_)=0;
|
||||||
|
|
||||||
@ -341,13 +404,9 @@ public:
|
|||||||
|
|
||||||
virtual void SetUnicodeMode(bool unicodeMode_)=0;
|
virtual void SetUnicodeMode(bool unicodeMode_)=0;
|
||||||
virtual void SetDBCSMode(int codePage)=0;
|
virtual void SetDBCSMode(int codePage)=0;
|
||||||
|
virtual void SetBidiR2L(bool bidiR2L_)=0;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* A simple callback action passing one piece of untyped user data.
|
|
||||||
*/
|
|
||||||
typedef void (*CallBackAction)(void*);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to hide the details of window manipulation.
|
* Class to hide the details of window manipulation.
|
||||||
* Does not own the window which will normally have a longer life than this object.
|
* Does not own the window which will normally have a longer life than this object.
|
||||||
@ -356,30 +415,31 @@ class Window {
|
|||||||
protected:
|
protected:
|
||||||
WindowID wid;
|
WindowID wid;
|
||||||
public:
|
public:
|
||||||
Window() : wid(0), cursorLast(cursorInvalid) {
|
Window() noexcept : wid(nullptr), cursorLast(cursorInvalid) {
|
||||||
}
|
}
|
||||||
Window(const Window &source) : wid(source.wid), cursorLast(cursorInvalid) {
|
Window(const Window &source) = delete;
|
||||||
}
|
Window(Window &&) = delete;
|
||||||
virtual ~Window();
|
Window &operator=(WindowID wid_) noexcept {
|
||||||
Window &operator=(WindowID wid_) {
|
|
||||||
wid = wid_;
|
wid = wid_;
|
||||||
|
cursorLast = cursorInvalid;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
WindowID GetID() const { return wid; }
|
Window &operator=(const Window &) = delete;
|
||||||
bool Created() const { return wid != 0; }
|
Window &operator=(Window &&) = delete;
|
||||||
|
virtual ~Window();
|
||||||
|
WindowID GetID() const noexcept { return wid; }
|
||||||
|
bool Created() const noexcept { return wid != nullptr; }
|
||||||
void Destroy();
|
void Destroy();
|
||||||
bool HasFocus();
|
PRectangle GetPosition() const;
|
||||||
PRectangle GetPosition();
|
|
||||||
void SetPosition(PRectangle rc);
|
void SetPosition(PRectangle rc);
|
||||||
void SetPositionRelative(PRectangle rc, Window relativeTo);
|
void SetPositionRelative(PRectangle rc, const Window *relativeTo);
|
||||||
PRectangle GetClientPosition();
|
PRectangle GetClientPosition() const;
|
||||||
void Show(bool show=true);
|
void Show(bool show=true);
|
||||||
void InvalidateAll();
|
void InvalidateAll();
|
||||||
void InvalidateRectangle(PRectangle rc);
|
void InvalidateRectangle(PRectangle rc);
|
||||||
virtual void SetFont(Font &font);
|
virtual void SetFont(Font &font);
|
||||||
enum Cursor { cursorInvalid, cursorText, cursorArrow, cursorUp, cursorWait, cursorHoriz, cursorVert, cursorReverseArrow, cursorHand };
|
enum Cursor { cursorInvalid, cursorText, cursorArrow, cursorUp, cursorWait, cursorHoriz, cursorVert, cursorReverseArrow, cursorHand };
|
||||||
void SetCursor(Cursor curs);
|
void SetCursor(Cursor curs);
|
||||||
void SetTitle(const char *s);
|
|
||||||
PRectangle GetMonitorRect(Point pt);
|
PRectangle GetMonitorRect(Point pt);
|
||||||
private:
|
private:
|
||||||
Cursor cursorLast;
|
Cursor cursorLast;
|
||||||
@ -389,13 +449,26 @@ private:
|
|||||||
* Listbox management.
|
* Listbox management.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// ScintillaBase implements IListBoxDelegate to receive ListBoxEvents from a ListBox
|
||||||
|
|
||||||
|
struct ListBoxEvent {
|
||||||
|
enum class EventType { selectionChange, doubleClick } event;
|
||||||
|
ListBoxEvent(EventType event_) noexcept : event(event_) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class IListBoxDelegate {
|
||||||
|
public:
|
||||||
|
virtual void ListNotify(ListBoxEvent *plbe)=0;
|
||||||
|
};
|
||||||
|
|
||||||
class ListBox : public Window {
|
class ListBox : public Window {
|
||||||
public:
|
public:
|
||||||
ListBox();
|
ListBox() noexcept;
|
||||||
virtual ~ListBox();
|
~ListBox() override;
|
||||||
static ListBox *Allocate();
|
static ListBox *Allocate();
|
||||||
|
|
||||||
virtual void SetFont(Font &font)=0;
|
void SetFont(Font &font) override =0;
|
||||||
virtual void Create(Window &parent, int ctrlID, Point location, int lineHeight_, bool unicodeMode_, int technology_)=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 SetAverageCharWidth(int width)=0;
|
||||||
virtual void SetVisibleRows(int rows)=0;
|
virtual void SetVisibleRows(int rows)=0;
|
||||||
@ -412,7 +485,7 @@ public:
|
|||||||
virtual void RegisterImage(int type, const char *xpm_data)=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 RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage) = 0;
|
||||||
virtual void ClearRegisteredImages()=0;
|
virtual void ClearRegisteredImages()=0;
|
||||||
virtual void SetDoubleClickAction(CallBackAction, void *)=0;
|
virtual void SetDelegate(IListBoxDelegate *lbDelegate)=0;
|
||||||
virtual void SetList(const char* list, char separator, char typesep)=0;
|
virtual void SetList(const char* list, char separator, char typesep)=0;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -422,27 +495,19 @@ public:
|
|||||||
class Menu {
|
class Menu {
|
||||||
MenuID mid;
|
MenuID mid;
|
||||||
public:
|
public:
|
||||||
Menu();
|
Menu() noexcept;
|
||||||
MenuID GetID() { return mid; }
|
MenuID GetID() const noexcept { return mid; }
|
||||||
void CreatePopUp();
|
void CreatePopUp();
|
||||||
void Destroy();
|
void Destroy();
|
||||||
void Show(Point pt, Window &w);
|
void Show(Point pt, Window &w);
|
||||||
};
|
};
|
||||||
|
|
||||||
class ElapsedTime {
|
|
||||||
long bigBit;
|
|
||||||
long littleBit;
|
|
||||||
public:
|
|
||||||
ElapsedTime();
|
|
||||||
double Duration(bool reset=false);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dynamic Library (DLL/SO/...) loading
|
* Dynamic Library (DLL/SO/...) loading
|
||||||
*/
|
*/
|
||||||
class DynamicLibrary {
|
class DynamicLibrary {
|
||||||
public:
|
public:
|
||||||
virtual ~DynamicLibrary() {}
|
virtual ~DynamicLibrary() = default;
|
||||||
|
|
||||||
/// @return Pointer to function "name", or NULL on failure.
|
/// @return Pointer to function "name", or NULL on failure.
|
||||||
virtual Function FindFunction(const char *name) = 0;
|
virtual Function FindFunction(const char *name) = 0;
|
||||||
@ -469,65 +534,34 @@ public:
|
|||||||
* and chrome colour. Not a creatable object, more of a module with several functions.
|
* and chrome colour. Not a creatable object, more of a module with several functions.
|
||||||
*/
|
*/
|
||||||
class Platform {
|
class Platform {
|
||||||
// Private so Platform objects can not be copied
|
|
||||||
Platform(const Platform &) {}
|
|
||||||
Platform &operator=(const Platform &) { return *this; }
|
|
||||||
public:
|
public:
|
||||||
// Should be private because no new Platforms are ever created
|
Platform() = default;
|
||||||
// but gcc warns about this
|
Platform(const Platform &) = delete;
|
||||||
Platform() {}
|
Platform(Platform &&) = delete;
|
||||||
~Platform() {}
|
Platform &operator=(const Platform &) = delete;
|
||||||
|
Platform &operator=(Platform &&) = delete;
|
||||||
|
~Platform() = default;
|
||||||
static ColourDesired Chrome();
|
static ColourDesired Chrome();
|
||||||
static ColourDesired ChromeHighlight();
|
static ColourDesired ChromeHighlight();
|
||||||
static const char *DefaultFont();
|
static const char *DefaultFont();
|
||||||
static int DefaultFontSize();
|
static int DefaultFontSize();
|
||||||
static unsigned int DoubleClickTime();
|
static unsigned int DoubleClickTime();
|
||||||
static bool MouseButtonBounce();
|
|
||||||
static void DebugDisplay(const char *s);
|
static void DebugDisplay(const char *s);
|
||||||
static bool IsKeyDown(int key);
|
static constexpr long LongFromTwoShorts(short a,short b) noexcept {
|
||||||
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);
|
return (a) | ((b) << 16);
|
||||||
}
|
}
|
||||||
static short HighShortFromLong(long x) {
|
|
||||||
return static_cast<short>(x >> 16);
|
|
||||||
}
|
|
||||||
static short LowShortFromLong(long x) {
|
|
||||||
return static_cast<short>(x & 0xffff);
|
|
||||||
}
|
|
||||||
static void DebugPrintf(const char *format, ...);
|
static void DebugPrintf(const char *format, ...);
|
||||||
static bool ShowAssertionPopUps(bool assertionPopUps_);
|
static bool ShowAssertionPopUps(bool assertionPopUps_);
|
||||||
static void Assert(const char *c, const char *file, int line) CLANG_ANALYZER_NORETURN;
|
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
|
#ifdef NDEBUG
|
||||||
#define PLATFORM_ASSERT(c) ((void)0)
|
#define PLATFORM_ASSERT(c) ((void)0)
|
||||||
#else
|
#else
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
#define PLATFORM_ASSERT(c) ((c) ? (void)(0) : Scintilla::Platform::Assert(#c, __FILE__, __LINE__))
|
#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
|
#endif
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__GNUC__) && defined(SCINTILLA_QT)
|
|
||||||
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -132,10 +132,19 @@
|
|||||||
#define SCLEX_SREC 117
|
#define SCLEX_SREC 117
|
||||||
#define SCLEX_IHEX 118
|
#define SCLEX_IHEX 118
|
||||||
#define SCLEX_TEHEX 119
|
#define SCLEX_TEHEX 119
|
||||||
|
#define SCLEX_JSON 120
|
||||||
|
#define SCLEX_EDIFACT 121
|
||||||
|
#define SCLEX_INDENT 122
|
||||||
|
#define SCLEX_MAXIMA 123
|
||||||
|
#define SCLEX_STATA 124
|
||||||
|
#define SCLEX_SAS 125
|
||||||
|
#define SCLEX_NIM 126
|
||||||
|
#define SCLEX_CIL 127
|
||||||
#define SCLEX_SEARCHRESULT 150
|
#define SCLEX_SEARCHRESULT 150
|
||||||
#define SCLEX_OBJC 151
|
#define SCLEX_OBJC 151
|
||||||
#define SCLEX_USER 152
|
#define SCLEX_USER 152
|
||||||
#define SCLEX_AUTOMATIC 1000
|
#define SCLEX_AUTOMATIC 1000
|
||||||
|
|
||||||
//For All lexer
|
//For All lexer
|
||||||
#define SCE_UNIVERSAL_FOUND_STYLE 31
|
#define SCE_UNIVERSAL_FOUND_STYLE 31
|
||||||
#define SCE_UNIVERSAL_FOUND_STYLE_SMART 29
|
#define SCE_UNIVERSAL_FOUND_STYLE_SMART 29
|
||||||
@ -147,82 +156,6 @@
|
|||||||
#define SCE_UNIVERSAL_FOUND_STYLE_EXT3 23
|
#define SCE_UNIVERSAL_FOUND_STYLE_EXT3 23
|
||||||
#define SCE_UNIVERSAL_FOUND_STYLE_EXT4 22
|
#define SCE_UNIVERSAL_FOUND_STYLE_EXT4 22
|
||||||
#define SCE_UNIVERSAL_FOUND_STYLE_EXT5 21
|
#define SCE_UNIVERSAL_FOUND_STYLE_EXT5 21
|
||||||
#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_SEARCHRESULT_DEFAULT 0
|
|
||||||
#define SCE_SEARCHRESULT_SEARCH_HEADER 1
|
|
||||||
#define SCE_SEARCHRESULT_FILE_HEADER 2
|
|
||||||
#define SCE_SEARCHRESULT_LINE_NUMBER 3
|
|
||||||
#define SCE_SEARCHRESULT_WORD2SEARCH 4
|
|
||||||
#define SCE_SEARCHRESULT_HIGHLIGHT_LINE 5
|
|
||||||
#define SCE_SEARCHRESULT_CURRENT_LINE 6
|
|
||||||
#define SCE_OBJC_DIRECTIVE 20
|
|
||||||
#define SCE_OBJC_QUALIFIER 21
|
|
||||||
|
|
||||||
#define SCE_UDL_VERSION_MAJOR 2
|
#define SCE_UDL_VERSION_MAJOR 2
|
||||||
#define SCE_UDL_VERSION_MINOR 1
|
#define SCE_UDL_VERSION_MINOR 1
|
||||||
@ -321,6 +254,88 @@
|
|||||||
#define SCE_USER_MASK_NESTING_OPERATORS2 0x2000000
|
#define SCE_USER_MASK_NESTING_OPERATORS2 0x2000000
|
||||||
#define SCE_USER_MASK_NESTING_NUMBERS 0x4000000
|
#define SCE_USER_MASK_NESTING_NUMBERS 0x4000000
|
||||||
|
|
||||||
|
#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_P_FSTRING 16
|
||||||
|
#define SCE_P_FCHARACTER 17
|
||||||
|
#define SCE_P_FTRIPLE 18
|
||||||
|
#define SCE_P_FTRIPLEDOUBLE 19
|
||||||
|
#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_SEARCHRESULT_DEFAULT 0
|
||||||
|
#define SCE_SEARCHRESULT_SEARCH_HEADER 1
|
||||||
|
#define SCE_SEARCHRESULT_FILE_HEADER 2
|
||||||
|
#define SCE_SEARCHRESULT_LINE_NUMBER 3
|
||||||
|
#define SCE_SEARCHRESULT_WORD2SEARCH 4
|
||||||
|
#define SCE_SEARCHRESULT_HIGHLIGHT_LINE 5
|
||||||
|
#define SCE_SEARCHRESULT_CURRENT_LINE 6
|
||||||
|
#define SCE_OBJC_DIRECTIVE 20
|
||||||
|
#define SCE_OBJC_QUALIFIER 21
|
||||||
|
|
||||||
#define SCE_TCL_DEFAULT 0
|
#define SCE_TCL_DEFAULT 0
|
||||||
#define SCE_TCL_COMMENT 1
|
#define SCE_TCL_COMMENT 1
|
||||||
#define SCE_TCL_COMMENTLINE 2
|
#define SCE_TCL_COMMENTLINE 2
|
||||||
@ -619,6 +634,24 @@
|
|||||||
#define SCE_ERR_JAVA_STACK 20
|
#define SCE_ERR_JAVA_STACK 20
|
||||||
#define SCE_ERR_VALUE 21
|
#define SCE_ERR_VALUE 21
|
||||||
#define SCE_ERR_GCC_INCLUDED_FROM 22
|
#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_DEFAULT 0
|
||||||
#define SCE_BAT_COMMENT 1
|
#define SCE_BAT_COMMENT 1
|
||||||
#define SCE_BAT_WORD 2
|
#define SCE_BAT_WORD 2
|
||||||
@ -653,6 +686,10 @@
|
|||||||
#define SCE_DIFF_DELETED 5
|
#define SCE_DIFF_DELETED 5
|
||||||
#define SCE_DIFF_ADDED 6
|
#define SCE_DIFF_ADDED 6
|
||||||
#define SCE_DIFF_CHANGED 7
|
#define SCE_DIFF_CHANGED 7
|
||||||
|
#define SCE_DIFF_PATCH_ADD 8
|
||||||
|
#define SCE_DIFF_PATCH_DELETE 9
|
||||||
|
#define SCE_DIFF_REMOVED_PATCH_ADD 10
|
||||||
|
#define SCE_DIFF_REMOVED_PATCH_DELETE 11
|
||||||
#define SCE_CONF_DEFAULT 0
|
#define SCE_CONF_DEFAULT 0
|
||||||
#define SCE_CONF_COMMENT 1
|
#define SCE_CONF_COMMENT 1
|
||||||
#define SCE_CONF_NUMBER 2
|
#define SCE_CONF_NUMBER 2
|
||||||
@ -701,6 +738,20 @@
|
|||||||
#define SCE_BAAN_IDENTIFIER 8
|
#define SCE_BAAN_IDENTIFIER 8
|
||||||
#define SCE_BAAN_STRINGEOL 9
|
#define SCE_BAAN_STRINGEOL 9
|
||||||
#define SCE_BAAN_WORD2 10
|
#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_DEFAULT 0
|
||||||
#define SCE_LISP_COMMENT 1
|
#define SCE_LISP_COMMENT 1
|
||||||
#define SCE_LISP_NUMBER 2
|
#define SCE_LISP_NUMBER 2
|
||||||
@ -754,6 +805,14 @@
|
|||||||
#define SCE_MATLAB_OPERATOR 6
|
#define SCE_MATLAB_OPERATOR 6
|
||||||
#define SCE_MATLAB_IDENTIFIER 7
|
#define SCE_MATLAB_IDENTIFIER 7
|
||||||
#define SCE_MATLAB_DOUBLEQUOTESTRING 8
|
#define SCE_MATLAB_DOUBLEQUOTESTRING 8
|
||||||
|
#define SCE_MAXIMA_OPERATOR 0
|
||||||
|
#define SCE_MAXIMA_COMMANDENDING 1
|
||||||
|
#define SCE_MAXIMA_COMMENT 2
|
||||||
|
#define SCE_MAXIMA_NUMBER 3
|
||||||
|
#define SCE_MAXIMA_STRING 4
|
||||||
|
#define SCE_MAXIMA_COMMAND 5
|
||||||
|
#define SCE_MAXIMA_VARIABLE 6
|
||||||
|
#define SCE_MAXIMA_UNKNOWN 7
|
||||||
#define SCE_SCRIPTOL_DEFAULT 0
|
#define SCE_SCRIPTOL_DEFAULT 0
|
||||||
#define SCE_SCRIPTOL_WHITE 1
|
#define SCE_SCRIPTOL_WHITE 1
|
||||||
#define SCE_SCRIPTOL_COMMENTLINE 2
|
#define SCE_SCRIPTOL_COMMENTLINE 2
|
||||||
@ -1379,38 +1438,19 @@
|
|||||||
#define SCE_PLM_OPERATOR 5
|
#define SCE_PLM_OPERATOR 5
|
||||||
#define SCE_PLM_CONTROL 6
|
#define SCE_PLM_CONTROL 6
|
||||||
#define SCE_PLM_KEYWORD 7
|
#define SCE_PLM_KEYWORD 7
|
||||||
#define SCE_4GL_DEFAULT 0
|
#define SCE_ABL_DEFAULT 0
|
||||||
#define SCE_4GL_NUMBER 1
|
#define SCE_ABL_NUMBER 1
|
||||||
#define SCE_4GL_WORD 2
|
#define SCE_ABL_WORD 2
|
||||||
#define SCE_4GL_STRING 3
|
#define SCE_ABL_STRING 3
|
||||||
#define SCE_4GL_CHARACTER 4
|
#define SCE_ABL_CHARACTER 4
|
||||||
#define SCE_4GL_PREPROCESSOR 5
|
#define SCE_ABL_PREPROCESSOR 5
|
||||||
#define SCE_4GL_OPERATOR 6
|
#define SCE_ABL_OPERATOR 6
|
||||||
#define SCE_4GL_IDENTIFIER 7
|
#define SCE_ABL_IDENTIFIER 7
|
||||||
#define SCE_4GL_BLOCK 8
|
#define SCE_ABL_BLOCK 8
|
||||||
#define SCE_4GL_END 9
|
#define SCE_ABL_END 9
|
||||||
#define SCE_4GL_COMMENT1 10
|
#define SCE_ABL_COMMENT 10
|
||||||
#define SCE_4GL_COMMENT2 11
|
#define SCE_ABL_TASKMARKER 11
|
||||||
#define SCE_4GL_COMMENT3 12
|
#define SCE_ABL_LINECOMMENT 12
|
||||||
#define SCE_4GL_COMMENT4 13
|
|
||||||
#define SCE_4GL_COMMENT5 14
|
|
||||||
#define SCE_4GL_COMMENT6 15
|
|
||||||
#define SCE_4GL_DEFAULT_ 16
|
|
||||||
#define SCE_4GL_NUMBER_ 17
|
|
||||||
#define SCE_4GL_WORD_ 18
|
|
||||||
#define SCE_4GL_STRING_ 19
|
|
||||||
#define SCE_4GL_CHARACTER_ 20
|
|
||||||
#define SCE_4GL_PREPROCESSOR_ 21
|
|
||||||
#define SCE_4GL_OPERATOR_ 22
|
|
||||||
#define SCE_4GL_IDENTIFIER_ 23
|
|
||||||
#define SCE_4GL_BLOCK_ 24
|
|
||||||
#define SCE_4GL_END_ 25
|
|
||||||
#define SCE_4GL_COMMENT1_ 26
|
|
||||||
#define SCE_4GL_COMMENT2_ 27
|
|
||||||
#define SCE_4GL_COMMENT3_ 28
|
|
||||||
#define SCE_4GL_COMMENT4_ 29
|
|
||||||
#define SCE_4GL_COMMENT5_ 30
|
|
||||||
#define SCE_4GL_COMMENT6_ 31
|
|
||||||
#define SCE_ABAQUS_DEFAULT 0
|
#define SCE_ABAQUS_DEFAULT 0
|
||||||
#define SCE_ABAQUS_COMMENT 1
|
#define SCE_ABAQUS_COMMENT 1
|
||||||
#define SCE_ABAQUS_COMMENTBLOCK 2
|
#define SCE_ABAQUS_COMMENTBLOCK 2
|
||||||
@ -1688,6 +1728,7 @@
|
|||||||
#define SCE_COFFEESCRIPT_COMMENTBLOCK 22
|
#define SCE_COFFEESCRIPT_COMMENTBLOCK 22
|
||||||
#define SCE_COFFEESCRIPT_VERBOSE_REGEX 23
|
#define SCE_COFFEESCRIPT_VERBOSE_REGEX 23
|
||||||
#define SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT 24
|
#define SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT 24
|
||||||
|
#define SCE_COFFEESCRIPT_INSTANCEPROPERTY 25
|
||||||
#define SCE_AVS_DEFAULT 0
|
#define SCE_AVS_DEFAULT 0
|
||||||
#define SCE_AVS_COMMENTBLOCK 1
|
#define SCE_AVS_COMMENTBLOCK 1
|
||||||
#define SCE_AVS_COMMENTBLOCKN 2
|
#define SCE_AVS_COMMENTBLOCKN 2
|
||||||
@ -1889,6 +1930,85 @@
|
|||||||
#define SCE_HEX_CHECKSUM 16
|
#define SCE_HEX_CHECKSUM 16
|
||||||
#define SCE_HEX_CHECKSUM_WRONG 17
|
#define SCE_HEX_CHECKSUM_WRONG 17
|
||||||
#define SCE_HEX_GARBAGE 18
|
#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
|
||||||
|
#define SCE_EDI_DEFAULT 0
|
||||||
|
#define SCE_EDI_SEGMENTSTART 1
|
||||||
|
#define SCE_EDI_SEGMENTEND 2
|
||||||
|
#define SCE_EDI_SEP_ELEMENT 3
|
||||||
|
#define SCE_EDI_SEP_COMPOSITE 4
|
||||||
|
#define SCE_EDI_SEP_RELEASE 5
|
||||||
|
#define SCE_EDI_UNA 6
|
||||||
|
#define SCE_EDI_UNH 7
|
||||||
|
#define SCE_EDI_BADSEGMENT 8
|
||||||
|
#define SCE_STATA_DEFAULT 0
|
||||||
|
#define SCE_STATA_COMMENT 1
|
||||||
|
#define SCE_STATA_COMMENTLINE 2
|
||||||
|
#define SCE_STATA_COMMENTBLOCK 3
|
||||||
|
#define SCE_STATA_NUMBER 4
|
||||||
|
#define SCE_STATA_OPERATOR 5
|
||||||
|
#define SCE_STATA_IDENTIFIER 6
|
||||||
|
#define SCE_STATA_STRING 7
|
||||||
|
#define SCE_STATA_TYPE 8
|
||||||
|
#define SCE_STATA_WORD 9
|
||||||
|
#define SCE_STATA_GLOBAL_MACRO 10
|
||||||
|
#define SCE_STATA_MACRO 11
|
||||||
|
#define SCE_SAS_DEFAULT 0
|
||||||
|
#define SCE_SAS_COMMENT 1
|
||||||
|
#define SCE_SAS_COMMENTLINE 2
|
||||||
|
#define SCE_SAS_COMMENTBLOCK 3
|
||||||
|
#define SCE_SAS_NUMBER 4
|
||||||
|
#define SCE_SAS_OPERATOR 5
|
||||||
|
#define SCE_SAS_IDENTIFIER 6
|
||||||
|
#define SCE_SAS_STRING 7
|
||||||
|
#define SCE_SAS_TYPE 8
|
||||||
|
#define SCE_SAS_WORD 9
|
||||||
|
#define SCE_SAS_GLOBAL_MACRO 10
|
||||||
|
#define SCE_SAS_MACRO 11
|
||||||
|
#define SCE_SAS_MACRO_KEYWORD 12
|
||||||
|
#define SCE_SAS_BLOCK_KEYWORD 13
|
||||||
|
#define SCE_SAS_MACRO_FUNCTION 14
|
||||||
|
#define SCE_SAS_STATEMENT 15
|
||||||
|
#define SCE_NIM_DEFAULT 0
|
||||||
|
#define SCE_NIM_COMMENT 1
|
||||||
|
#define SCE_NIM_COMMENTDOC 2
|
||||||
|
#define SCE_NIM_COMMENTLINE 3
|
||||||
|
#define SCE_NIM_COMMENTLINEDOC 4
|
||||||
|
#define SCE_NIM_NUMBER 5
|
||||||
|
#define SCE_NIM_STRING 6
|
||||||
|
#define SCE_NIM_CHARACTER 7
|
||||||
|
#define SCE_NIM_WORD 8
|
||||||
|
#define SCE_NIM_TRIPLE 9
|
||||||
|
#define SCE_NIM_TRIPLEDOUBLE 10
|
||||||
|
#define SCE_NIM_BACKTICKS 11
|
||||||
|
#define SCE_NIM_FUNCNAME 12
|
||||||
|
#define SCE_NIM_STRINGEOL 13
|
||||||
|
#define SCE_NIM_NUMERROR 14
|
||||||
|
#define SCE_NIM_OPERATOR 15
|
||||||
|
#define SCE_NIM_IDENTIFIER 16
|
||||||
|
#define SCE_CIL_DEFAULT 0
|
||||||
|
#define SCE_CIL_COMMENT 1
|
||||||
|
#define SCE_CIL_COMMENTLINE 2
|
||||||
|
#define SCE_CIL_WORD 3
|
||||||
|
#define SCE_CIL_WORD2 4
|
||||||
|
#define SCE_CIL_WORD3 5
|
||||||
|
#define SCE_CIL_STRING 6
|
||||||
|
#define SCE_CIL_LABEL 7
|
||||||
|
#define SCE_CIL_OPERATOR 8
|
||||||
|
#define SCE_CIL_IDENTIFIER 9
|
||||||
|
#define SCE_CIL_STRINGEOL 10
|
||||||
/* --Autogenerated -- end of section automatically generated from Scintilla.iface */
|
/* --Autogenerated -- end of section automatically generated from Scintilla.iface */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
29
scintilla/include/Sci_Position.h
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
// 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 <neilh@scintilla.org>
|
||||||
|
// The License.txt file describes the conditions under which this software may be distributed.
|
||||||
|
|
||||||
|
#ifndef SCI_POSITION_H
|
||||||
|
#define SCI_POSITION_H
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
// Basic signed type used throughout interface
|
||||||
|
typedef ptrdiff_t Sci_Position;
|
||||||
|
|
||||||
|
// Unsigned variant used for ILexer::Lex and ILexer::Fold
|
||||||
|
typedef size_t Sci_PositionU;
|
||||||
|
|
||||||
|
// For Sci_CharacterRange which is defined as long to be compatible with Win32 CHARRANGE
|
||||||
|
typedef long Sci_PositionCR;
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define SCI_METHOD __stdcall
|
||||||
|
#else
|
||||||
|
#define SCI_METHOD
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
@ -26,19 +26,15 @@ int Scintilla_LinkLexers(void);
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Here should be placed typedefs for uptr_t, an unsigned integer type large enough to
|
// Include header that defines basic numeric types.
|
||||||
* hold a pointer and sptr_t, a signed integer large enough to hold a pointer.
|
#include <stdint.h>
|
||||||
* May need to be changed for 64 bit platforms. */
|
|
||||||
#if defined(_WIN32)
|
// Define uptr_t, an unsigned integer type large enough to hold a pointer.
|
||||||
#include <basetsd.h>
|
typedef uintptr_t uptr_t;
|
||||||
#endif
|
// Define sptr_t, a signed integer large enough to hold a pointer.
|
||||||
#ifdef MAXULONG_PTR
|
typedef intptr_t sptr_t;
|
||||||
typedef ULONG_PTR uptr_t;
|
|
||||||
typedef LONG_PTR sptr_t;
|
#include "Sci_Position.h"
|
||||||
#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);
|
typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam);
|
||||||
|
|
||||||
@ -71,8 +67,13 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCWS_INVISIBLE 0
|
#define SCWS_INVISIBLE 0
|
||||||
#define SCWS_VISIBLEALWAYS 1
|
#define SCWS_VISIBLEALWAYS 1
|
||||||
#define SCWS_VISIBLEAFTERINDENT 2
|
#define SCWS_VISIBLEAFTERINDENT 2
|
||||||
|
#define SCWS_VISIBLEONLYININDENT 3
|
||||||
#define SCI_GETVIEWWS 2020
|
#define SCI_GETVIEWWS 2020
|
||||||
#define SCI_SETVIEWWS 2021
|
#define SCI_SETVIEWWS 2021
|
||||||
|
#define SCTD_LONGARROW 0
|
||||||
|
#define SCTD_STRIKEOUT 1
|
||||||
|
#define SCI_GETTABDRAWMODE 2698
|
||||||
|
#define SCI_SETTABDRAWMODE 2699
|
||||||
#define SCI_POSITIONFROMPOINT 2022
|
#define SCI_POSITIONFROMPOINT 2022
|
||||||
#define SCI_POSITIONFROMPOINTCLOSE 2023
|
#define SCI_POSITIONFROMPOINTCLOSE 2023
|
||||||
#define SCI_GOTOLINE 2024
|
#define SCI_GOTOLINE 2024
|
||||||
@ -164,6 +165,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SC_MARGIN_FORE 3
|
#define SC_MARGIN_FORE 3
|
||||||
#define SC_MARGIN_TEXT 4
|
#define SC_MARGIN_TEXT 4
|
||||||
#define SC_MARGIN_RTEXT 5
|
#define SC_MARGIN_RTEXT 5
|
||||||
|
#define SC_MARGIN_COLOUR 6
|
||||||
#define SCI_SETMARGINTYPEN 2240
|
#define SCI_SETMARGINTYPEN 2240
|
||||||
#define SCI_GETMARGINTYPEN 2241
|
#define SCI_GETMARGINTYPEN 2241
|
||||||
#define SCI_SETMARGINWIDTHN 2242
|
#define SCI_SETMARGINWIDTHN 2242
|
||||||
@ -174,6 +176,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCI_GETMARGINSENSITIVEN 2247
|
#define SCI_GETMARGINSENSITIVEN 2247
|
||||||
#define SCI_SETMARGINCURSORN 2248
|
#define SCI_SETMARGINCURSORN 2248
|
||||||
#define SCI_GETMARGINCURSORN 2249
|
#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_DEFAULT 32
|
||||||
#define STYLE_LINENUMBER 33
|
#define STYLE_LINENUMBER 33
|
||||||
#define STYLE_BRACELIGHT 34
|
#define STYLE_BRACELIGHT 34
|
||||||
@ -181,6 +187,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define STYLE_CONTROLCHAR 36
|
#define STYLE_CONTROLCHAR 36
|
||||||
#define STYLE_INDENTGUIDE 37
|
#define STYLE_INDENTGUIDE 37
|
||||||
#define STYLE_CALLTIP 38
|
#define STYLE_CALLTIP 38
|
||||||
|
#define STYLE_FOLDDISPLAYTEXT 39
|
||||||
#define STYLE_LASTPREDEFINED 39
|
#define STYLE_LASTPREDEFINED 39
|
||||||
#define STYLE_MAX 255
|
#define STYLE_MAX 255
|
||||||
#define SC_CHARSET_ANSI 0
|
#define SC_CHARSET_ANSI 0
|
||||||
@ -194,6 +201,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SC_CHARSET_MAC 77
|
#define SC_CHARSET_MAC 77
|
||||||
#define SC_CHARSET_OEM 255
|
#define SC_CHARSET_OEM 255
|
||||||
#define SC_CHARSET_RUSSIAN 204
|
#define SC_CHARSET_RUSSIAN 204
|
||||||
|
#define SC_CHARSET_OEM866 866
|
||||||
#define SC_CHARSET_CYRILLIC 1251
|
#define SC_CHARSET_CYRILLIC 1251
|
||||||
#define SC_CHARSET_SHIFTJIS 128
|
#define SC_CHARSET_SHIFTJIS 128
|
||||||
#define SC_CHARSET_SYMBOL 2
|
#define SC_CHARSET_SYMBOL 2
|
||||||
@ -217,6 +225,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SC_CASE_MIXED 0
|
#define SC_CASE_MIXED 0
|
||||||
#define SC_CASE_UPPER 1
|
#define SC_CASE_UPPER 1
|
||||||
#define SC_CASE_LOWER 2
|
#define SC_CASE_LOWER 2
|
||||||
|
#define SC_CASE_CAMEL 3
|
||||||
#define SCI_STYLEGETFORE 2481
|
#define SCI_STYLEGETFORE 2481
|
||||||
#define SCI_STYLEGETBACK 2482
|
#define SCI_STYLEGETBACK 2482
|
||||||
#define SCI_STYLEGETBOLD 2483
|
#define SCI_STYLEGETBOLD 2483
|
||||||
@ -277,6 +286,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define INDIC_COMPOSITIONTHIN 15
|
#define INDIC_COMPOSITIONTHIN 15
|
||||||
#define INDIC_FULLBOX 16
|
#define INDIC_FULLBOX 16
|
||||||
#define INDIC_TEXTFORE 17
|
#define INDIC_TEXTFORE 17
|
||||||
|
#define INDIC_POINT 18
|
||||||
|
#define INDIC_POINTCHARACTER 19
|
||||||
|
#define INDIC_GRADIENT 20
|
||||||
|
#define INDIC_GRADIENTCENTRE 21
|
||||||
#define INDIC_IME 32
|
#define INDIC_IME 32
|
||||||
#define INDIC_IME_MAX 35
|
#define INDIC_IME_MAX 35
|
||||||
#define INDIC_MAX 35
|
#define INDIC_MAX 35
|
||||||
@ -304,8 +317,6 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCI_SETWHITESPACEBACK 2085
|
#define SCI_SETWHITESPACEBACK 2085
|
||||||
#define SCI_SETWHITESPACESIZE 2086
|
#define SCI_SETWHITESPACESIZE 2086
|
||||||
#define SCI_GETWHITESPACESIZE 2087
|
#define SCI_GETWHITESPACESIZE 2087
|
||||||
#define SCI_SETSTYLEBITS 2090
|
|
||||||
#define SCI_GETSTYLEBITS 2091
|
|
||||||
#define SCI_SETLINESTATE 2092
|
#define SCI_SETLINESTATE 2092
|
||||||
#define SCI_GETLINESTATE 2093
|
#define SCI_GETLINESTATE 2093
|
||||||
#define SCI_GETMAXLINESTATE 2094
|
#define SCI_GETMAXLINESTATE 2094
|
||||||
@ -313,6 +324,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCI_SETCARETLINEVISIBLE 2096
|
#define SCI_SETCARETLINEVISIBLE 2096
|
||||||
#define SCI_GETCARETLINEBACK 2097
|
#define SCI_GETCARETLINEBACK 2097
|
||||||
#define SCI_SETCARETLINEBACK 2098
|
#define SCI_SETCARETLINEBACK 2098
|
||||||
|
#define SCI_GETCARETLINEFRAME 2704
|
||||||
|
#define SCI_SETCARETLINEFRAME 2705
|
||||||
#define SCI_STYLESETCHANGEABLE 2099
|
#define SCI_STYLESETCHANGEABLE 2099
|
||||||
#define SCI_AUTOCSHOW 2100
|
#define SCI_AUTOCSHOW 2100
|
||||||
#define SCI_AUTOCCANCEL 2101
|
#define SCI_AUTOCCANCEL 2101
|
||||||
@ -352,6 +365,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCI_GETLINEINDENTPOSITION 2128
|
#define SCI_GETLINEINDENTPOSITION 2128
|
||||||
#define SCI_GETCOLUMN 2129
|
#define SCI_GETCOLUMN 2129
|
||||||
#define SCI_COUNTCHARACTERS 2633
|
#define SCI_COUNTCHARACTERS 2633
|
||||||
|
#define SCI_COUNTCODEUNITS 2715
|
||||||
#define SCI_SETHSCROLLBAR 2130
|
#define SCI_SETHSCROLLBAR 2130
|
||||||
#define SCI_GETHSCROLLBAR 2131
|
#define SCI_GETHSCROLLBAR 2131
|
||||||
#define SC_IV_NONE 0
|
#define SC_IV_NONE 0
|
||||||
@ -379,6 +393,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SC_PRINT_BLACKONWHITE 2
|
#define SC_PRINT_BLACKONWHITE 2
|
||||||
#define SC_PRINT_COLOURONWHITE 3
|
#define SC_PRINT_COLOURONWHITE 3
|
||||||
#define SC_PRINT_COLOURONWHITEDEFAULTBG 4
|
#define SC_PRINT_COLOURONWHITEDEFAULTBG 4
|
||||||
|
#define SC_PRINT_SCREENCOLOURS 5
|
||||||
#define SCI_SETPRINTCOLOURMODE 2148
|
#define SCI_SETPRINTCOLOURMODE 2148
|
||||||
#define SCI_GETPRINTCOLOURMODE 2149
|
#define SCI_GETPRINTCOLOURMODE 2149
|
||||||
#define SCFIND_WHOLEWORD 0x2
|
#define SCFIND_WHOLEWORD 0x2
|
||||||
@ -434,6 +449,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCI_GETTARGETEND 2193
|
#define SCI_GETTARGETEND 2193
|
||||||
#define SCI_SETTARGETRANGE 2686
|
#define SCI_SETTARGETRANGE 2686
|
||||||
#define SCI_GETTARGETTEXT 2687
|
#define SCI_GETTARGETTEXT 2687
|
||||||
|
#define SCI_TARGETFROMSELECTION 2287
|
||||||
|
#define SCI_TARGETWHOLEDOCUMENT 2690
|
||||||
#define SCI_REPLACETARGET 2194
|
#define SCI_REPLACETARGET 2194
|
||||||
#define SCI_REPLACETARGETRE 2195
|
#define SCI_REPLACETARGETRE 2195
|
||||||
#define SCI_SEARCHINTARGET 2197
|
#define SCI_SEARCHINTARGET 2197
|
||||||
@ -468,6 +485,11 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCI_SETFOLDEXPANDED 2229
|
#define SCI_SETFOLDEXPANDED 2229
|
||||||
#define SCI_GETFOLDEXPANDED 2230
|
#define SCI_GETFOLDEXPANDED 2230
|
||||||
#define SCI_TOGGLEFOLD 2231
|
#define SCI_TOGGLEFOLD 2231
|
||||||
|
#define SCI_TOGGLEFOLDSHOWTEXT 2700
|
||||||
|
#define SC_FOLDDISPLAYTEXT_HIDDEN 0
|
||||||
|
#define SC_FOLDDISPLAYTEXT_STANDARD 1
|
||||||
|
#define SC_FOLDDISPLAYTEXT_BOXED 2
|
||||||
|
#define SCI_FOLDDISPLAYTEXTSETSTYLE 2701
|
||||||
#define SC_FOLDACTION_CONTRACT 0
|
#define SC_FOLDACTION_CONTRACT 0
|
||||||
#define SC_FOLDACTION_EXPAND 1
|
#define SC_FOLDACTION_EXPAND 1
|
||||||
#define SC_FOLDACTION_TOGGLE 2
|
#define SC_FOLDACTION_TOGGLE 2
|
||||||
@ -498,6 +520,13 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCI_GETMOUSEDWELLTIME 2265
|
#define SCI_GETMOUSEDWELLTIME 2265
|
||||||
#define SCI_WORDSTARTPOSITION 2266
|
#define SCI_WORDSTARTPOSITION 2266
|
||||||
#define SCI_WORDENDPOSITION 2267
|
#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_NONE 0
|
||||||
#define SC_WRAP_WORD 1
|
#define SC_WRAP_WORD 1
|
||||||
#define SC_WRAP_CHAR 2
|
#define SC_WRAP_CHAR 2
|
||||||
@ -520,6 +549,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SC_WRAPINDENT_FIXED 0
|
#define SC_WRAPINDENT_FIXED 0
|
||||||
#define SC_WRAPINDENT_SAME 1
|
#define SC_WRAPINDENT_SAME 1
|
||||||
#define SC_WRAPINDENT_INDENT 2
|
#define SC_WRAPINDENT_INDENT 2
|
||||||
|
#define SC_WRAPINDENT_DEEPINDENT 3
|
||||||
#define SCI_SETWRAPINDENTMODE 2472
|
#define SCI_SETWRAPINDENTMODE 2472
|
||||||
#define SCI_GETWRAPINDENTMODE 2473
|
#define SCI_GETWRAPINDENTMODE 2473
|
||||||
#define SC_CACHE_NONE 0
|
#define SC_CACHE_NONE 0
|
||||||
@ -539,8 +569,6 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCI_SETVSCROLLBAR 2280
|
#define SCI_SETVSCROLLBAR 2280
|
||||||
#define SCI_GETVSCROLLBAR 2281
|
#define SCI_GETVSCROLLBAR 2281
|
||||||
#define SCI_APPENDTEXT 2282
|
#define SCI_APPENDTEXT 2282
|
||||||
#define SCI_GETTWOPHASEDRAW 2283
|
|
||||||
#define SCI_SETTWOPHASEDRAW 2284
|
|
||||||
#define SC_PHASES_ONE 0
|
#define SC_PHASES_ONE 0
|
||||||
#define SC_PHASES_TWO 1
|
#define SC_PHASES_TWO 1
|
||||||
#define SC_PHASES_MULTIPLE 2
|
#define SC_PHASES_MULTIPLE 2
|
||||||
@ -559,11 +587,14 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCI_SETMULTIPASTE 2614
|
#define SCI_SETMULTIPASTE 2614
|
||||||
#define SCI_GETMULTIPASTE 2615
|
#define SCI_GETMULTIPASTE 2615
|
||||||
#define SCI_GETTAG 2616
|
#define SCI_GETTAG 2616
|
||||||
#define SCI_TARGETFROMSELECTION 2287
|
|
||||||
#define SCI_LINESJOIN 2288
|
#define SCI_LINESJOIN 2288
|
||||||
#define SCI_LINESSPLIT 2289
|
#define SCI_LINESSPLIT 2289
|
||||||
#define SCI_SETFOLDMARGINCOLOUR 2290
|
#define SCI_SETFOLDMARGINCOLOUR 2290
|
||||||
#define SCI_SETFOLDMARGINHICOLOUR 2291
|
#define SCI_SETFOLDMARGINHICOLOUR 2291
|
||||||
|
#define SC_ACCESSIBILITY_DISABLED 0
|
||||||
|
#define SC_ACCESSIBILITY_ENABLED 1
|
||||||
|
#define SCI_SETACCESSIBILITY 2702
|
||||||
|
#define SCI_GETACCESSIBILITY 2703
|
||||||
#define SCI_LINEDOWN 2300
|
#define SCI_LINEDOWN 2300
|
||||||
#define SCI_LINEDOWNEXTEND 2301
|
#define SCI_LINEDOWNEXTEND 2301
|
||||||
#define SCI_LINEUP 2302
|
#define SCI_LINEUP 2302
|
||||||
@ -605,6 +636,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCI_LINECUT 2337
|
#define SCI_LINECUT 2337
|
||||||
#define SCI_LINEDELETE 2338
|
#define SCI_LINEDELETE 2338
|
||||||
#define SCI_LINETRANSPOSE 2339
|
#define SCI_LINETRANSPOSE 2339
|
||||||
|
#define SCI_LINEREVERSE 2354
|
||||||
#define SCI_LINEDUPLICATE 2404
|
#define SCI_LINEDUPLICATE 2404
|
||||||
#define SCI_LOWERCASE 2340
|
#define SCI_LOWERCASE 2340
|
||||||
#define SCI_UPPERCASE 2341
|
#define SCI_UPPERCASE 2341
|
||||||
@ -637,24 +669,36 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define EDGE_NONE 0
|
#define EDGE_NONE 0
|
||||||
#define EDGE_LINE 1
|
#define EDGE_LINE 1
|
||||||
#define EDGE_BACKGROUND 2
|
#define EDGE_BACKGROUND 2
|
||||||
|
#define EDGE_MULTILINE 3
|
||||||
#define SCI_GETEDGECOLUMN 2360
|
#define SCI_GETEDGECOLUMN 2360
|
||||||
#define SCI_SETEDGECOLUMN 2361
|
#define SCI_SETEDGECOLUMN 2361
|
||||||
#define SCI_GETEDGEMODE 2362
|
#define SCI_GETEDGEMODE 2362
|
||||||
#define SCI_SETEDGEMODE 2363
|
#define SCI_SETEDGEMODE 2363
|
||||||
#define SCI_GETEDGECOLOUR 2364
|
#define SCI_GETEDGECOLOUR 2364
|
||||||
#define SCI_SETEDGECOLOUR 2365
|
#define SCI_SETEDGECOLOUR 2365
|
||||||
|
#define SCI_MULTIEDGEADDLINE 2694
|
||||||
|
#define SCI_MULTIEDGECLEARALL 2695
|
||||||
#define SCI_SEARCHANCHOR 2366
|
#define SCI_SEARCHANCHOR 2366
|
||||||
#define SCI_SEARCHNEXT 2367
|
#define SCI_SEARCHNEXT 2367
|
||||||
#define SCI_SEARCHPREV 2368
|
#define SCI_SEARCHPREV 2368
|
||||||
#define SCI_LINESONSCREEN 2370
|
#define SCI_LINESONSCREEN 2370
|
||||||
|
#define SC_POPUP_NEVER 0
|
||||||
|
#define SC_POPUP_ALL 1
|
||||||
|
#define SC_POPUP_TEXT 2
|
||||||
#define SCI_USEPOPUP 2371
|
#define SCI_USEPOPUP 2371
|
||||||
#define SCI_SELECTIONISRECTANGLE 2372
|
#define SCI_SELECTIONISRECTANGLE 2372
|
||||||
#define SCI_SETZOOM 2373
|
#define SCI_SETZOOM 2373
|
||||||
#define SCI_GETZOOM 2374
|
#define SCI_GETZOOM 2374
|
||||||
|
#define SC_DOCUMENTOPTION_DEFAULT 0
|
||||||
|
#define SC_DOCUMENTOPTION_STYLES_NONE 0x1
|
||||||
|
#define SC_DOCUMENTOPTION_TEXT_LARGE 0x100
|
||||||
#define SCI_CREATEDOCUMENT 2375
|
#define SCI_CREATEDOCUMENT 2375
|
||||||
#define SCI_ADDREFDOCUMENT 2376
|
#define SCI_ADDREFDOCUMENT 2376
|
||||||
#define SCI_RELEASEDOCUMENT 2377
|
#define SCI_RELEASEDOCUMENT 2377
|
||||||
|
#define SCI_GETDOCUMENTOPTIONS 2379
|
||||||
#define SCI_GETMODEVENTMASK 2378
|
#define SCI_GETMODEVENTMASK 2378
|
||||||
|
#define SCI_SETCOMMANDEVENTS 2717
|
||||||
|
#define SCI_GETCOMMANDEVENTS 2718
|
||||||
#define SCI_SETFOCUS 2380
|
#define SCI_SETFOCUS 2380
|
||||||
#define SCI_GETFOCUS 2381
|
#define SCI_GETFOCUS 2381
|
||||||
#define SC_STATUS_OK 0
|
#define SC_STATUS_OK 0
|
||||||
@ -666,6 +710,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCI_GETSTATUS 2383
|
#define SCI_GETSTATUS 2383
|
||||||
#define SCI_SETMOUSEDOWNCAPTURES 2384
|
#define SCI_SETMOUSEDOWNCAPTURES 2384
|
||||||
#define SCI_GETMOUSEDOWNCAPTURES 2385
|
#define SCI_GETMOUSEDOWNCAPTURES 2385
|
||||||
|
#define SCI_SETMOUSEWHEELCAPTURES 2696
|
||||||
|
#define SCI_GETMOUSEWHEELCAPTURES 2697
|
||||||
#define SC_CURSORNORMAL -1
|
#define SC_CURSORNORMAL -1
|
||||||
#define SC_CURSORARROW 2
|
#define SC_CURSORARROW 2
|
||||||
#define SC_CURSORWAIT 4
|
#define SC_CURSORWAIT 4
|
||||||
@ -710,6 +756,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCI_POSITIONBEFORE 2417
|
#define SCI_POSITIONBEFORE 2417
|
||||||
#define SCI_POSITIONAFTER 2418
|
#define SCI_POSITIONAFTER 2418
|
||||||
#define SCI_POSITIONRELATIVE 2670
|
#define SCI_POSITIONRELATIVE 2670
|
||||||
|
#define SCI_POSITIONRELATIVECODEUNITS 2716
|
||||||
#define SCI_COPYRANGE 2419
|
#define SCI_COPYRANGE 2419
|
||||||
#define SCI_COPYTEXT 2420
|
#define SCI_COPYTEXT 2420
|
||||||
#define SC_SEL_STREAM 0
|
#define SC_SEL_STREAM 0
|
||||||
@ -718,6 +765,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SC_SEL_THIN 3
|
#define SC_SEL_THIN 3
|
||||||
#define SCI_SETSELECTIONMODE 2422
|
#define SCI_SETSELECTIONMODE 2422
|
||||||
#define SCI_GETSELECTIONMODE 2423
|
#define SCI_GETSELECTIONMODE 2423
|
||||||
|
#define SCI_GETMOVEEXTENDSSELECTION 2706
|
||||||
#define SCI_GETLINESELSTARTPOSITION 2424
|
#define SCI_GETLINESELSTARTPOSITION 2424
|
||||||
#define SCI_GETLINESELENDPOSITION 2425
|
#define SCI_GETLINESELENDPOSITION 2425
|
||||||
#define SCI_LINEDOWNRECTEXTEND 2426
|
#define SCI_LINEDOWNRECTEXTEND 2426
|
||||||
@ -779,6 +827,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define CARETSTYLE_INVISIBLE 0
|
#define CARETSTYLE_INVISIBLE 0
|
||||||
#define CARETSTYLE_LINE 1
|
#define CARETSTYLE_LINE 1
|
||||||
#define CARETSTYLE_BLOCK 2
|
#define CARETSTYLE_BLOCK 2
|
||||||
|
#define CARETSTYLE_OVERSTRIKE_BAR 0
|
||||||
|
#define CARETSTYLE_OVERSTRIKE_BLOCK 16
|
||||||
#define SCI_SETCARETSTYLE 2512
|
#define SCI_SETCARETSTYLE 2512
|
||||||
#define SCI_GETCARETSTYLE 2513
|
#define SCI_GETCARETSTYLE 2513
|
||||||
#define SCI_SETINDICATORCURRENT 2500
|
#define SCI_SETINDICATORCURRENT 2500
|
||||||
@ -882,6 +932,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCVS_NONE 0
|
#define SCVS_NONE 0
|
||||||
#define SCVS_RECTANGULARSELECTION 1
|
#define SCVS_RECTANGULARSELECTION 1
|
||||||
#define SCVS_USERACCESSIBLE 2
|
#define SCVS_USERACCESSIBLE 2
|
||||||
|
#define SCVS_NOWRAPLINESTART 4
|
||||||
#define SCI_SETVIRTUALSPACEOPTIONS 2596
|
#define SCI_SETVIRTUALSPACEOPTIONS 2596
|
||||||
#define SCI_GETVIRTUALSPACEOPTIONS 2597
|
#define SCI_GETVIRTUALSPACEOPTIONS 2597
|
||||||
#define SCI_SETRECTANGULARSELECTIONMODIFIER 2598
|
#define SCI_SETRECTANGULARSELECTIONMODIFIER 2598
|
||||||
@ -894,6 +945,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCI_GETADDITIONALCARETFORE 2605
|
#define SCI_GETADDITIONALCARETFORE 2605
|
||||||
#define SCI_ROTATESELECTION 2606
|
#define SCI_ROTATESELECTION 2606
|
||||||
#define SCI_SWAPMAINANCHORCARET 2607
|
#define SCI_SWAPMAINANCHORCARET 2607
|
||||||
|
#define SCI_MULTIPLESELECTADDNEXT 2688
|
||||||
|
#define SCI_MULTIPLESELECTADDEACH 2689
|
||||||
#define SCI_CHANGELEXERSTATE 2617
|
#define SCI_CHANGELEXERSTATE 2617
|
||||||
#define SCI_CONTRACTEDFOLDNEXT 2618
|
#define SCI_CONTRACTEDFOLDNEXT 2618
|
||||||
#define SCI_VERTICALCENTRECARET 2619
|
#define SCI_VERTICALCENTRECARET 2619
|
||||||
@ -944,7 +997,6 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCI_GETPROPERTY 4008
|
#define SCI_GETPROPERTY 4008
|
||||||
#define SCI_GETPROPERTYEXPANDED 4009
|
#define SCI_GETPROPERTYEXPANDED 4009
|
||||||
#define SCI_GETPROPERTYINT 4010
|
#define SCI_GETPROPERTYINT 4010
|
||||||
#define SCI_GETSTYLEBITSNEEDED 4011
|
|
||||||
#define SCI_GETLEXERLANGUAGE 4012
|
#define SCI_GETLEXERLANGUAGE 4012
|
||||||
#define SCI_PRIVATELEXERCALL 4013
|
#define SCI_PRIVATELEXERCALL 4013
|
||||||
#define SCI_PROPERTYNAMES 4014
|
#define SCI_PROPERTYNAMES 4014
|
||||||
@ -964,6 +1016,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCI_SETIDENTIFIERS 4024
|
#define SCI_SETIDENTIFIERS 4024
|
||||||
#define SCI_DISTANCETOSECONDARYSTYLES 4025
|
#define SCI_DISTANCETOSECONDARYSTYLES 4025
|
||||||
#define SCI_GETSUBSTYLEBASES 4026
|
#define SCI_GETSUBSTYLEBASES 4026
|
||||||
|
#define SCI_GETNAMEDSTYLES 4029
|
||||||
|
#define SCI_NAMEOFSTYLE 4030
|
||||||
|
#define SCI_TAGSOFSTYLE 4031
|
||||||
|
#define SCI_DESCRIPTIONOFSTYLE 4032
|
||||||
#define SC_MOD_INSERTTEXT 0x1
|
#define SC_MOD_INSERTTEXT 0x1
|
||||||
#define SC_MOD_DELETETEXT 0x2
|
#define SC_MOD_DELETETEXT 0x2
|
||||||
#define SC_MOD_CHANGESTYLE 0x4
|
#define SC_MOD_CHANGESTYLE 0x4
|
||||||
@ -1021,6 +1077,11 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCMOD_ALT 4
|
#define SCMOD_ALT 4
|
||||||
#define SCMOD_SUPER 8
|
#define SCMOD_SUPER 8
|
||||||
#define SCMOD_META 16
|
#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_STYLENEEDED 2000
|
||||||
#define SCN_CHARADDED 2001
|
#define SCN_CHARADDED 2001
|
||||||
#define SCN_SAVEPOINTREACHED 2002
|
#define SCN_SAVEPOINTREACHED 2002
|
||||||
@ -1050,21 +1111,37 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCN_HOTSPOTRELEASECLICK 2027
|
#define SCN_HOTSPOTRELEASECLICK 2027
|
||||||
#define SCN_FOCUSIN 2028
|
#define SCN_FOCUSIN 2028
|
||||||
#define SCN_FOCUSOUT 2029
|
#define SCN_FOCUSOUT 2029
|
||||||
|
#define SCN_AUTOCCOMPLETED 2030
|
||||||
|
#define SCN_MARGINRIGHTCLICK 2031
|
||||||
|
#define SCN_AUTOCSELECTIONCHANGE 2032
|
||||||
|
#ifndef SCI_DISABLE_PROVISIONAL
|
||||||
|
#define SC_BIDIRECTIONAL_DISABLED 0
|
||||||
|
#define SC_BIDIRECTIONAL_L2R 1
|
||||||
|
#define SC_BIDIRECTIONAL_R2L 2
|
||||||
|
#define SCI_GETBIDIRECTIONAL 2708
|
||||||
|
#define SCI_SETBIDIRECTIONAL 2709
|
||||||
|
#define SC_LINECHARACTERINDEX_NONE 0
|
||||||
|
#define SC_LINECHARACTERINDEX_UTF32 1
|
||||||
|
#define SC_LINECHARACTERINDEX_UTF16 2
|
||||||
|
#define SCI_GETLINECHARACTERINDEX 2710
|
||||||
|
#define SCI_ALLOCATELINECHARACTERINDEX 2711
|
||||||
|
#define SCI_RELEASELINECHARACTERINDEX 2712
|
||||||
|
#define SCI_LINEFROMINDEXPOSITION 2713
|
||||||
|
#define SCI_INDEXPOSITIONFROMLINE 2714
|
||||||
|
#endif
|
||||||
|
|
||||||
#define SCN_SCROLLED 2080
|
#define SCN_SCROLLED 2080
|
||||||
#define SCN_FOLDINGSTATECHANGED 2081
|
#define SCN_FOLDINGSTATECHANGED 2081
|
||||||
|
|
||||||
/* --Autogenerated -- end of section automatically generated from Scintilla.iface */
|
/* --Autogenerated -- end of section automatically generated from Scintilla.iface */
|
||||||
|
|
||||||
/* These structures are defined to be exactly the same shape as the Win32
|
/* These structures are defined to be exactly the same shape as the Win32
|
||||||
* CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs.
|
* CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs.
|
||||||
* So older code that treats Scintilla as a RichEdit will work. */
|
* So older code that treats Scintilla as a RichEdit will work. */
|
||||||
|
|
||||||
#if defined(__cplusplus) && defined(SCI_NAMESPACE)
|
|
||||||
namespace Scintilla {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct Sci_CharacterRange {
|
struct Sci_CharacterRange {
|
||||||
long cpMin;
|
Sci_PositionCR cpMin;
|
||||||
long cpMax;
|
Sci_PositionCR cpMax;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Sci_TextRange {
|
struct Sci_TextRange {
|
||||||
@ -1078,10 +1155,6 @@ struct Sci_TextToFind {
|
|||||||
struct Sci_CharacterRange chrgText;
|
struct Sci_CharacterRange chrgText;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define CharacterRange Sci_CharacterRange
|
|
||||||
#define TextRange Sci_TextRange
|
|
||||||
#define TextToFind Sci_TextToFind
|
|
||||||
|
|
||||||
typedef void *Sci_SurfaceID;
|
typedef void *Sci_SurfaceID;
|
||||||
|
|
||||||
struct Sci_Rectangle {
|
struct Sci_Rectangle {
|
||||||
@ -1102,7 +1175,12 @@ struct Sci_RangeToFormat {
|
|||||||
struct Sci_CharacterRange chrg;
|
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 {
|
struct Sci_NotifyHeader {
|
||||||
/* Compatible with Windows NMHDR.
|
/* Compatible with Windows NMHDR.
|
||||||
@ -1113,18 +1191,18 @@ struct Sci_NotifyHeader {
|
|||||||
unsigned int code;
|
unsigned int code;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NotifyHeader Sci_NotifyHeader
|
|
||||||
|
|
||||||
struct SCNotification {
|
struct SCNotification {
|
||||||
struct Sci_NotifyHeader nmhdr;
|
Sci_NotifyHeader nmhdr;
|
||||||
int position;
|
Sci_Position position;
|
||||||
/* SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_MARGINCLICK, */
|
/* SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_MARGINCLICK, */
|
||||||
/* SCN_NEEDSHOWN, SCN_DWELLSTART, SCN_DWELLEND, SCN_CALLTIPCLICK, */
|
/* SCN_NEEDSHOWN, SCN_DWELLSTART, SCN_DWELLEND, SCN_CALLTIPCLICK, */
|
||||||
/* SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, SCN_HOTSPOTRELEASECLICK, */
|
/* SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, SCN_HOTSPOTRELEASECLICK, */
|
||||||
/* SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */
|
/* SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */
|
||||||
/* SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */
|
/* SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */
|
||||||
|
|
||||||
int ch; /* SCN_CHARADDED, SCN_KEY */
|
int ch;
|
||||||
|
/* SCN_CHARADDED, SCN_KEY, SCN_AUTOCCOMPLETED, SCN_AUTOCSELECTION, */
|
||||||
|
/* SCN_USERLISTSELECTION */
|
||||||
int modifiers;
|
int modifiers;
|
||||||
/* SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, */
|
/* SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, */
|
||||||
/* SCN_HOTSPOTRELEASECLICK, SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */
|
/* SCN_HOTSPOTRELEASECLICK, SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */
|
||||||
@ -1133,12 +1211,12 @@ struct SCNotification {
|
|||||||
const char *text;
|
const char *text;
|
||||||
/* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_URIDROPPED */
|
/* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_URIDROPPED */
|
||||||
|
|
||||||
int length; /* SCN_MODIFIED */
|
Sci_Position length; /* SCN_MODIFIED */
|
||||||
int linesAdded; /* SCN_MODIFIED */
|
Sci_Position linesAdded; /* SCN_MODIFIED */
|
||||||
int message; /* SCN_MACRORECORD */
|
int message; /* SCN_MACRORECORD */
|
||||||
uptr_t wParam; /* SCN_MACRORECORD */
|
uptr_t wParam; /* SCN_MACRORECORD */
|
||||||
sptr_t lParam; /* SCN_MACRORECORD */
|
sptr_t lParam; /* SCN_MACRORECORD */
|
||||||
int line; /* SCN_MODIFIED */
|
Sci_Position line; /* SCN_MODIFIED */
|
||||||
int foldLevelNow; /* SCN_MODIFIED */
|
int foldLevelNow; /* SCN_MODIFIED */
|
||||||
int foldLevelPrev; /* SCN_MODIFIED */
|
int foldLevelPrev; /* SCN_MODIFIED */
|
||||||
int margin; /* SCN_MARGINCLICK */
|
int margin; /* SCN_MARGINCLICK */
|
||||||
@ -1146,8 +1224,10 @@ struct SCNotification {
|
|||||||
int x; /* SCN_DWELLSTART, SCN_DWELLEND */
|
int x; /* SCN_DWELLSTART, SCN_DWELLEND */
|
||||||
int y; /* SCN_DWELLSTART, SCN_DWELLEND */
|
int y; /* SCN_DWELLSTART, SCN_DWELLEND */
|
||||||
int token; /* SCN_MODIFIED with SC_MOD_CONTAINER */
|
int token; /* SCN_MODIFIED with SC_MOD_CONTAINER */
|
||||||
int annotationLinesAdded; /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */
|
Sci_Position annotationLinesAdded; /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */
|
||||||
int updated; /* SCN_UPDATEUI */
|
int updated; /* SCN_UPDATEUI */
|
||||||
|
int listCompletionMethod;
|
||||||
|
/* SCN_AUTOCSELECTION, SCN_AUTOCCOMPLETED, SCN_USERLISTSELECTION, */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SearchResultMarking {
|
struct SearchResultMarking {
|
||||||
@ -1160,18 +1240,24 @@ struct SearchResultMarkings {
|
|||||||
SearchResultMarking *_markings;
|
SearchResultMarking *_markings;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(__cplusplus) && defined(SCI_NAMESPACE)
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef INCLUDE_DEPRECATED_FEATURES
|
#ifdef INCLUDE_DEPRECATED_FEATURES
|
||||||
|
|
||||||
#define SC_CP_DBCS 1
|
|
||||||
#define SCI_SETUSEPALETTE 2039
|
|
||||||
#define SCI_GETUSEPALETTE 2139
|
|
||||||
#define SCI_SETKEYSUNICODE 2521
|
#define SCI_SETKEYSUNICODE 2521
|
||||||
#define SCI_GETKEYSUNICODE 2522
|
#define SCI_GETKEYSUNICODE 2522
|
||||||
|
|
||||||
|
#define SCI_GETTWOPHASEDRAW 2283
|
||||||
|
#define SCI_SETTWOPHASEDRAW 2284
|
||||||
|
|
||||||
|
#define CharacterRange Sci_CharacterRange
|
||||||
|
#define TextRange Sci_TextRange
|
||||||
|
#define TextToFind Sci_TextToFind
|
||||||
|
#define RangeToFormat Sci_RangeToFormat
|
||||||
|
#define NotifyHeader Sci_NotifyHeader
|
||||||
|
|
||||||
|
#define SCI_SETSTYLEBITS 2090
|
||||||
|
#define SCI_GETSTYLEBITS 2091
|
||||||
|
#define SCI_GETSTYLEBITSNEEDED 4011
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
/* Scintilla source code edit control */
|
/* Scintilla source code edit control */
|
||||||
/** @file ScintillaWidget.h
|
/* @file ScintillaWidget.h
|
||||||
** Definition of Scintilla widget for GTK+.
|
* Definition of Scintilla widget for GTK+.
|
||||||
** Only needed by GTK+ code but is harmless on other platforms.
|
* 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 <neilh@scintilla.org>
|
/* Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
|
||||||
* The License.txt file describes the conditions under which this software may be distributed. */
|
* The License.txt file describes the conditions under which this software may be distributed. */
|
||||||
|
|
||||||
@ -19,8 +20,15 @@ extern "C" {
|
|||||||
#define SCINTILLA_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, scintilla_get_type (), ScintillaClass)
|
#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 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 _ScintillaObject ScintillaObject;
|
||||||
typedef struct _ScintillaClass ScintillaClass;
|
typedef struct _ScintillaClass ScintillaObjectClass;
|
||||||
|
|
||||||
struct _ScintillaObject {
|
struct _ScintillaObject {
|
||||||
GtkContainer cont;
|
GtkContainer cont;
|
||||||
@ -30,15 +38,28 @@ struct _ScintillaObject {
|
|||||||
struct _ScintillaClass {
|
struct _ScintillaClass {
|
||||||
GtkContainerClass parent_class;
|
GtkContainerClass parent_class;
|
||||||
|
|
||||||
void (* command) (ScintillaObject *ttt);
|
void (* command) (ScintillaObject *sci, int cmd, GtkWidget *window);
|
||||||
void (* notify) (ScintillaObject *ttt);
|
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);
|
GType scintilla_get_type (void);
|
||||||
GtkWidget* scintilla_new (void);
|
GtkWidget* scintilla_new (void);
|
||||||
void scintilla_set_id (ScintillaObject *sci, uptr_t id);
|
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);
|
sptr_t scintilla_send_message (ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam);
|
||||||
void scintilla_release_resources(void);
|
void scintilla_release_resources(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
#define SCINTILLA_NOTIFY "sci-notify"
|
#define SCINTILLA_NOTIFY "sci-notify"
|
||||||
|
|
||||||
|
@ -26,9 +26,7 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// Return values for GetOperatorType
|
// Return values for GetOperatorType
|
||||||
@ -115,7 +113,7 @@ static inline bool IsDoxygenChar (const int ch)
|
|||||||
* Main function, which colourises a 68k source
|
* Main function, which colourises a 68k source
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void ColouriseA68kDoc (unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler)
|
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
|
// Used to buffer a string, to be able to compare it using built-in functions
|
||||||
char Buffer[100];
|
char Buffer[100];
|
||||||
|
@ -24,9 +24,7 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline bool IsAWordChar(const int ch) {
|
static inline bool IsAWordChar(const int ch) {
|
||||||
return (ch < 0x80 && (isalnum(ch) || ch == '_'));
|
return (ch < 0x80 && (isalnum(ch) || ch == '_'));
|
||||||
@ -43,7 +41,7 @@ static inline bool IsAnOperator(char ch) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ColouriseAPDLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
|
static void ColouriseAPDLDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[],
|
||||||
Accessor &styler) {
|
Accessor &styler) {
|
||||||
|
|
||||||
int stringStart = ' ';
|
int stringStart = ' ';
|
||||||
@ -184,16 +182,16 @@ static int CheckAPDLFoldPoint(char const *token, int &level) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FoldAPDLDoc(unsigned int startPos, int length, int,
|
static void FoldAPDLDoc(Sci_PositionU startPos, Sci_Position length, int,
|
||||||
WordList *[], Accessor &styler) {
|
WordList *[], Accessor &styler) {
|
||||||
|
|
||||||
int line = styler.GetLine(startPos);
|
Sci_Position line = styler.GetLine(startPos);
|
||||||
int level = styler.LevelAt(line);
|
int level = styler.LevelAt(line);
|
||||||
int go = 0, done = 0;
|
int go = 0, done = 0;
|
||||||
int endPos = startPos + length;
|
Sci_Position endPos = startPos + length;
|
||||||
char word[256];
|
char word[256];
|
||||||
int wordlen = 0;
|
int wordlen = 0;
|
||||||
int i;
|
Sci_Position i;
|
||||||
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
||||||
// Scan for tokens at the start of the line (they may include
|
// Scan for tokens at the start of the line (they may include
|
||||||
// whitespace, for tokens like "End Function"
|
// whitespace, for tokens like "End Function"
|
||||||
|
@ -19,11 +19,9 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
static void ColouriseAsyDoc(unsigned int startPos, int length, int initStyle,
|
static void ColouriseAsyDoc(Sci_PositionU startPos, Sci_Position length, int initStyle,
|
||||||
WordList *keywordlists[], Accessor &styler) {
|
WordList *keywordlists[], Accessor &styler) {
|
||||||
|
|
||||||
WordList &keywords = *keywordlists[0];
|
WordList &keywords = *keywordlists[0];
|
||||||
@ -152,7 +150,7 @@ static inline bool isASYidentifier(int ch) {
|
|||||||
((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z')) ;
|
((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z')) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ParseASYWord(unsigned int pos, Accessor &styler, char *word)
|
static int ParseASYWord(Sci_PositionU pos, Accessor &styler, char *word)
|
||||||
{
|
{
|
||||||
int length=0;
|
int length=0;
|
||||||
char ch=styler.SafeGetCharAt(pos);
|
char ch=styler.SafeGetCharAt(pos);
|
||||||
@ -167,11 +165,11 @@ static int ParseASYWord(unsigned int pos, Accessor &styler, char *word)
|
|||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool IsASYDrawingLine(int line, Accessor &styler) {
|
static bool IsASYDrawingLine(Sci_Position line, Accessor &styler) {
|
||||||
int pos = styler.LineStart(line);
|
Sci_Position pos = styler.LineStart(line);
|
||||||
int eol_pos = styler.LineStart(line + 1) - 1;
|
Sci_Position eol_pos = styler.LineStart(line + 1) - 1;
|
||||||
|
|
||||||
int startpos = pos;
|
Sci_Position startpos = pos;
|
||||||
char buffer[100]="";
|
char buffer[100]="";
|
||||||
|
|
||||||
while (startpos<eol_pos){
|
while (startpos<eol_pos){
|
||||||
@ -186,14 +184,14 @@ static bool IsASYDrawingLine(int line, Accessor &styler) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FoldAsyDoc(unsigned int startPos, int length, int initStyle,
|
static void FoldAsyDoc(Sci_PositionU startPos, Sci_Position length, int initStyle,
|
||||||
WordList *[], Accessor &styler) {
|
WordList *[], Accessor &styler) {
|
||||||
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
|
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
|
||||||
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
||||||
bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) != 0;
|
bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) != 0;
|
||||||
unsigned int endPos = startPos + length;
|
Sci_PositionU endPos = startPos + length;
|
||||||
int visibleChars = 0;
|
int visibleChars = 0;
|
||||||
int lineCurrent = styler.GetLine(startPos);
|
Sci_Position lineCurrent = styler.GetLine(startPos);
|
||||||
int levelCurrent = SC_FOLDLEVELBASE;
|
int levelCurrent = SC_FOLDLEVELBASE;
|
||||||
if (lineCurrent > 0)
|
if (lineCurrent > 0)
|
||||||
levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
|
levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
|
||||||
@ -202,7 +200,7 @@ static void FoldAsyDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
char chNext = styler[startPos];
|
char chNext = styler[startPos];
|
||||||
int styleNext = styler.StyleAt(startPos);
|
int styleNext = styler.StyleAt(startPos);
|
||||||
int style = initStyle;
|
int style = initStyle;
|
||||||
for (unsigned int i = startPos; i < endPos; i++) {
|
for (Sci_PositionU i = startPos; i < endPos; i++) {
|
||||||
char ch = chNext;
|
char ch = chNext;
|
||||||
chNext = styler.SafeGetCharAt(i + 1);
|
chNext = styler.SafeGetCharAt(i + 1);
|
||||||
int stylePrev = style;
|
int stylePrev = style;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Scintilla source code edit control
|
// Scintilla source code edit control
|
||||||
// @file LexAU3.cxx
|
// @file LexAU3.cxx
|
||||||
// Lexer for AutoIt3 http://www.hiddensoft.com/autoit3
|
// Lexer for AutoIt3 https://www.autoitscript.com/site/
|
||||||
// by Jos van der Zande, jvdzande@yahoo.com
|
// by Jos van der Zande, jvdzande@yahoo.com
|
||||||
//
|
//
|
||||||
// Changes:
|
// Changes:
|
||||||
@ -68,9 +68,7 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline bool IsTypeCharacter(const int ch)
|
static inline bool IsTypeCharacter(const int ch)
|
||||||
{
|
{
|
||||||
@ -170,10 +168,10 @@ static int GetSendKey(const char *szLine, char *szKey)
|
|||||||
//
|
//
|
||||||
// Routine to check the last "none comment" character on a line to see if its a continuation
|
// Routine to check the last "none comment" character on a line to see if its a continuation
|
||||||
//
|
//
|
||||||
static bool IsContinuationLine(unsigned int szLine, Accessor &styler)
|
static bool IsContinuationLine(Sci_PositionU szLine, Accessor &styler)
|
||||||
{
|
{
|
||||||
int nsPos = styler.LineStart(szLine);
|
Sci_Position nsPos = styler.LineStart(szLine);
|
||||||
int nePos = styler.LineStart(szLine+1) - 2;
|
Sci_Position nePos = styler.LineStart(szLine+1) - 2;
|
||||||
//int stylech = styler.StyleAt(nsPos);
|
//int stylech = styler.StyleAt(nsPos);
|
||||||
while (nsPos < nePos)
|
while (nsPos < nePos)
|
||||||
{
|
{
|
||||||
@ -195,8 +193,8 @@ static bool IsContinuationLine(unsigned int szLine, Accessor &styler)
|
|||||||
|
|
||||||
//
|
//
|
||||||
// syntax highlighting logic
|
// syntax highlighting logic
|
||||||
static void ColouriseAU3Doc(unsigned int startPos,
|
static void ColouriseAU3Doc(Sci_PositionU startPos,
|
||||||
int length, int initStyle,
|
Sci_Position length, int initStyle,
|
||||||
WordList *keywordlists[],
|
WordList *keywordlists[],
|
||||||
Accessor &styler) {
|
Accessor &styler) {
|
||||||
|
|
||||||
@ -209,8 +207,8 @@ static void ColouriseAU3Doc(unsigned int startPos,
|
|||||||
WordList &keywords7 = *keywordlists[6];
|
WordList &keywords7 = *keywordlists[6];
|
||||||
WordList &keywords8 = *keywordlists[7];
|
WordList &keywords8 = *keywordlists[7];
|
||||||
// find the first previous line without continuation character at the end
|
// find the first previous line without continuation character at the end
|
||||||
int lineCurrent = styler.GetLine(startPos);
|
Sci_Position lineCurrent = styler.GetLine(startPos);
|
||||||
int s_startPos = startPos;
|
Sci_Position s_startPos = startPos;
|
||||||
// When not inside a Block comment: find First line without _
|
// When not inside a Block comment: find First line without _
|
||||||
if (!(initStyle==SCE_AU3_COMMENTBLOCK)) {
|
if (!(initStyle==SCE_AU3_COMMENTBLOCK)) {
|
||||||
while ((lineCurrent > 0 && IsContinuationLine(lineCurrent,styler)) ||
|
while ((lineCurrent > 0 && IsContinuationLine(lineCurrent,styler)) ||
|
||||||
@ -447,7 +445,7 @@ static void ColouriseAU3Doc(unsigned int startPos,
|
|||||||
{
|
{
|
||||||
si=0;
|
si=0;
|
||||||
// at line end and not found a continuation char then reset to default
|
// at line end and not found a continuation char then reset to default
|
||||||
int lineCurrent = styler.GetLine(sc.currentPos);
|
Sci_Position lineCurrent = styler.GetLine(sc.currentPos);
|
||||||
if (!IsContinuationLine(lineCurrent,styler))
|
if (!IsContinuationLine(lineCurrent,styler))
|
||||||
{
|
{
|
||||||
sc.SetState(SCE_AU3_DEFAULT);
|
sc.SetState(SCE_AU3_DEFAULT);
|
||||||
@ -492,7 +490,7 @@ static void ColouriseAU3Doc(unsigned int startPos,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// check if the start is a valid SendKey start
|
// check if the start is a valid SendKey start
|
||||||
int nPos = 0;
|
Sci_Position nPos = 0;
|
||||||
int nState = 1;
|
int nState = 1;
|
||||||
char cTemp;
|
char cTemp;
|
||||||
while (!(nState == 2) && ((cTemp = s[nPos]) != '\0'))
|
while (!(nState == 2) && ((cTemp = s[nPos]) != '\0'))
|
||||||
@ -659,10 +657,10 @@ static bool IsStreamCommentStyle(int style) {
|
|||||||
//
|
//
|
||||||
// Routine to find first none space on the current line and return its Style
|
// Routine to find first none space on the current line and return its Style
|
||||||
// needed for comment lines not starting on pos 1
|
// needed for comment lines not starting on pos 1
|
||||||
static int GetStyleFirstWord(unsigned int szLine, Accessor &styler)
|
static int GetStyleFirstWord(Sci_PositionU szLine, Accessor &styler)
|
||||||
{
|
{
|
||||||
int nsPos = styler.LineStart(szLine);
|
Sci_Position nsPos = styler.LineStart(szLine);
|
||||||
int nePos = styler.LineStart(szLine+1) - 1;
|
Sci_Position nePos = styler.LineStart(szLine+1) - 1;
|
||||||
while (isspacechar(styler.SafeGetCharAt(nsPos)) && nsPos < nePos)
|
while (isspacechar(styler.SafeGetCharAt(nsPos)) && nsPos < nePos)
|
||||||
{
|
{
|
||||||
nsPos++; // skip to next char
|
nsPos++; // skip to next char
|
||||||
@ -674,16 +672,16 @@ static int GetStyleFirstWord(unsigned int szLine, Accessor &styler)
|
|||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
static void FoldAU3Doc(unsigned int startPos, int length, int, WordList *[], Accessor &styler)
|
static void FoldAU3Doc(Sci_PositionU startPos, Sci_Position length, int, WordList *[], Accessor &styler)
|
||||||
{
|
{
|
||||||
int endPos = startPos + length;
|
Sci_Position endPos = startPos + length;
|
||||||
// get settings from the config files for folding comments and preprocessor lines
|
// get settings from the config files for folding comments and preprocessor lines
|
||||||
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
|
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
|
||||||
bool foldInComment = styler.GetPropertyInt("fold.comment") == 2;
|
bool foldInComment = styler.GetPropertyInt("fold.comment") == 2;
|
||||||
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
||||||
bool foldpreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0;
|
bool foldpreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0;
|
||||||
// Backtrack to previous line in case need to fix its fold status
|
// Backtrack to previous line in case need to fix its fold status
|
||||||
int lineCurrent = styler.GetLine(startPos);
|
Sci_Position lineCurrent = styler.GetLine(startPos);
|
||||||
if (startPos > 0) {
|
if (startPos > 0) {
|
||||||
if (lineCurrent > 0) {
|
if (lineCurrent > 0) {
|
||||||
lineCurrent--;
|
lineCurrent--;
|
||||||
@ -720,7 +718,7 @@ static void FoldAU3Doc(unsigned int startPos, int length, int, WordList *[], Acc
|
|||||||
char chNext = styler.SafeGetCharAt(startPos);
|
char chNext = styler.SafeGetCharAt(startPos);
|
||||||
char chPrev = ' ';
|
char chPrev = ' ';
|
||||||
//
|
//
|
||||||
for (int i = startPos; i < endPos; i++) {
|
for (Sci_Position i = startPos; i < endPos; i++) {
|
||||||
char ch = chNext;
|
char ch = chNext;
|
||||||
chNext = styler.SafeGetCharAt(i + 1);
|
chNext = styler.SafeGetCharAt(i + 1);
|
||||||
if (IsAWordChar(ch)) {
|
if (IsAWordChar(ch)) {
|
||||||
|
@ -25,9 +25,7 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static inline bool IsAWordChar(const int ch) {
|
static inline bool IsAWordChar(const int ch) {
|
||||||
@ -59,8 +57,8 @@ inline bool isAveOperator(char ch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void ColouriseAveDoc(
|
static void ColouriseAveDoc(
|
||||||
unsigned int startPos,
|
Sci_PositionU startPos,
|
||||||
int length,
|
Sci_Position length,
|
||||||
int initStyle,
|
int initStyle,
|
||||||
WordList *keywordlists[],
|
WordList *keywordlists[],
|
||||||
Accessor &styler) {
|
Accessor &styler) {
|
||||||
@ -82,7 +80,7 @@ static void ColouriseAveDoc(
|
|||||||
for (; sc.More(); sc.Forward()) {
|
for (; sc.More(); sc.Forward()) {
|
||||||
if (sc.atLineEnd) {
|
if (sc.atLineEnd) {
|
||||||
// Update the line state, so it can be seen by next line
|
// Update the line state, so it can be seen by next line
|
||||||
int currentLine = styler.GetLine(sc.currentPos);
|
Sci_Position currentLine = styler.GetLine(sc.currentPos);
|
||||||
styler.SetLineState(currentLine, 0);
|
styler.SetLineState(currentLine, 0);
|
||||||
}
|
}
|
||||||
if (sc.atLineStart && (sc.state == SCE_AVE_STRING)) {
|
if (sc.atLineStart && (sc.state == SCE_AVE_STRING)) {
|
||||||
@ -157,11 +155,11 @@ static void ColouriseAveDoc(
|
|||||||
sc.Complete();
|
sc.Complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FoldAveDoc(unsigned int startPos, int length, int /* initStyle */, WordList *[],
|
static void FoldAveDoc(Sci_PositionU startPos, Sci_Position length, int /* initStyle */, WordList *[],
|
||||||
Accessor &styler) {
|
Accessor &styler) {
|
||||||
unsigned int lengthDoc = startPos + length;
|
Sci_PositionU lengthDoc = startPos + length;
|
||||||
int visibleChars = 0;
|
int visibleChars = 0;
|
||||||
int lineCurrent = styler.GetLine(startPos);
|
Sci_Position lineCurrent = styler.GetLine(startPos);
|
||||||
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
|
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
|
||||||
int levelCurrent = levelPrev;
|
int levelCurrent = levelPrev;
|
||||||
char chNext = static_cast<char>(tolower(styler[startPos]));
|
char chNext = static_cast<char>(tolower(styler[startPos]));
|
||||||
@ -169,7 +167,7 @@ static void FoldAveDoc(unsigned int startPos, int length, int /* initStyle */, W
|
|||||||
int styleNext = styler.StyleAt(startPos);
|
int styleNext = styler.StyleAt(startPos);
|
||||||
char s[10] = "";
|
char s[10] = "";
|
||||||
|
|
||||||
for (unsigned int i = startPos; i < lengthDoc; i++) {
|
for (Sci_PositionU i = startPos; i < lengthDoc; i++) {
|
||||||
char ch = static_cast<char>(tolower(chNext));
|
char ch = static_cast<char>(tolower(chNext));
|
||||||
chNext = static_cast<char>(tolower(styler.SafeGetCharAt(i + 1)));
|
chNext = static_cast<char>(tolower(styler.SafeGetCharAt(i + 1)));
|
||||||
int style = styleNext;
|
int style = styleNext;
|
||||||
|
@ -24,9 +24,7 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline bool IsAWordChar(const int ch) {
|
static inline bool IsAWordChar(const int ch) {
|
||||||
return (ch < 0x80) && (isalnum(ch) || ch == '_');
|
return (ch < 0x80) && (isalnum(ch) || ch == '_');
|
||||||
@ -44,8 +42,8 @@ static inline bool IsANumberChar(int ch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void ColouriseAvsDoc(
|
static void ColouriseAvsDoc(
|
||||||
unsigned int startPos,
|
Sci_PositionU startPos,
|
||||||
int length,
|
Sci_Position length,
|
||||||
int initStyle,
|
int initStyle,
|
||||||
WordList *keywordlists[],
|
WordList *keywordlists[],
|
||||||
Accessor &styler) {
|
Accessor &styler) {
|
||||||
@ -57,7 +55,7 @@ static void ColouriseAvsDoc(
|
|||||||
WordList &clipProperties = *keywordlists[4];
|
WordList &clipProperties = *keywordlists[4];
|
||||||
WordList &userDefined = *keywordlists[5];
|
WordList &userDefined = *keywordlists[5];
|
||||||
|
|
||||||
int currentLine = styler.GetLine(startPos);
|
Sci_Position currentLine = styler.GetLine(startPos);
|
||||||
// Initialize the block comment nesting level, if we are inside such a comment.
|
// Initialize the block comment nesting level, if we are inside such a comment.
|
||||||
int blockCommentLevel = 0;
|
int blockCommentLevel = 0;
|
||||||
if (initStyle == SCE_AVS_COMMENTBLOCK || initStyle == SCE_AVS_COMMENTBLOCKN) {
|
if (initStyle == SCE_AVS_COMMENTBLOCK || initStyle == SCE_AVS_COMMENTBLOCKN) {
|
||||||
@ -208,24 +206,24 @@ static void ColouriseAvsDoc(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void FoldAvsDoc(
|
static void FoldAvsDoc(
|
||||||
unsigned int startPos,
|
Sci_PositionU startPos,
|
||||||
int length,
|
Sci_Position length,
|
||||||
int initStyle,
|
int initStyle,
|
||||||
WordList *[],
|
WordList *[],
|
||||||
Accessor &styler) {
|
Accessor &styler) {
|
||||||
|
|
||||||
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
|
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
|
||||||
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
||||||
unsigned int endPos = startPos + length;
|
Sci_PositionU endPos = startPos + length;
|
||||||
int visibleChars = 0;
|
int visibleChars = 0;
|
||||||
int lineCurrent = styler.GetLine(startPos);
|
Sci_Position lineCurrent = styler.GetLine(startPos);
|
||||||
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
|
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
|
||||||
int levelCurrent = levelPrev;
|
int levelCurrent = levelPrev;
|
||||||
char chNext = styler[startPos];
|
char chNext = styler[startPos];
|
||||||
int styleNext = styler.StyleAt(startPos);
|
int styleNext = styler.StyleAt(startPos);
|
||||||
int style = initStyle;
|
int style = initStyle;
|
||||||
|
|
||||||
for (unsigned int i = startPos; i < endPos; i++) {
|
for (Sci_PositionU i = startPos; i < endPos; i++) {
|
||||||
char ch = chNext;
|
char ch = chNext;
|
||||||
chNext = styler.SafeGetCharAt(i + 1);
|
chNext = styler.SafeGetCharAt(i + 1);
|
||||||
int stylePrev = style;
|
int stylePrev = style;
|
||||||
|
@ -26,9 +26,7 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline bool IsAKeywordChar(const int ch) {
|
static inline bool IsAKeywordChar(const int ch) {
|
||||||
return (ch < 0x80 && (isalnum(ch) || (ch == '_') || (ch == ' ')));
|
return (ch < 0x80 && (isalnum(ch) || (ch == '_') || (ch == ' ')));
|
||||||
@ -38,7 +36,7 @@ static inline bool IsASetChar(const int ch) {
|
|||||||
return (ch < 0x80 && (isalnum(ch) || (ch == '_') || (ch == '.') || (ch == '-')));
|
return (ch < 0x80 && (isalnum(ch) || (ch == '_') || (ch == '.') || (ch == '-')));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ColouriseABAQUSDoc(unsigned int startPos, int length, int initStyle, WordList*[] /* *keywordlists[] */,
|
static void ColouriseABAQUSDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList*[] /* *keywordlists[] */,
|
||||||
Accessor &styler) {
|
Accessor &styler) {
|
||||||
enum localState { KW_LINE_KW, KW_LINE_COMMA, KW_LINE_PAR, KW_LINE_EQ, KW_LINE_VAL, \
|
enum localState { KW_LINE_KW, KW_LINE_COMMA, KW_LINE_PAR, KW_LINE_EQ, KW_LINE_VAL, \
|
||||||
DAT_LINE_VAL, DAT_LINE_COMMA,\
|
DAT_LINE_VAL, DAT_LINE_COMMA,\
|
||||||
@ -301,10 +299,10 @@ static int LowerCase(int c)
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int LineEnd(int line, Accessor &styler)
|
static Sci_Position LineEnd(Sci_Position line, Accessor &styler)
|
||||||
{
|
{
|
||||||
const int docLines = styler.GetLine(styler.Length() - 1); // Available last line
|
const Sci_Position docLines = styler.GetLine(styler.Length() - 1); // Available last line
|
||||||
int eol_pos ;
|
Sci_Position eol_pos ;
|
||||||
// if the line is the last line, the eol_pos is styler.Length()
|
// if the line is the last line, the eol_pos is styler.Length()
|
||||||
// eol will contain a new line, or a virtual new line
|
// eol will contain a new line, or a virtual new line
|
||||||
if ( docLines == line )
|
if ( docLines == line )
|
||||||
@ -314,7 +312,7 @@ static int LineEnd(int line, Accessor &styler)
|
|||||||
return eol_pos ;
|
return eol_pos ;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int LineStart(int line, Accessor &styler)
|
static Sci_Position LineStart(Sci_Position line, Accessor &styler)
|
||||||
{
|
{
|
||||||
return styler.LineStart(line) ;
|
return styler.LineStart(line) ;
|
||||||
}
|
}
|
||||||
@ -330,14 +328,14 @@ static int LineStart(int line, Accessor &styler)
|
|||||||
// 6 : block close keyword line
|
// 6 : block close keyword line
|
||||||
// 7 : keyword line in error
|
// 7 : keyword line in error
|
||||||
// 8 : comment line
|
// 8 : comment line
|
||||||
static int LineType(int line, Accessor &styler) {
|
static int LineType(Sci_Position line, Accessor &styler) {
|
||||||
int pos = LineStart(line, styler) ;
|
Sci_Position pos = LineStart(line, styler) ;
|
||||||
int eol_pos = LineEnd(line, styler) ;
|
Sci_Position eol_pos = LineEnd(line, styler) ;
|
||||||
|
|
||||||
int c ;
|
int c ;
|
||||||
char ch = ' ';
|
char ch = ' ';
|
||||||
|
|
||||||
int i = pos ;
|
Sci_Position i = pos ;
|
||||||
while ( i < eol_pos ) {
|
while ( i < eol_pos ) {
|
||||||
c = styler.SafeGetCharAt(i);
|
c = styler.SafeGetCharAt(i);
|
||||||
ch = static_cast<char>(LowerCase(c));
|
ch = static_cast<char>(LowerCase(c));
|
||||||
@ -418,7 +416,7 @@ static int LineType(int line, Accessor &styler) {
|
|||||||
return 4 ;
|
return 4 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SafeSetLevel(int line, int level, Accessor &styler)
|
static void SafeSetLevel(Sci_Position line, int level, Accessor &styler)
|
||||||
{
|
{
|
||||||
if ( line < 0 )
|
if ( line < 0 )
|
||||||
return ;
|
return ;
|
||||||
@ -432,20 +430,20 @@ static void SafeSetLevel(int line, int level, Accessor &styler)
|
|||||||
styler.SetLevel(line, level) ;
|
styler.SetLevel(line, level) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FoldABAQUSDoc(unsigned int startPos, int length, int,
|
static void FoldABAQUSDoc(Sci_PositionU startPos, Sci_Position length, int,
|
||||||
WordList *[], Accessor &styler) {
|
WordList *[], Accessor &styler) {
|
||||||
int startLine = styler.GetLine(startPos) ;
|
Sci_Position startLine = styler.GetLine(startPos) ;
|
||||||
int endLine = styler.GetLine(startPos+length-1) ;
|
Sci_Position endLine = styler.GetLine(startPos+length-1) ;
|
||||||
|
|
||||||
// bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
// bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
||||||
// We want to deal with all the cases
|
// We want to deal with all the cases
|
||||||
// To know the correct indentlevel, we need to look back to the
|
// To know the correct indentlevel, we need to look back to the
|
||||||
// previous command line indentation level
|
// previous command line indentation level
|
||||||
// order of formatting keyline datalines commentlines
|
// order of formatting keyline datalines commentlines
|
||||||
int beginData = -1 ;
|
Sci_Position beginData = -1 ;
|
||||||
int beginComment = -1 ;
|
Sci_Position beginComment = -1 ;
|
||||||
int prvKeyLine = startLine ;
|
Sci_Position prvKeyLine = startLine ;
|
||||||
int prvKeyLineTp = 0 ;
|
Sci_Position prvKeyLineTp = 0 ;
|
||||||
|
|
||||||
// Scan until we find the previous keyword line
|
// Scan until we find the previous keyword line
|
||||||
// this will give us the level reference that we need
|
// this will give us the level reference that we need
|
||||||
@ -467,7 +465,7 @@ WordList *[], Accessor &styler) {
|
|||||||
prvKeyLine = -1 ;
|
prvKeyLine = -1 ;
|
||||||
|
|
||||||
// Now start scanning over the lines.
|
// Now start scanning over the lines.
|
||||||
for ( int line = startLine; line <= endLine; line++ ) {
|
for ( Sci_Position line = startLine; line <= endLine; line++ ) {
|
||||||
int lineType = LineType(line, styler) ;
|
int lineType = LineType(line, styler) ;
|
||||||
|
|
||||||
// Check for comment line
|
// Check for comment line
|
||||||
@ -516,7 +514,7 @@ WordList *[], Accessor &styler) {
|
|||||||
datLevel = level ;
|
datLevel = level ;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( int ll = beginData; ll < beginComment; ll++ )
|
for ( Sci_Position ll = beginData; ll < beginComment; ll++ )
|
||||||
SafeSetLevel(ll, datLevel, styler) ;
|
SafeSetLevel(ll, datLevel, styler) ;
|
||||||
|
|
||||||
// The keyword we just found is going to be written at another level
|
// The keyword we just found is going to be written at another level
|
||||||
@ -532,7 +530,7 @@ WordList *[], Accessor &styler) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( int lll = beginComment; lll < line; lll++ )
|
for ( Sci_Position lll = beginComment; lll < line; lll++ )
|
||||||
SafeSetLevel(lll, level, styler) ;
|
SafeSetLevel(lll, level, styler) ;
|
||||||
|
|
||||||
// wrap and reset
|
// wrap and reset
|
||||||
@ -549,10 +547,10 @@ WordList *[], Accessor &styler) {
|
|||||||
} else {
|
} else {
|
||||||
// We need to find out whether this comment block is followed by
|
// We need to find out whether this comment block is followed by
|
||||||
// a data line or a keyword line
|
// a data line or a keyword line
|
||||||
const int docLines = styler.GetLine(styler.Length() - 1);
|
const Sci_Position docLines = styler.GetLine(styler.Length() - 1);
|
||||||
|
|
||||||
for ( int line = endLine + 1; line <= docLines; line++ ) {
|
for ( Sci_Position line = endLine + 1; line <= docLines; line++ ) {
|
||||||
int lineType = LineType(line, styler) ;
|
Sci_Position lineType = LineType(line, styler) ;
|
||||||
|
|
||||||
if ( lineType != 8 ) {
|
if ( lineType != 8 ) {
|
||||||
if ( !(lineType & 4) ) {
|
if ( !(lineType & 4) ) {
|
||||||
@ -578,7 +576,7 @@ WordList *[], Accessor &styler) {
|
|||||||
datLevel = level ;
|
datLevel = level ;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( int ll = beginData; ll < beginComment; ll++ )
|
for ( Sci_Position ll = beginData; ll < beginComment; ll++ )
|
||||||
SafeSetLevel(ll, datLevel, styler) ;
|
SafeSetLevel(ll, datLevel, styler) ;
|
||||||
|
|
||||||
if ( prvKeyLineTp == 5 ) {
|
if ( prvKeyLineTp == 5 ) {
|
||||||
@ -588,7 +586,7 @@ WordList *[], Accessor &styler) {
|
|||||||
if ( prvKeyLineTp == 6 ) {
|
if ( prvKeyLineTp == 6 ) {
|
||||||
level -= 1 ;
|
level -= 1 ;
|
||||||
}
|
}
|
||||||
for ( int m = beginComment; m <= endLine; m++ )
|
for ( Sci_Position m = beginComment; m <= endLine; m++ )
|
||||||
SafeSetLevel(m, level, styler) ;
|
SafeSetLevel(m, level, styler) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,17 +25,15 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Interface
|
* Interface
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void ColouriseDocument(
|
static void ColouriseDocument(
|
||||||
unsigned int startPos,
|
Sci_PositionU startPos,
|
||||||
int length,
|
Sci_Position length,
|
||||||
int initStyle,
|
int initStyle,
|
||||||
WordList *keywordlists[],
|
WordList *keywordlists[],
|
||||||
Accessor &styler);
|
Accessor &styler);
|
||||||
@ -222,8 +220,8 @@ static void ColouriseWord(StyleContext& sc, WordList& keywords, bool& apostrophe
|
|||||||
//
|
//
|
||||||
|
|
||||||
static void ColouriseDocument(
|
static void ColouriseDocument(
|
||||||
unsigned int startPos,
|
Sci_PositionU startPos,
|
||||||
int length,
|
Sci_Position length,
|
||||||
int initStyle,
|
int initStyle,
|
||||||
WordList *keywordlists[],
|
WordList *keywordlists[],
|
||||||
Accessor &styler) {
|
Accessor &styler) {
|
||||||
@ -231,7 +229,7 @@ static void ColouriseDocument(
|
|||||||
|
|
||||||
StyleContext sc(startPos, length, initStyle, styler);
|
StyleContext sc(startPos, length, initStyle, styler);
|
||||||
|
|
||||||
int lineCurrent = styler.GetLine(startPos);
|
Sci_Position lineCurrent = styler.GetLine(startPos);
|
||||||
bool apostropheStartsAttribute = (styler.GetLineState(lineCurrent) & 1) != 0;
|
bool apostropheStartsAttribute = (styler.GetLineState(lineCurrent) & 1) != 0;
|
||||||
|
|
||||||
while (sc.More()) {
|
while (sc.More()) {
|
||||||
|
@ -30,10 +30,9 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
#include "OptionSet.h"
|
#include "OptionSet.h"
|
||||||
|
#include "DefaultLexer.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline bool IsAWordChar(const int ch) {
|
static inline bool IsAWordChar(const int ch) {
|
||||||
return (ch < 0x80) && (isalnum(ch) || ch == '.' ||
|
return (ch < 0x80) && (isalnum(ch) || ch == '.' ||
|
||||||
@ -139,7 +138,7 @@ struct OptionSetAsm : public OptionSet<OptionsAsm> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class LexerAsm : public ILexer {
|
class LexerAsm : public DefaultLexer {
|
||||||
WordList cpuInstruction;
|
WordList cpuInstruction;
|
||||||
WordList mathInstruction;
|
WordList mathInstruction;
|
||||||
WordList registers;
|
WordList registers;
|
||||||
@ -157,50 +156,50 @@ public:
|
|||||||
}
|
}
|
||||||
virtual ~LexerAsm() {
|
virtual ~LexerAsm() {
|
||||||
}
|
}
|
||||||
void SCI_METHOD Release() {
|
void SCI_METHOD Release() override {
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
int SCI_METHOD Version() const {
|
int SCI_METHOD Version() const override {
|
||||||
return lvOriginal;
|
return lvRelease4;
|
||||||
}
|
}
|
||||||
const char * SCI_METHOD PropertyNames() {
|
const char * SCI_METHOD PropertyNames() override {
|
||||||
return osAsm.PropertyNames();
|
return osAsm.PropertyNames();
|
||||||
}
|
}
|
||||||
int SCI_METHOD PropertyType(const char *name) {
|
int SCI_METHOD PropertyType(const char *name) override {
|
||||||
return osAsm.PropertyType(name);
|
return osAsm.PropertyType(name);
|
||||||
}
|
}
|
||||||
const char * SCI_METHOD DescribeProperty(const char *name) {
|
const char * SCI_METHOD DescribeProperty(const char *name) override {
|
||||||
return osAsm.DescribeProperty(name);
|
return osAsm.DescribeProperty(name);
|
||||||
}
|
}
|
||||||
int SCI_METHOD PropertySet(const char *key, const char *val);
|
Sci_Position SCI_METHOD PropertySet(const char *key, const char *val) override;
|
||||||
const char * SCI_METHOD DescribeWordListSets() {
|
const char * SCI_METHOD DescribeWordListSets() override {
|
||||||
return osAsm.DescribeWordListSets();
|
return osAsm.DescribeWordListSets();
|
||||||
}
|
}
|
||||||
int SCI_METHOD WordListSet(int n, const char *wl);
|
Sci_Position SCI_METHOD WordListSet(int n, const char *wl) override;
|
||||||
void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
|
void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) override;
|
||||||
void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
|
void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) override;
|
||||||
|
|
||||||
void * SCI_METHOD PrivateCall(int, void *) {
|
void * SCI_METHOD PrivateCall(int, void *) override {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ILexer *LexerFactoryAsm() {
|
static ILexer4 *LexerFactoryAsm() {
|
||||||
return new LexerAsm(';');
|
return new LexerAsm(';');
|
||||||
}
|
}
|
||||||
|
|
||||||
static ILexer *LexerFactoryAs() {
|
static ILexer4 *LexerFactoryAs() {
|
||||||
return new LexerAsm('#');
|
return new LexerAsm('#');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
int SCI_METHOD LexerAsm::PropertySet(const char *key, const char *val) {
|
Sci_Position SCI_METHOD LexerAsm::PropertySet(const char *key, const char *val) {
|
||||||
if (osAsm.PropertySet(&options, key, val)) {
|
if (osAsm.PropertySet(&options, key, val)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SCI_METHOD LexerAsm::WordListSet(int n, const char *wl) {
|
Sci_Position SCI_METHOD LexerAsm::WordListSet(int n, const char *wl) {
|
||||||
WordList *wordListN = 0;
|
WordList *wordListN = 0;
|
||||||
switch (n) {
|
switch (n) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -228,7 +227,7 @@ int SCI_METHOD LexerAsm::WordListSet(int n, const char *wl) {
|
|||||||
wordListN = &directives4foldend;
|
wordListN = &directives4foldend;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int firstModification = -1;
|
Sci_Position firstModification = -1;
|
||||||
if (wordListN) {
|
if (wordListN) {
|
||||||
WordList wlNew;
|
WordList wlNew;
|
||||||
wlNew.Set(wl);
|
wlNew.Set(wl);
|
||||||
@ -240,7 +239,7 @@ int SCI_METHOD LexerAsm::WordListSet(int n, const char *wl) {
|
|||||||
return firstModification;
|
return firstModification;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SCI_METHOD LexerAsm::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
|
void SCI_METHOD LexerAsm::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) {
|
||||||
LexAccessor styler(pAccess);
|
LexAccessor styler(pAccess);
|
||||||
|
|
||||||
// Do not leak onto next line
|
// Do not leak onto next line
|
||||||
@ -371,16 +370,16 @@ void SCI_METHOD LexerAsm::Lex(unsigned int startPos, int length, int initStyle,
|
|||||||
// level store to make it easy to pick up with each increment
|
// level store to make it easy to pick up with each increment
|
||||||
// and to make it possible to fiddle the current level for "else".
|
// and to make it possible to fiddle the current level for "else".
|
||||||
|
|
||||||
void SCI_METHOD LexerAsm::Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
|
void SCI_METHOD LexerAsm::Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) {
|
||||||
|
|
||||||
if (!options.fold)
|
if (!options.fold)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
LexAccessor styler(pAccess);
|
LexAccessor styler(pAccess);
|
||||||
|
|
||||||
unsigned int endPos = startPos + length;
|
Sci_PositionU endPos = startPos + length;
|
||||||
int visibleChars = 0;
|
int visibleChars = 0;
|
||||||
int lineCurrent = styler.GetLine(startPos);
|
Sci_Position lineCurrent = styler.GetLine(startPos);
|
||||||
int levelCurrent = SC_FOLDLEVELBASE;
|
int levelCurrent = SC_FOLDLEVELBASE;
|
||||||
if (lineCurrent > 0)
|
if (lineCurrent > 0)
|
||||||
levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
|
levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
|
||||||
@ -391,7 +390,7 @@ void SCI_METHOD LexerAsm::Fold(unsigned int startPos, int length, int initStyle,
|
|||||||
char word[100];
|
char word[100];
|
||||||
int wordlen = 0;
|
int wordlen = 0;
|
||||||
const bool userDefinedFoldMarkers = !options.foldExplicitStart.empty() && !options.foldExplicitEnd.empty();
|
const bool userDefinedFoldMarkers = !options.foldExplicitStart.empty() && !options.foldExplicitEnd.empty();
|
||||||
for (unsigned int i = startPos; i < endPos; i++) {
|
for (Sci_PositionU i = startPos; i < endPos; i++) {
|
||||||
char ch = chNext;
|
char ch = chNext;
|
||||||
chNext = styler.SafeGetCharAt(i + 1);
|
chNext = styler.SafeGetCharAt(i + 1);
|
||||||
int stylePrev = style;
|
int stylePrev = style;
|
||||||
@ -453,7 +452,7 @@ void SCI_METHOD LexerAsm::Fold(unsigned int startPos, int length, int initStyle,
|
|||||||
}
|
}
|
||||||
lineCurrent++;
|
lineCurrent++;
|
||||||
levelCurrent = levelNext;
|
levelCurrent = levelNext;
|
||||||
if (atEOL && (i == static_cast<unsigned int>(styler.Length()-1))) {
|
if (atEOL && (i == static_cast<Sci_PositionU>(styler.Length() - 1))) {
|
||||||
// There is an empty line at end of file so give it same level and empty
|
// There is an empty line at end of file so give it same level and empty
|
||||||
styler.SetLevel(lineCurrent, (levelCurrent | levelCurrent << 16) | SC_FOLDLEVELWHITEFLAG);
|
styler.SetLevel(lineCurrent, (levelCurrent | levelCurrent << 16) | SC_FOLDLEVELWHITEFLAG);
|
||||||
}
|
}
|
||||||
|
@ -23,9 +23,7 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
// Some char test functions
|
// Some char test functions
|
||||||
static bool isAsn1Number(int ch)
|
static bool isAsn1Number(int ch)
|
||||||
@ -47,7 +45,7 @@ static bool isAsn1Char(int ch)
|
|||||||
// Function determining the color of a given code portion
|
// Function determining the color of a given code portion
|
||||||
// Based on a "state"
|
// Based on a "state"
|
||||||
//
|
//
|
||||||
static void ColouriseAsn1Doc(unsigned int startPos, int length, int initStyle, WordList *keywordLists[], Accessor &styler)
|
static void ColouriseAsn1Doc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordLists[], Accessor &styler)
|
||||||
{
|
{
|
||||||
// The keywords
|
// The keywords
|
||||||
WordList &Keywords = *keywordLists[0];
|
WordList &Keywords = *keywordLists[0];
|
||||||
@ -168,7 +166,7 @@ asn1_default:
|
|||||||
sc.Complete();
|
sc.Complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FoldAsn1Doc(unsigned int, int, int, WordList *[], Accessor &styler)
|
static void FoldAsn1Doc(Sci_PositionU, Sci_Position, int, WordList *[], Accessor &styler)
|
||||||
{
|
{
|
||||||
// No folding enabled, no reason to continue...
|
// No folding enabled, no reason to continue...
|
||||||
if( styler.GetPropertyInt("fold") == 0 )
|
if( styler.GetPropertyInt("fold") == 0 )
|
||||||
|
@ -12,20 +12,25 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <map>
|
||||||
|
|
||||||
#include "ILexer.h"
|
#include "ILexer.h"
|
||||||
#include "Scintilla.h"
|
#include "Scintilla.h"
|
||||||
#include "SciLexer.h"
|
#include "SciLexer.h"
|
||||||
|
|
||||||
|
#include "StringCopy.h"
|
||||||
#include "WordList.h"
|
#include "WordList.h"
|
||||||
#include "LexAccessor.h"
|
#include "LexAccessor.h"
|
||||||
#include "Accessor.h"
|
|
||||||
#include "StyleContext.h"
|
#include "StyleContext.h"
|
||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
|
#include "OptionSet.h"
|
||||||
|
#include "SubStyles.h"
|
||||||
|
#include "DefaultLexer.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HERE_DELIM_MAX 256
|
#define HERE_DELIM_MAX 256
|
||||||
|
|
||||||
@ -60,7 +65,9 @@ using namespace Scintilla;
|
|||||||
|
|
||||||
#define BASH_DELIM_STACK_MAX 7
|
#define BASH_DELIM_STACK_MAX 7
|
||||||
|
|
||||||
static inline int translateBashDigit(int ch) {
|
namespace {
|
||||||
|
|
||||||
|
inline int translateBashDigit(int ch) {
|
||||||
if (ch >= '0' && ch <= '9') {
|
if (ch >= '0' && ch <= '9') {
|
||||||
return ch - '0';
|
return ch - '0';
|
||||||
} else if (ch >= 'a' && ch <= 'z') {
|
} else if (ch >= 'a' && ch <= 'z') {
|
||||||
@ -75,7 +82,7 @@ static inline int translateBashDigit(int ch) {
|
|||||||
return BASH_BASE_ERROR;
|
return BASH_BASE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int getBashNumberBase(char *s) {
|
inline int getBashNumberBase(char *s) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int base = 0;
|
int base = 0;
|
||||||
while (*s) {
|
while (*s) {
|
||||||
@ -88,7 +95,7 @@ static inline int getBashNumberBase(char *s) {
|
|||||||
return base;
|
return base;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int opposite(int ch) {
|
int opposite(int ch) {
|
||||||
if (ch == '(') return ')';
|
if (ch == '(') return ')';
|
||||||
if (ch == '[') return ']';
|
if (ch == '[') return ']';
|
||||||
if (ch == '{') return '}';
|
if (ch == '{') return '}';
|
||||||
@ -96,10 +103,197 @@ static int opposite(int ch) {
|
|||||||
return ch;
|
return ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
int GlobScan(StyleContext &sc) {
|
||||||
WordList *keywordlists[], Accessor &styler) {
|
// forward scan for zsh globs, disambiguate versus bash arrays
|
||||||
|
// complex expressions may still fail, e.g. unbalanced () '' "" etc
|
||||||
|
int c, sLen = 0;
|
||||||
|
int pCount = 0;
|
||||||
|
int hash = 0;
|
||||||
|
while ((c = sc.GetRelativeCharacter(++sLen)) != 0) {
|
||||||
|
if (IsASpace(c)) {
|
||||||
|
return 0;
|
||||||
|
} else if (c == '\'' || c == '\"') {
|
||||||
|
if (hash != 2) return 0;
|
||||||
|
} else if (c == '#' && hash == 0) {
|
||||||
|
hash = (sLen == 1) ? 2:1;
|
||||||
|
} else if (c == '(') {
|
||||||
|
pCount++;
|
||||||
|
} else if (c == ')') {
|
||||||
|
if (pCount == 0) {
|
||||||
|
if (hash) return sLen;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
pCount--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
WordList &keywords = *keywordlists[0];
|
bool IsCommentLine(Sci_Position line, LexAccessor &styler) {
|
||||||
|
Sci_Position pos = styler.LineStart(line);
|
||||||
|
Sci_Position eol_pos = styler.LineStart(line + 1) - 1;
|
||||||
|
for (Sci_Position i = pos; i < eol_pos; i++) {
|
||||||
|
char ch = styler[i];
|
||||||
|
if (ch == '#')
|
||||||
|
return true;
|
||||||
|
else if (ch != ' ' && ch != '\t')
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct OptionsBash {
|
||||||
|
bool fold;
|
||||||
|
bool foldComment;
|
||||||
|
bool foldCompact;
|
||||||
|
|
||||||
|
OptionsBash() {
|
||||||
|
fold = false;
|
||||||
|
foldComment = false;
|
||||||
|
foldCompact = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const char * const bashWordListDesc[] = {
|
||||||
|
"Keywords",
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
struct OptionSetBash : public OptionSet<OptionsBash> {
|
||||||
|
OptionSetBash() {
|
||||||
|
DefineProperty("fold", &OptionsBash::fold);
|
||||||
|
|
||||||
|
DefineProperty("fold.comment", &OptionsBash::foldComment);
|
||||||
|
|
||||||
|
DefineProperty("fold.compact", &OptionsBash::foldCompact);
|
||||||
|
|
||||||
|
DefineWordListSets(bashWordListDesc);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const char styleSubable[] = { SCE_SH_IDENTIFIER, SCE_SH_SCALAR, 0 };
|
||||||
|
|
||||||
|
LexicalClass lexicalClasses[] = {
|
||||||
|
// Lexer Bash SCLEX_BASH SCE_SH_:
|
||||||
|
0, "SCE_SH_DEFAULT", "default", "White space",
|
||||||
|
1, "SCE_SH_ERROR", "error", "Error",
|
||||||
|
2, "SCE_SH_COMMENTLINE", "comment line", "Line comment: #",
|
||||||
|
3, "SCE_SH_NUMBER", "literal numeric", "Number",
|
||||||
|
4, "SCE_SH_WORD", "keyword", "Keyword",
|
||||||
|
5, "SCE_SH_STRING", "literal string", "String",
|
||||||
|
6, "SCE_SH_CHARACTER", "literal string", "Single quoted string",
|
||||||
|
7, "SCE_SH_OPERATOR", "operator", "Operators",
|
||||||
|
8, "SCE_SH_IDENTIFIER", "identifier", "Identifiers",
|
||||||
|
9, "SCE_SH_SCALAR", "identifier", "Scalar variable",
|
||||||
|
10, "SCE_SH_PARAM", "identifier", "Parameter",
|
||||||
|
11, "SCE_SH_BACKTICKS", "literal string", "Backtick quoted command",
|
||||||
|
12, "SCE_SH_HERE_DELIM", "operator", "Heredoc delimiter",
|
||||||
|
13, "SCE_SH_HERE_Q", "literal string", "Heredoc quoted string",
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class LexerBash : public DefaultLexer {
|
||||||
|
WordList keywords;
|
||||||
|
OptionsBash options;
|
||||||
|
OptionSetBash osBash;
|
||||||
|
enum { ssIdentifier, ssScalar };
|
||||||
|
SubStyles subStyles;
|
||||||
|
public:
|
||||||
|
LexerBash() :
|
||||||
|
DefaultLexer(lexicalClasses, ELEMENTS(lexicalClasses)),
|
||||||
|
subStyles(styleSubable, 0x80, 0x40, 0) {
|
||||||
|
}
|
||||||
|
virtual ~LexerBash() {
|
||||||
|
}
|
||||||
|
void SCI_METHOD Release() override {
|
||||||
|
delete this;
|
||||||
|
}
|
||||||
|
int SCI_METHOD Version() const override {
|
||||||
|
return lvRelease4;
|
||||||
|
}
|
||||||
|
const char * SCI_METHOD PropertyNames() override {
|
||||||
|
return osBash.PropertyNames();
|
||||||
|
}
|
||||||
|
int SCI_METHOD PropertyType(const char* name) override {
|
||||||
|
return osBash.PropertyType(name);
|
||||||
|
}
|
||||||
|
const char * SCI_METHOD DescribeProperty(const char *name) override {
|
||||||
|
return osBash.DescribeProperty(name);
|
||||||
|
}
|
||||||
|
Sci_Position SCI_METHOD PropertySet(const char *key, const char *val) override;
|
||||||
|
const char * SCI_METHOD DescribeWordListSets() override {
|
||||||
|
return osBash.DescribeWordListSets();
|
||||||
|
}
|
||||||
|
Sci_Position SCI_METHOD WordListSet(int n, const char *wl) override;
|
||||||
|
void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) override;
|
||||||
|
void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) override;
|
||||||
|
|
||||||
|
void * SCI_METHOD PrivateCall(int, void *) override {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int SCI_METHOD AllocateSubStyles(int styleBase, int numberStyles) override {
|
||||||
|
return subStyles.Allocate(styleBase, numberStyles);
|
||||||
|
}
|
||||||
|
int SCI_METHOD SubStylesStart(int styleBase) override {
|
||||||
|
return subStyles.Start(styleBase);
|
||||||
|
}
|
||||||
|
int SCI_METHOD SubStylesLength(int styleBase) override {
|
||||||
|
return subStyles.Length(styleBase);
|
||||||
|
}
|
||||||
|
int SCI_METHOD StyleFromSubStyle(int subStyle) override {
|
||||||
|
const int styleBase = subStyles.BaseStyle(subStyle);
|
||||||
|
return styleBase;
|
||||||
|
}
|
||||||
|
int SCI_METHOD PrimaryStyleFromStyle(int style) override {
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
void SCI_METHOD FreeSubStyles() override {
|
||||||
|
subStyles.Free();
|
||||||
|
}
|
||||||
|
void SCI_METHOD SetIdentifiers(int style, const char *identifiers) override {
|
||||||
|
subStyles.SetIdentifiers(style, identifiers);
|
||||||
|
}
|
||||||
|
int SCI_METHOD DistanceToSecondaryStyles() override {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
const char *SCI_METHOD GetSubStyleBases() override {
|
||||||
|
return styleSubable;
|
||||||
|
}
|
||||||
|
|
||||||
|
static ILexer4 *LexerFactoryBash() {
|
||||||
|
return new LexerBash();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Sci_Position SCI_METHOD LexerBash::PropertySet(const char *key, const char *val) {
|
||||||
|
if (osBash.PropertySet(&options, key, val)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
Sci_Position SCI_METHOD LexerBash::WordListSet(int n, const char *wl) {
|
||||||
|
WordList *wordListN = 0;
|
||||||
|
switch (n) {
|
||||||
|
case 0:
|
||||||
|
wordListN = &keywords;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Sci_Position firstModification = -1;
|
||||||
|
if (wordListN) {
|
||||||
|
WordList wlNew;
|
||||||
|
wlNew.Set(wl);
|
||||||
|
if (*wordListN != wlNew) {
|
||||||
|
wordListN->Set(wl);
|
||||||
|
firstModification = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return firstModification;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SCI_METHOD LexerBash::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) {
|
||||||
WordList cmdDelimiter, bashStruct, bashStruct_in;
|
WordList cmdDelimiter, bashStruct, bashStruct_in;
|
||||||
cmdDelimiter.Set("| || |& & && ; ;; ( ) { }");
|
cmdDelimiter.Set("| || |& & && ; ;; ( ) { }");
|
||||||
bashStruct.Set("if elif fi while until else then do done esac eval");
|
bashStruct.Set("if elif fi while until else then do done esac eval");
|
||||||
@ -113,9 +307,9 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
CharacterSet setBashOperator(CharacterSet::setNone, "^&%()-+=|{}[]:;>,*/<?!.~@");
|
CharacterSet setBashOperator(CharacterSet::setNone, "^&%()-+=|{}[]:;>,*/<?!.~@");
|
||||||
CharacterSet setSingleCharOp(CharacterSet::setNone, "rwxoRWXOezsfdlpSbctugkTBMACahGLNn");
|
CharacterSet setSingleCharOp(CharacterSet::setNone, "rwxoRWXOezsfdlpSbctugkTBMACahGLNn");
|
||||||
CharacterSet setParam(CharacterSet::setAlphaNum, "$_");
|
CharacterSet setParam(CharacterSet::setAlphaNum, "$_");
|
||||||
CharacterSet setHereDoc(CharacterSet::setAlpha, "_\\-+!");
|
CharacterSet setHereDoc(CharacterSet::setAlpha, "_\\-+!%*,./:?@[]^`{}~");
|
||||||
CharacterSet setHereDoc2(CharacterSet::setAlphaNum, "_-+!");
|
CharacterSet setHereDoc2(CharacterSet::setAlphaNum, "_-+!%*,./:=?@[]^`{}~");
|
||||||
CharacterSet setLeftShift(CharacterSet::setDigits, "=$");
|
CharacterSet setLeftShift(CharacterSet::setDigits, "$");
|
||||||
|
|
||||||
class HereDocCls { // Class to manage HERE document elements
|
class HereDocCls { // Class to manage HERE document elements
|
||||||
public:
|
public:
|
||||||
@ -126,14 +320,13 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
bool Quoted; // true if Quote in ('\'','"','`')
|
bool Quoted; // true if Quote in ('\'','"','`')
|
||||||
bool Indent; // indented delimiter (for <<-)
|
bool Indent; // indented delimiter (for <<-)
|
||||||
int DelimiterLength; // strlen(Delimiter)
|
int DelimiterLength; // strlen(Delimiter)
|
||||||
char *Delimiter; // the Delimiter, 256: sizeof PL_tokenbuf
|
char Delimiter[HERE_DELIM_MAX]; // the Delimiter
|
||||||
HereDocCls() {
|
HereDocCls() {
|
||||||
State = 0;
|
State = 0;
|
||||||
Quote = 0;
|
Quote = 0;
|
||||||
Quoted = false;
|
Quoted = false;
|
||||||
Indent = 0;
|
Indent = 0;
|
||||||
DelimiterLength = 0;
|
DelimiterLength = 0;
|
||||||
Delimiter = new char[HERE_DELIM_MAX];
|
|
||||||
Delimiter[0] = '\0';
|
Delimiter[0] = '\0';
|
||||||
}
|
}
|
||||||
void Append(int ch) {
|
void Append(int ch) {
|
||||||
@ -141,7 +334,6 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
Delimiter[DelimiterLength] = '\0';
|
Delimiter[DelimiterLength] = '\0';
|
||||||
}
|
}
|
||||||
~HereDocCls() {
|
~HereDocCls() {
|
||||||
delete []Delimiter;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
HereDocCls HereDoc;
|
HereDocCls HereDoc;
|
||||||
@ -173,18 +365,15 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
int Up, Down;
|
int Up, Down;
|
||||||
int Style;
|
int Style;
|
||||||
int Depth; // levels pushed
|
int Depth; // levels pushed
|
||||||
int *CountStack;
|
int CountStack[BASH_DELIM_STACK_MAX];
|
||||||
int *UpStack;
|
int UpStack [BASH_DELIM_STACK_MAX];
|
||||||
int *StyleStack;
|
int StyleStack[BASH_DELIM_STACK_MAX];
|
||||||
QuoteStackCls() {
|
QuoteStackCls() {
|
||||||
Count = 0;
|
Count = 0;
|
||||||
Up = '\0';
|
Up = '\0';
|
||||||
Down = '\0';
|
Down = '\0';
|
||||||
Style = 0;
|
Style = 0;
|
||||||
Depth = 0;
|
Depth = 0;
|
||||||
CountStack = new int[BASH_DELIM_STACK_MAX];
|
|
||||||
UpStack = new int[BASH_DELIM_STACK_MAX];
|
|
||||||
StyleStack = new int[BASH_DELIM_STACK_MAX];
|
|
||||||
}
|
}
|
||||||
void Start(int u, int s) {
|
void Start(int u, int s) {
|
||||||
Count = 1;
|
Count = 1;
|
||||||
@ -214,23 +403,24 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
Down = opposite(Up);
|
Down = opposite(Up);
|
||||||
}
|
}
|
||||||
~QuoteStackCls() {
|
~QuoteStackCls() {
|
||||||
delete []CountStack;
|
|
||||||
delete []UpStack;
|
|
||||||
delete []StyleStack;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
QuoteStackCls QuoteStack;
|
QuoteStackCls QuoteStack;
|
||||||
|
|
||||||
|
const WordClassifier &classifierIdentifiers = subStyles.Classifier(SCE_SH_IDENTIFIER);
|
||||||
|
const WordClassifier &classifierScalars = subStyles.Classifier(SCE_SH_SCALAR);
|
||||||
|
|
||||||
int numBase = 0;
|
int numBase = 0;
|
||||||
int digit;
|
int digit;
|
||||||
unsigned int endPos = startPos + length;
|
Sci_PositionU endPos = startPos + length;
|
||||||
int cmdState = BASH_CMD_START;
|
int cmdState = BASH_CMD_START;
|
||||||
int testExprType = 0;
|
int testExprType = 0;
|
||||||
|
LexAccessor styler(pAccess);
|
||||||
|
|
||||||
// Always backtracks to the start of a line that is not a continuation
|
// 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)
|
// of the previous line (i.e. start of a bash command segment)
|
||||||
int ln = styler.GetLine(startPos);
|
Sci_Position ln = styler.GetLine(startPos);
|
||||||
if (ln > 0 && startPos == static_cast<unsigned int>(styler.LineStart(ln)))
|
if (ln > 0 && startPos == static_cast<Sci_PositionU>(styler.LineStart(ln)))
|
||||||
ln--;
|
ln--;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
startPos = styler.LineStart(ln);
|
startPos = styler.LineStart(ln);
|
||||||
@ -290,6 +480,11 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
char s[500];
|
char s[500];
|
||||||
char s2[10];
|
char s2[10];
|
||||||
sc.GetCurrent(s, sizeof(s));
|
sc.GetCurrent(s, sizeof(s));
|
||||||
|
int identifierStyle = SCE_SH_IDENTIFIER;
|
||||||
|
int subStyle = classifierIdentifiers.ValueFor(s);
|
||||||
|
if (subStyle >= 0) {
|
||||||
|
identifierStyle = subStyle;
|
||||||
|
}
|
||||||
// allow keywords ending in a whitespace or command delimiter
|
// allow keywords ending in a whitespace or command delimiter
|
||||||
s2[0] = static_cast<char>(sc.ch);
|
s2[0] = static_cast<char>(sc.ch);
|
||||||
s2[1] = '\0';
|
s2[1] = '\0';
|
||||||
@ -301,7 +496,7 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
else if (strcmp(s, "do") == 0 && keywordEnds)
|
else if (strcmp(s, "do") == 0 && keywordEnds)
|
||||||
cmdStateNew = BASH_CMD_START;
|
cmdStateNew = BASH_CMD_START;
|
||||||
else
|
else
|
||||||
sc.ChangeState(SCE_SH_IDENTIFIER);
|
sc.ChangeState(identifierStyle);
|
||||||
sc.SetState(SCE_SH_DEFAULT);
|
sc.SetState(SCE_SH_DEFAULT);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -311,41 +506,50 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
cmdStateNew = BASH_CMD_TEST;
|
cmdStateNew = BASH_CMD_TEST;
|
||||||
testExprType = 0;
|
testExprType = 0;
|
||||||
} else
|
} else
|
||||||
sc.ChangeState(SCE_SH_IDENTIFIER);
|
sc.ChangeState(identifierStyle);
|
||||||
}
|
}
|
||||||
// detect bash construct keywords
|
// detect bash construct keywords
|
||||||
else if (bashStruct.InList(s)) {
|
else if (bashStruct.InList(s)) {
|
||||||
if (cmdState == BASH_CMD_START && keywordEnds)
|
if (cmdState == BASH_CMD_START && keywordEnds)
|
||||||
cmdStateNew = BASH_CMD_START;
|
cmdStateNew = BASH_CMD_START;
|
||||||
else
|
else
|
||||||
sc.ChangeState(SCE_SH_IDENTIFIER);
|
sc.ChangeState(identifierStyle);
|
||||||
}
|
}
|
||||||
// 'for'|'case'|'select' needs 'in'|'do' to be highlighted later
|
// 'for'|'case'|'select' needs 'in'|'do' to be highlighted later
|
||||||
else if (bashStruct_in.InList(s)) {
|
else if (bashStruct_in.InList(s)) {
|
||||||
if (cmdState == BASH_CMD_START && keywordEnds)
|
if (cmdState == BASH_CMD_START && keywordEnds)
|
||||||
cmdStateNew = BASH_CMD_WORD;
|
cmdStateNew = BASH_CMD_WORD;
|
||||||
else
|
else
|
||||||
sc.ChangeState(SCE_SH_IDENTIFIER);
|
sc.ChangeState(identifierStyle);
|
||||||
}
|
}
|
||||||
// disambiguate option items and file test operators
|
// disambiguate option items and file test operators
|
||||||
else if (s[0] == '-') {
|
else if (s[0] == '-') {
|
||||||
if (cmdState != BASH_CMD_TEST)
|
if (cmdState != BASH_CMD_TEST)
|
||||||
sc.ChangeState(SCE_SH_IDENTIFIER);
|
sc.ChangeState(identifierStyle);
|
||||||
}
|
}
|
||||||
// disambiguate keywords and identifiers
|
// disambiguate keywords and identifiers
|
||||||
else if (cmdState != BASH_CMD_START
|
else if (cmdState != BASH_CMD_START
|
||||||
|| !(keywords.InList(s) && keywordEnds)) {
|
|| !(keywords.InList(s) && keywordEnds)) {
|
||||||
sc.ChangeState(SCE_SH_IDENTIFIER);
|
sc.ChangeState(identifierStyle);
|
||||||
}
|
}
|
||||||
sc.SetState(SCE_SH_DEFAULT);
|
sc.SetState(SCE_SH_DEFAULT);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SCE_SH_IDENTIFIER:
|
case SCE_SH_IDENTIFIER:
|
||||||
|
if (sc.chPrev == '\\' || !setWord.Contains(sc.ch) ||
|
||||||
|
(cmdState == BASH_CMD_ARITH && !setWordStart.Contains(sc.ch))) {
|
||||||
|
char s[500];
|
||||||
|
sc.GetCurrent(s, sizeof(s));
|
||||||
|
int subStyle = classifierIdentifiers.ValueFor(s);
|
||||||
|
if (subStyle >= 0) {
|
||||||
|
sc.ChangeState(subStyle);
|
||||||
|
}
|
||||||
if (sc.chPrev == '\\') { // for escaped chars
|
if (sc.chPrev == '\\') { // for escaped chars
|
||||||
sc.ForwardSetState(SCE_SH_DEFAULT);
|
sc.ForwardSetState(SCE_SH_DEFAULT);
|
||||||
} else if (!setWord.Contains(sc.ch)) {
|
} else {
|
||||||
sc.SetState(SCE_SH_DEFAULT);
|
sc.SetState(SCE_SH_DEFAULT);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case SCE_SH_NUMBER:
|
case SCE_SH_NUMBER:
|
||||||
digit = translateBashDigit(sc.ch);
|
digit = translateBashDigit(sc.ch);
|
||||||
@ -419,17 +623,18 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
sc.Forward();
|
sc.Forward();
|
||||||
HereDoc.Quoted = true;
|
HereDoc.Quoted = true;
|
||||||
HereDoc.State = 1;
|
HereDoc.State = 1;
|
||||||
} else if (setHereDoc.Contains(sc.chNext)) {
|
} else if (setHereDoc.Contains(sc.chNext) ||
|
||||||
|
(sc.chNext == '=' && cmdState != BASH_CMD_ARITH)) {
|
||||||
// an unquoted here-doc delimiter, no special handling
|
// an unquoted here-doc delimiter, no special handling
|
||||||
// TODO check what exactly bash considers part of the delim
|
|
||||||
HereDoc.State = 1;
|
HereDoc.State = 1;
|
||||||
} else if (sc.chNext == '<') { // HERE string <<<
|
} else if (sc.chNext == '<') { // HERE string <<<
|
||||||
sc.Forward();
|
sc.Forward();
|
||||||
sc.ForwardSetState(SCE_SH_DEFAULT);
|
sc.ForwardSetState(SCE_SH_DEFAULT);
|
||||||
} else if (IsASpace(sc.chNext)) {
|
} else if (IsASpace(sc.chNext)) {
|
||||||
// eat whitespace
|
// eat whitespace
|
||||||
} else if (setLeftShift.Contains(sc.chNext)) {
|
} else if (setLeftShift.Contains(sc.chNext) ||
|
||||||
// left shift << or <<= operator cases
|
(sc.chNext == '=' && cmdState == BASH_CMD_ARITH)) {
|
||||||
|
// left shift <<$var or <<= cases
|
||||||
sc.ChangeState(SCE_SH_OPERATOR);
|
sc.ChangeState(SCE_SH_OPERATOR);
|
||||||
sc.ForwardSetState(SCE_SH_DEFAULT);
|
sc.ForwardSetState(SCE_SH_DEFAULT);
|
||||||
} else {
|
} else {
|
||||||
@ -497,6 +702,12 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
break;
|
break;
|
||||||
case SCE_SH_SCALAR: // variable names
|
case SCE_SH_SCALAR: // variable names
|
||||||
if (!setParam.Contains(sc.ch)) {
|
if (!setParam.Contains(sc.ch)) {
|
||||||
|
char s[500];
|
||||||
|
sc.GetCurrent(s, sizeof(s));
|
||||||
|
int subStyle = classifierScalars.ValueFor(&s[1]); // skip the $
|
||||||
|
if (subStyle >= 0) {
|
||||||
|
sc.ChangeState(subStyle);
|
||||||
|
}
|
||||||
if (sc.LengthCurrent() == 1) {
|
if (sc.LengthCurrent() == 1) {
|
||||||
// Special variable: $(, $_ etc.
|
// Special variable: $(, $_ etc.
|
||||||
sc.ForwardSetState(SCE_SH_DEFAULT);
|
sc.ForwardSetState(SCE_SH_DEFAULT);
|
||||||
@ -584,12 +795,14 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
HereDoc.State = 2;
|
HereDoc.State = 2;
|
||||||
if (HereDoc.Quoted) {
|
if (HereDoc.Quoted) {
|
||||||
if (sc.state == SCE_SH_HERE_DELIM) {
|
if (sc.state == SCE_SH_HERE_DELIM) {
|
||||||
// Missing quote at end of string! We are stricter than bash.
|
// Missing quote at end of string! Syntax error in bash 4.3
|
||||||
// Colour here-doc anyway while marking this bit as an error.
|
// Mark this bit as an error, do not colour any here-doc
|
||||||
sc.ChangeState(SCE_SH_ERROR);
|
sc.ChangeState(SCE_SH_ERROR);
|
||||||
}
|
sc.SetState(SCE_SH_DEFAULT);
|
||||||
|
} else {
|
||||||
// HereDoc.Quote always == '\''
|
// HereDoc.Quote always == '\''
|
||||||
sc.SetState(SCE_SH_HERE_Q);
|
sc.SetState(SCE_SH_HERE_Q);
|
||||||
|
}
|
||||||
} else if (HereDoc.DelimiterLength == 0) {
|
} else if (HereDoc.DelimiterLength == 0) {
|
||||||
// no delimiter, illegal (but '' and "" are legal)
|
// no delimiter, illegal (but '' and "" are legal)
|
||||||
sc.ChangeState(SCE_SH_ERROR);
|
sc.ChangeState(SCE_SH_ERROR);
|
||||||
@ -634,6 +847,23 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
} else {
|
} else {
|
||||||
sc.SetState(SCE_SH_WORD);
|
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 == '\"') {
|
} else if (sc.ch == '\"') {
|
||||||
sc.SetState(SCE_SH_STRING);
|
sc.SetState(SCE_SH_STRING);
|
||||||
QuoteStack.Start(sc.ch, BASH_DELIM_STRING);
|
QuoteStack.Start(sc.ch, BASH_DELIM_STRING);
|
||||||
@ -687,6 +917,15 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
char s[10];
|
char s[10];
|
||||||
bool isCmdDelim = false;
|
bool isCmdDelim = false;
|
||||||
sc.SetState(SCE_SH_OPERATOR);
|
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 - ((,[[,[
|
// handle opening delimiters for test/arithmetic expressions - ((,[[,[
|
||||||
if (cmdState == BASH_CMD_START
|
if (cmdState == BASH_CMD_START
|
||||||
|| cmdState == BASH_CMD_BODY) {
|
|| cmdState == BASH_CMD_BODY) {
|
||||||
@ -752,39 +991,30 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
sc.Complete();
|
sc.Complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool IsCommentLine(int line, Accessor &styler) {
|
void SCI_METHOD LexerBash::Fold(Sci_PositionU startPos, Sci_Position length, int, IDocument *pAccess) {
|
||||||
int pos = styler.LineStart(line);
|
if(!options.fold)
|
||||||
int eol_pos = styler.LineStart(line + 1) - 1;
|
return;
|
||||||
for (int 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(unsigned int startPos, int length, int, WordList *[],
|
LexAccessor styler(pAccess);
|
||||||
Accessor &styler) {
|
|
||||||
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
|
Sci_PositionU endPos = startPos + length;
|
||||||
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
|
||||||
unsigned int endPos = startPos + length;
|
|
||||||
int visibleChars = 0;
|
int visibleChars = 0;
|
||||||
int skipHereCh = 0;
|
int skipHereCh = 0;
|
||||||
int lineCurrent = styler.GetLine(startPos);
|
Sci_Position lineCurrent = styler.GetLine(startPos);
|
||||||
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
|
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
|
||||||
int levelCurrent = levelPrev;
|
int levelCurrent = levelPrev;
|
||||||
char chNext = styler[startPos];
|
char chNext = styler[startPos];
|
||||||
int styleNext = styler.StyleAt(startPos);
|
int styleNext = styler.StyleAt(startPos);
|
||||||
for (unsigned int i = startPos; i < endPos; i++) {
|
char word[8] = { '\0' }; // we're not interested in long words anyway
|
||||||
|
unsigned int wordlen = 0;
|
||||||
|
for (Sci_PositionU i = startPos; i < endPos; i++) {
|
||||||
char ch = chNext;
|
char ch = chNext;
|
||||||
chNext = styler.SafeGetCharAt(i + 1);
|
chNext = styler.SafeGetCharAt(i + 1);
|
||||||
int style = styleNext;
|
int style = styleNext;
|
||||||
styleNext = styler.StyleAt(i + 1);
|
styleNext = styler.StyleAt(i + 1);
|
||||||
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
|
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
|
||||||
// Comment folding
|
// Comment folding
|
||||||
if (foldComment && atEOL && IsCommentLine(lineCurrent, styler))
|
if (options.foldComment && atEOL && IsCommentLine(lineCurrent, styler))
|
||||||
{
|
{
|
||||||
if (!IsCommentLine(lineCurrent - 1, styler)
|
if (!IsCommentLine(lineCurrent - 1, styler)
|
||||||
&& IsCommentLine(lineCurrent + 1, styler))
|
&& IsCommentLine(lineCurrent + 1, styler))
|
||||||
@ -793,6 +1023,19 @@ static void FoldBashDoc(unsigned int startPos, int length, int, WordList *[],
|
|||||||
&& !IsCommentLine(lineCurrent + 1, styler))
|
&& !IsCommentLine(lineCurrent + 1, styler))
|
||||||
levelCurrent--;
|
levelCurrent--;
|
||||||
}
|
}
|
||||||
|
if (style == SCE_SH_WORD) {
|
||||||
|
if ((wordlen + 1) < sizeof(word))
|
||||||
|
word[wordlen++] = ch;
|
||||||
|
if (styleNext != style) {
|
||||||
|
word[wordlen] = '\0';
|
||||||
|
wordlen = 0;
|
||||||
|
if (strcmp(word, "if") == 0 || strcmp(word, "case") == 0 || strcmp(word, "do") == 0) {
|
||||||
|
levelCurrent++;
|
||||||
|
} else if (strcmp(word, "fi") == 0 || strcmp(word, "esac") == 0 || strcmp(word, "done") == 0) {
|
||||||
|
levelCurrent--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (style == SCE_SH_OPERATOR) {
|
if (style == SCE_SH_OPERATOR) {
|
||||||
if (ch == '{') {
|
if (ch == '{') {
|
||||||
levelCurrent++;
|
levelCurrent++;
|
||||||
@ -818,7 +1061,7 @@ static void FoldBashDoc(unsigned int startPos, int length, int, WordList *[],
|
|||||||
}
|
}
|
||||||
if (atEOL) {
|
if (atEOL) {
|
||||||
int lev = levelPrev;
|
int lev = levelPrev;
|
||||||
if (visibleChars == 0 && foldCompact)
|
if (visibleChars == 0 && options.foldCompact)
|
||||||
lev |= SC_FOLDLEVELWHITEFLAG;
|
lev |= SC_FOLDLEVELWHITEFLAG;
|
||||||
if ((levelCurrent > levelPrev) && (visibleChars > 0))
|
if ((levelCurrent > levelPrev) && (visibleChars > 0))
|
||||||
lev |= SC_FOLDLEVELHEADERFLAG;
|
lev |= SC_FOLDLEVELHEADERFLAG;
|
||||||
@ -837,9 +1080,4 @@ static void FoldBashDoc(unsigned int startPos, int length, int, WordList *[],
|
|||||||
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
|
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char * const bashWordListDesc[] = {
|
LexerModule lmBash(SCLEX_BASH, LexerBash::LexerFactoryBash, "bash", bashWordListDesc);
|
||||||
"Keywords",
|
|
||||||
0
|
|
||||||
};
|
|
||||||
|
|
||||||
LexerModule lmBash(SCLEX_BASH, ColouriseBashDoc, "bash", FoldBashDoc, bashWordListDesc);
|
|
||||||
|
@ -37,10 +37,9 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
#include "OptionSet.h"
|
#include "OptionSet.h"
|
||||||
|
#include "DefaultLexer.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Bits:
|
/* Bits:
|
||||||
* 1 - whitespace
|
* 1 - whitespace
|
||||||
@ -226,7 +225,7 @@ struct OptionSetBasic : public OptionSet<OptionsBasic> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class LexerBasic : public ILexer {
|
class LexerBasic : public DefaultLexer {
|
||||||
char comment_char;
|
char comment_char;
|
||||||
int (*CheckFoldPoint)(char const *, int &);
|
int (*CheckFoldPoint)(char const *, int &);
|
||||||
WordList keywordlists[4];
|
WordList keywordlists[4];
|
||||||
@ -240,51 +239,51 @@ public:
|
|||||||
}
|
}
|
||||||
virtual ~LexerBasic() {
|
virtual ~LexerBasic() {
|
||||||
}
|
}
|
||||||
void SCI_METHOD Release() {
|
void SCI_METHOD Release() override {
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
int SCI_METHOD Version() const {
|
int SCI_METHOD Version() const override {
|
||||||
return lvOriginal;
|
return lvRelease4;
|
||||||
}
|
}
|
||||||
const char * SCI_METHOD PropertyNames() {
|
const char * SCI_METHOD PropertyNames() override {
|
||||||
return osBasic.PropertyNames();
|
return osBasic.PropertyNames();
|
||||||
}
|
}
|
||||||
int SCI_METHOD PropertyType(const char *name) {
|
int SCI_METHOD PropertyType(const char *name) override {
|
||||||
return osBasic.PropertyType(name);
|
return osBasic.PropertyType(name);
|
||||||
}
|
}
|
||||||
const char * SCI_METHOD DescribeProperty(const char *name) {
|
const char * SCI_METHOD DescribeProperty(const char *name) override {
|
||||||
return osBasic.DescribeProperty(name);
|
return osBasic.DescribeProperty(name);
|
||||||
}
|
}
|
||||||
int SCI_METHOD PropertySet(const char *key, const char *val);
|
Sci_Position SCI_METHOD PropertySet(const char *key, const char *val) override;
|
||||||
const char * SCI_METHOD DescribeWordListSets() {
|
const char * SCI_METHOD DescribeWordListSets() override {
|
||||||
return osBasic.DescribeWordListSets();
|
return osBasic.DescribeWordListSets();
|
||||||
}
|
}
|
||||||
int SCI_METHOD WordListSet(int n, const char *wl);
|
Sci_Position SCI_METHOD WordListSet(int n, const char *wl) override;
|
||||||
void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
|
void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) override;
|
||||||
void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
|
void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) override;
|
||||||
|
|
||||||
void * SCI_METHOD PrivateCall(int, void *) {
|
void * SCI_METHOD PrivateCall(int, void *) override {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
static ILexer *LexerFactoryBlitzBasic() {
|
static ILexer4 *LexerFactoryBlitzBasic() {
|
||||||
return new LexerBasic(';', CheckBlitzFoldPoint, blitzbasicWordListDesc);
|
return new LexerBasic(';', CheckBlitzFoldPoint, blitzbasicWordListDesc);
|
||||||
}
|
}
|
||||||
static ILexer *LexerFactoryPureBasic() {
|
static ILexer4 *LexerFactoryPureBasic() {
|
||||||
return new LexerBasic(';', CheckPureFoldPoint, purebasicWordListDesc);
|
return new LexerBasic(';', CheckPureFoldPoint, purebasicWordListDesc);
|
||||||
}
|
}
|
||||||
static ILexer *LexerFactoryFreeBasic() {
|
static ILexer4 *LexerFactoryFreeBasic() {
|
||||||
return new LexerBasic('\'', CheckFreeFoldPoint, freebasicWordListDesc );
|
return new LexerBasic('\'', CheckFreeFoldPoint, freebasicWordListDesc );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
int SCI_METHOD LexerBasic::PropertySet(const char *key, const char *val) {
|
Sci_Position SCI_METHOD LexerBasic::PropertySet(const char *key, const char *val) {
|
||||||
if (osBasic.PropertySet(&options, key, val)) {
|
if (osBasic.PropertySet(&options, key, val)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SCI_METHOD LexerBasic::WordListSet(int n, const char *wl) {
|
Sci_Position SCI_METHOD LexerBasic::WordListSet(int n, const char *wl) {
|
||||||
WordList *wordListN = 0;
|
WordList *wordListN = 0;
|
||||||
switch (n) {
|
switch (n) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -300,7 +299,7 @@ int SCI_METHOD LexerBasic::WordListSet(int n, const char *wl) {
|
|||||||
wordListN = &keywordlists[3];
|
wordListN = &keywordlists[3];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int firstModification = -1;
|
Sci_Position firstModification = -1;
|
||||||
if (wordListN) {
|
if (wordListN) {
|
||||||
WordList wlNew;
|
WordList wlNew;
|
||||||
wlNew.Set(wl);
|
wlNew.Set(wl);
|
||||||
@ -312,7 +311,7 @@ int SCI_METHOD LexerBasic::WordListSet(int n, const char *wl) {
|
|||||||
return firstModification;
|
return firstModification;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SCI_METHOD LexerBasic::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
|
void SCI_METHOD LexerBasic::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) {
|
||||||
LexAccessor styler(pAccess);
|
LexAccessor styler(pAccess);
|
||||||
|
|
||||||
bool wasfirst = true, isfirst = true; // true if first token in a line
|
bool wasfirst = true, isfirst = true; // true if first token in a line
|
||||||
@ -471,17 +470,17 @@ void SCI_METHOD LexerBasic::Lex(unsigned int startPos, int length, int initStyle
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCI_METHOD LexerBasic::Fold(unsigned int startPos, int length, int /* initStyle */, IDocument *pAccess) {
|
void SCI_METHOD LexerBasic::Fold(Sci_PositionU startPos, Sci_Position length, int /* initStyle */, IDocument *pAccess) {
|
||||||
|
|
||||||
if (!options.fold)
|
if (!options.fold)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
LexAccessor styler(pAccess);
|
LexAccessor styler(pAccess);
|
||||||
|
|
||||||
int line = styler.GetLine(startPos);
|
Sci_Position line = styler.GetLine(startPos);
|
||||||
int level = styler.LevelAt(line);
|
int level = styler.LevelAt(line);
|
||||||
int go = 0, done = 0;
|
int go = 0, done = 0;
|
||||||
int endPos = startPos + length;
|
Sci_Position endPos = startPos + length;
|
||||||
char word[256];
|
char word[256];
|
||||||
int wordlen = 0;
|
int wordlen = 0;
|
||||||
const bool userDefinedFoldMarkers = !options.foldExplicitStart.empty() && !options.foldExplicitEnd.empty();
|
const bool userDefinedFoldMarkers = !options.foldExplicitStart.empty() && !options.foldExplicitEnd.empty();
|
||||||
@ -489,7 +488,7 @@ void SCI_METHOD LexerBasic::Fold(unsigned int startPos, int length, int /* initS
|
|||||||
|
|
||||||
// Scan for tokens at the start of the line (they may include
|
// Scan for tokens at the start of the line (they may include
|
||||||
// whitespace, for tokens like "End Function"
|
// whitespace, for tokens like "End Function"
|
||||||
for (int i = startPos; i < endPos; i++) {
|
for (Sci_Position i = startPos; i < endPos; i++) {
|
||||||
int c = cNext;
|
int c = cNext;
|
||||||
cNext = styler.SafeGetCharAt(i + 1);
|
cNext = styler.SafeGetCharAt(i + 1);
|
||||||
bool atEOL = (c == '\r' && cNext != '\n') || (c == '\n');
|
bool atEOL = (c == '\r' && cNext != '\n') || (c == '\n');
|
||||||
|
498
scintilla/lexers/LexBatch.cxx
Normal file
@ -0,0 +1,498 @@
|
|||||||
|
// Scintilla source code edit control
|
||||||
|
/** @file LexBatch.cxx
|
||||||
|
** Lexer for batch files.
|
||||||
|
**/
|
||||||
|
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
|
||||||
|
// The License.txt file describes the conditions under which this software may be distributed.
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <assert.h>
|
||||||
|
#include <ctype.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"
|
||||||
|
|
||||||
|
using namespace Scintilla;
|
||||||
|
|
||||||
|
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<char>(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<char>(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);
|
@ -30,9 +30,7 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
bool IsAlphabetic(unsigned int ch)
|
bool IsAlphabetic(unsigned int ch)
|
||||||
@ -76,7 +74,7 @@ namespace {
|
|||||||
return IsEntryStart(sc.chPrev, sc.ch);
|
return IsEntryStart(sc.chPrev, sc.ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorizeBibTeX(unsigned start_pos, int length, int /*init_style*/, WordList* keywordlists[], Accessor& styler)
|
void ColorizeBibTeX(Sci_PositionU start_pos, Sci_Position length, int /*init_style*/, WordList* keywordlists[], Accessor& styler)
|
||||||
{
|
{
|
||||||
WordList &EntryNames = *keywordlists[0];
|
WordList &EntryNames = *keywordlists[0];
|
||||||
bool fold_compact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
bool fold_compact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
||||||
@ -94,7 +92,7 @@ namespace {
|
|||||||
styler.StartAt(start_pos);
|
styler.StartAt(start_pos);
|
||||||
styler.StartSegment(start_pos);
|
styler.StartSegment(start_pos);
|
||||||
|
|
||||||
int current_line = styler.GetLine(start_pos);
|
Sci_Position current_line = styler.GetLine(start_pos);
|
||||||
int prev_level = styler.LevelAt(current_line) & SC_FOLDLEVELNUMBERMASK;
|
int prev_level = styler.LevelAt(current_line) & SC_FOLDLEVELNUMBERMASK;
|
||||||
int current_level = prev_level;
|
int current_level = prev_level;
|
||||||
int visible_chars = 0;
|
int visible_chars = 0;
|
||||||
@ -153,7 +151,7 @@ namespace {
|
|||||||
sc.SetState(SCE_BIBTEX_DEFAULT); // Don't colorize the =
|
sc.SetState(SCE_BIBTEX_DEFAULT); // Don't colorize the =
|
||||||
sc.ForwardSetState(SCE_BIBTEX_VALUE); // Parameter value colorization
|
sc.ForwardSetState(SCE_BIBTEX_VALUE); // Parameter value colorization
|
||||||
|
|
||||||
int start = sc.currentPos;
|
Sci_Position start = sc.currentPos;
|
||||||
|
|
||||||
// We need to handle multiple situations:
|
// We need to handle multiple situations:
|
||||||
// 1. name"one two {three}"
|
// 1. name"one two {three}"
|
||||||
@ -227,12 +225,12 @@ namespace {
|
|||||||
state = SCE_BIBTEX_DEFAULT;
|
state = SCE_BIBTEX_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
int end = sc.currentPos;
|
Sci_Position end = sc.currentPos;
|
||||||
current_line = styler.GetLine(end);
|
current_line = styler.GetLine(end);
|
||||||
|
|
||||||
// We have possibly skipped some lines, so the folding levels
|
// We have possibly skipped some lines, so the folding levels
|
||||||
// have to be adjusted separately
|
// have to be adjusted separately
|
||||||
for (int i = styler.GetLine(start); i <= styler.GetLine(end); ++i)
|
for (Sci_Position i = styler.GetLine(start); i <= styler.GetLine(end); ++i)
|
||||||
styler.SetLevel(i, prev_level);
|
styler.SetLevel(i, prev_level);
|
||||||
|
|
||||||
sc.ForwardSetState(state);
|
sc.ForwardSetState(state);
|
||||||
|
@ -19,14 +19,12 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
static int classifyWordBullant(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) {
|
static int classifyWordBullant(Sci_PositionU start, Sci_PositionU end, WordList &keywords, Accessor &styler) {
|
||||||
char s[100];
|
char s[100];
|
||||||
s[0] = '\0';
|
s[0] = '\0';
|
||||||
for (unsigned int i = 0; i < end - start + 1 && i < 30; i++) {
|
for (Sci_PositionU i = 0; i < end - start + 1 && i < 30; i++) {
|
||||||
s[i] = static_cast<char>(tolower(styler[start + i]));
|
s[i] = static_cast<char>(tolower(styler[start + i]));
|
||||||
s[i + 1] = '\0';
|
s[i + 1] = '\0';
|
||||||
}
|
}
|
||||||
@ -58,14 +56,14 @@ static int classifyWordBullant(unsigned int start, unsigned int end, WordList &k
|
|||||||
return lev;
|
return lev;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ColouriseBullantDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
|
static void ColouriseBullantDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[],
|
||||||
Accessor &styler) {
|
Accessor &styler) {
|
||||||
WordList &keywords = *keywordlists[0];
|
WordList &keywords = *keywordlists[0];
|
||||||
|
|
||||||
styler.StartAt(startPos);
|
styler.StartAt(startPos);
|
||||||
|
|
||||||
bool fold = styler.GetPropertyInt("fold") != 0;
|
bool fold = styler.GetPropertyInt("fold") != 0;
|
||||||
int lineCurrent = styler.GetLine(startPos);
|
Sci_Position lineCurrent = styler.GetLine(startPos);
|
||||||
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
|
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
|
||||||
int levelCurrent = levelPrev;
|
int levelCurrent = levelPrev;
|
||||||
|
|
||||||
@ -74,11 +72,11 @@ static void ColouriseBullantDoc(unsigned int startPos, int length, int initStyle
|
|||||||
state = SCE_C_DEFAULT;
|
state = SCE_C_DEFAULT;
|
||||||
char chPrev = ' ';
|
char chPrev = ' ';
|
||||||
char chNext = styler[startPos];
|
char chNext = styler[startPos];
|
||||||
unsigned int lengthDoc = startPos + length;
|
Sci_PositionU lengthDoc = startPos + length;
|
||||||
int visibleChars = 0;
|
int visibleChars = 0;
|
||||||
styler.StartSegment(startPos);
|
styler.StartSegment(startPos);
|
||||||
int endFoundThisLine = 0;
|
int endFoundThisLine = 0;
|
||||||
for (unsigned int i = startPos; i < lengthDoc; i++) {
|
for (Sci_PositionU i = startPos; i < lengthDoc; i++) {
|
||||||
char ch = chNext;
|
char ch = chNext;
|
||||||
chNext = styler.SafeGetCharAt(i + 1);
|
chNext = styler.SafeGetCharAt(i + 1);
|
||||||
|
|
||||||
|
404
scintilla/lexers/LexCIL.cxx
Normal file
@ -0,0 +1,404 @@
|
|||||||
|
// Scintilla source code edit control
|
||||||
|
/** @file LexCIL.cxx
|
||||||
|
** Lexer for Common Intermediate Language
|
||||||
|
** Written by Jad Altahan (github.com/xv)
|
||||||
|
** CIL manual: https://www.ecma-international.org/publications/standards/Ecma-335.htm
|
||||||
|
**/
|
||||||
|
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
|
||||||
|
// The License.txt file describes the conditions under which this software may be distributed.
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <assert.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <map>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
#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 "CharacterCategory.h"
|
||||||
|
#include "LexerModule.h"
|
||||||
|
#include "OptionSet.h"
|
||||||
|
#include "DefaultLexer.h"
|
||||||
|
|
||||||
|
using namespace Scintilla;
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
// Use an unnamed namespace to protect the functions and classes from name conflicts
|
||||||
|
|
||||||
|
bool IsAWordChar(const int ch) {
|
||||||
|
return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.');
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsOperator(const int ch) {
|
||||||
|
if ((ch < 0x80) && (isalnum(ch)))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (strchr("!%&*+-/<=>@^|~()[]{}", ch)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr bool IsStreamCommentStyle(const int style) noexcept {
|
||||||
|
return style == SCE_CIL_COMMENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct OptionsCIL {
|
||||||
|
bool fold;
|
||||||
|
bool foldComment;
|
||||||
|
bool foldCommentMultiline;
|
||||||
|
bool foldCompact;
|
||||||
|
|
||||||
|
OptionsCIL() {
|
||||||
|
fold = true;
|
||||||
|
foldComment = false;
|
||||||
|
foldCommentMultiline = true;
|
||||||
|
foldCompact = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
static const char *const cilWordListDesc[] = {
|
||||||
|
"Primary CIL keywords",
|
||||||
|
"Metadata",
|
||||||
|
"Opcode instructions",
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
struct OptionSetCIL : public OptionSet<OptionsCIL> {
|
||||||
|
OptionSetCIL() {
|
||||||
|
DefineProperty("fold", &OptionsCIL::fold);
|
||||||
|
DefineProperty("fold.comment", &OptionsCIL::foldComment);
|
||||||
|
|
||||||
|
DefineProperty("fold.cil.comment.multiline", &OptionsCIL::foldCommentMultiline,
|
||||||
|
"Set this property to 0 to disable folding multi-line comments when fold.comment=1.");
|
||||||
|
|
||||||
|
DefineProperty("fold.compact", &OptionsCIL::foldCompact);
|
||||||
|
|
||||||
|
DefineWordListSets(cilWordListDesc);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
LexicalClass lexicalClasses[] = {
|
||||||
|
// Lexer CIL SCLEX_CIL SCE_CIL_:
|
||||||
|
0, "SCE_CIL_DEFAULT", "default", "White space",
|
||||||
|
1, "SCE_CIL_COMMENT", "comment", "Multi-line comment",
|
||||||
|
2, "SCE_CIL_COMMENTLINE", "comment line", "Line comment",
|
||||||
|
3, "SCE_CIL_WORD", "keyword", "Keyword 1",
|
||||||
|
4, "SCE_CIL_WORD2", "keyword", "Keyword 2",
|
||||||
|
5, "SCE_CIL_WORD3", "keyword", "Keyword 3",
|
||||||
|
6, "SCE_CIL_STRING", "literal string", "Double quoted string",
|
||||||
|
7, "SCE_CIL_LABEL", "label", "Code label",
|
||||||
|
8, "SCE_CIL_OPERATOR", "operator", "Operators",
|
||||||
|
9, "SCE_CIL_STRINGEOL", "error literal string", "String is not closed",
|
||||||
|
10, "SCE_CIL_IDENTIFIER", "identifier", "Identifiers",
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class LexerCIL : public DefaultLexer {
|
||||||
|
WordList keywords, keywords2, keywords3;
|
||||||
|
OptionsCIL options;
|
||||||
|
OptionSetCIL osCIL;
|
||||||
|
|
||||||
|
public:
|
||||||
|
LexerCIL() : DefaultLexer(lexicalClasses, ELEMENTS(lexicalClasses)) { }
|
||||||
|
|
||||||
|
virtual ~LexerCIL() { }
|
||||||
|
|
||||||
|
void SCI_METHOD Release() override {
|
||||||
|
delete this;
|
||||||
|
}
|
||||||
|
|
||||||
|
int SCI_METHOD Version() const override {
|
||||||
|
return lvRelease4;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char * SCI_METHOD PropertyNames() override {
|
||||||
|
return osCIL.PropertyNames();
|
||||||
|
}
|
||||||
|
|
||||||
|
int SCI_METHOD PropertyType(const char *name) override {
|
||||||
|
return osCIL.PropertyType(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
const char * SCI_METHOD DescribeProperty(const char *name) override {
|
||||||
|
return osCIL.DescribeProperty(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
Sci_Position SCI_METHOD PropertySet(const char *key, const char *val) override;
|
||||||
|
|
||||||
|
const char * SCI_METHOD DescribeWordListSets() override {
|
||||||
|
return osCIL.DescribeWordListSets();
|
||||||
|
}
|
||||||
|
|
||||||
|
Sci_Position SCI_METHOD WordListSet(int n, const char *wl) override;
|
||||||
|
|
||||||
|
void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) override;
|
||||||
|
void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) override;
|
||||||
|
|
||||||
|
void * SCI_METHOD PrivateCall(int, void *) override {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int SCI_METHOD LineEndTypesSupported() override {
|
||||||
|
return SC_LINE_END_TYPE_UNICODE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int SCI_METHOD PrimaryStyleFromStyle(int style) override {
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
|
||||||
|
static ILexer4 *LexerFactoryCIL() {
|
||||||
|
return new LexerCIL();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Sci_Position SCI_METHOD LexerCIL::PropertySet(const char *key, const char *val) {
|
||||||
|
if (osCIL.PropertySet(&options, key, val)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
Sci_Position SCI_METHOD LexerCIL::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;
|
||||||
|
}
|
||||||
|
|
||||||
|
Sci_Position firstModification = -1;
|
||||||
|
|
||||||
|
if (wordListN) {
|
||||||
|
WordList wlNew;
|
||||||
|
wlNew.Set(wl);
|
||||||
|
|
||||||
|
if (*wordListN != wlNew) {
|
||||||
|
wordListN->Set(wl);
|
||||||
|
firstModification = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return firstModification;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SCI_METHOD LexerCIL::Lex(Sci_PositionU startPos, Sci_Position length,
|
||||||
|
int initStyle, IDocument *pAccess) {
|
||||||
|
if (initStyle == SCE_CIL_STRINGEOL) {
|
||||||
|
initStyle = SCE_CIL_DEFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
|
Accessor styler(pAccess, NULL);
|
||||||
|
StyleContext sc(startPos, length, initStyle, styler);
|
||||||
|
|
||||||
|
bool identAtLineStart = false, // Checks if an identifier is at line start (ignoring spaces)
|
||||||
|
canStyleLabels = false; // Checks if conditions are met to style SCE_CIL_LABEL
|
||||||
|
|
||||||
|
for (; sc.More(); sc.Forward()) {
|
||||||
|
if (sc.atLineStart) {
|
||||||
|
if (sc.state == SCE_CIL_STRING) {
|
||||||
|
sc.SetState(SCE_CIL_STRING);
|
||||||
|
}
|
||||||
|
|
||||||
|
identAtLineStart = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Handle string line continuation
|
||||||
|
if (sc.ch == '\\' && (sc.chNext == '\n' || sc.chNext == '\r') &&
|
||||||
|
(sc.state == SCE_CIL_STRING)) {
|
||||||
|
sc.Forward();
|
||||||
|
|
||||||
|
if (sc.ch == '\r' && sc.chNext == '\n') {
|
||||||
|
sc.Forward();
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (sc.state) {
|
||||||
|
case SCE_CIL_OPERATOR:
|
||||||
|
sc.SetState(SCE_CIL_DEFAULT);
|
||||||
|
break;
|
||||||
|
case SCE_CIL_IDENTIFIER:
|
||||||
|
if (!IsAWordChar(sc.ch)) {
|
||||||
|
if (canStyleLabels && (sc.ch == ':' && sc.chNext != ':')) {
|
||||||
|
sc.ChangeState(SCE_CIL_LABEL);
|
||||||
|
sc.ForwardSetState(SCE_CIL_DEFAULT);
|
||||||
|
} else {
|
||||||
|
char kwSize[100];
|
||||||
|
sc.GetCurrent(kwSize, sizeof(kwSize));
|
||||||
|
int style = SCE_CIL_IDENTIFIER;
|
||||||
|
|
||||||
|
if (keywords.InList(kwSize)) {
|
||||||
|
style = SCE_CIL_WORD;
|
||||||
|
} else if (keywords2.InList(kwSize)) {
|
||||||
|
style = SCE_CIL_WORD2;
|
||||||
|
} else if (keywords3.InList(kwSize)) {
|
||||||
|
style = SCE_CIL_WORD3;
|
||||||
|
}
|
||||||
|
|
||||||
|
sc.ChangeState(style);
|
||||||
|
sc.SetState(SCE_CIL_DEFAULT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SCE_CIL_COMMENT:
|
||||||
|
if (sc.Match('*', '/')) {
|
||||||
|
sc.Forward();
|
||||||
|
sc.ForwardSetState(SCE_CIL_DEFAULT);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SCE_CIL_COMMENTLINE:
|
||||||
|
if (sc.atLineStart) {
|
||||||
|
sc.SetState(SCE_CIL_DEFAULT);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SCE_CIL_STRING:
|
||||||
|
if (sc.ch == '\\') {
|
||||||
|
if (sc.chNext == '"' || sc.chNext == '\\') {
|
||||||
|
sc.Forward();
|
||||||
|
}
|
||||||
|
} else if (sc.ch == '"') {
|
||||||
|
sc.ForwardSetState(SCE_CIL_DEFAULT);
|
||||||
|
} else if (sc.atLineEnd) {
|
||||||
|
sc.ChangeState(SCE_CIL_STRINGEOL);
|
||||||
|
sc.ForwardSetState(SCE_CIL_DEFAULT);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sc.state == SCE_CIL_DEFAULT) {
|
||||||
|
// String
|
||||||
|
if (sc.ch == '"') {
|
||||||
|
sc.SetState(SCE_CIL_STRING);
|
||||||
|
}
|
||||||
|
// Keyword
|
||||||
|
else if (IsAWordChar(sc.ch)) {
|
||||||
|
// Allow setting SCE_CIL_LABEL style only if the label is the
|
||||||
|
// first token in the line and does not start with a dot or a digit
|
||||||
|
canStyleLabels = identAtLineStart && !(sc.ch == '.' || IsADigit(sc.ch));
|
||||||
|
sc.SetState(SCE_CIL_IDENTIFIER);
|
||||||
|
}
|
||||||
|
// Multi-line comment
|
||||||
|
else if (sc.Match('/', '*')) {
|
||||||
|
sc.SetState(SCE_CIL_COMMENT);
|
||||||
|
sc.Forward();
|
||||||
|
}
|
||||||
|
// Line comment
|
||||||
|
else if (sc.Match('/', '/')) {
|
||||||
|
sc.SetState(SCE_CIL_COMMENTLINE);
|
||||||
|
}
|
||||||
|
// Operators
|
||||||
|
else if (IsOperator(sc.ch)) {
|
||||||
|
sc.SetState(SCE_CIL_OPERATOR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IsASpace(sc.ch)) {
|
||||||
|
identAtLineStart = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sc.Complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SCI_METHOD LexerCIL::Fold(Sci_PositionU startPos, Sci_Position length,
|
||||||
|
int initStyle, IDocument *pAccess) {
|
||||||
|
if (!options.fold) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LexAccessor styler(pAccess);
|
||||||
|
|
||||||
|
const Sci_PositionU endPos = startPos + length;
|
||||||
|
Sci_Position lineCurrent = styler.GetLine(startPos);
|
||||||
|
|
||||||
|
int levelCurrent = SC_FOLDLEVELBASE;
|
||||||
|
if (lineCurrent > 0)
|
||||||
|
levelCurrent = styler.LevelAt(lineCurrent - 1) >> 16;
|
||||||
|
|
||||||
|
int style = initStyle;
|
||||||
|
int styleNext = styler.StyleAt(startPos);
|
||||||
|
int levelNext = levelCurrent;
|
||||||
|
int visibleChars = 0;
|
||||||
|
|
||||||
|
char chNext = styler[startPos];
|
||||||
|
|
||||||
|
for (Sci_PositionU i = startPos; i < endPos; i++) {
|
||||||
|
const char ch = chNext;
|
||||||
|
int stylePrev = style;
|
||||||
|
|
||||||
|
chNext = styler.SafeGetCharAt(i + 1);
|
||||||
|
style = styleNext;
|
||||||
|
styleNext = styler.StyleAt(i + 1);
|
||||||
|
|
||||||
|
const bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
|
||||||
|
|
||||||
|
if (options.foldComment &&
|
||||||
|
options.foldCommentMultiline && IsStreamCommentStyle(style)) {
|
||||||
|
if (!IsStreamCommentStyle(stylePrev)) {
|
||||||
|
levelNext++;
|
||||||
|
} else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
|
||||||
|
levelNext--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (style == SCE_CIL_OPERATOR) {
|
||||||
|
if (ch == '{') {
|
||||||
|
levelNext++;
|
||||||
|
} else if (ch == '}') {
|
||||||
|
levelNext--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IsASpace(ch)) {
|
||||||
|
visibleChars++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (atEOL || (i == endPos - 1)) {
|
||||||
|
int lev = levelCurrent | levelNext << 16;
|
||||||
|
if (visibleChars == 0 && options.foldCompact)
|
||||||
|
lev |= SC_FOLDLEVELWHITEFLAG;
|
||||||
|
if (levelCurrent < levelNext)
|
||||||
|
lev |= SC_FOLDLEVELHEADERFLAG;
|
||||||
|
if (lev != styler.LevelAt(lineCurrent)) {
|
||||||
|
styler.SetLevel(lineCurrent, lev);
|
||||||
|
}
|
||||||
|
|
||||||
|
lineCurrent++;
|
||||||
|
levelCurrent = levelNext;
|
||||||
|
|
||||||
|
if (options.foldCompact &&
|
||||||
|
i == static_cast<Sci_PositionU>(styler.Length() - 1)) {
|
||||||
|
styler.SetLevel(lineCurrent, lev | SC_FOLDLEVELWHITEFLAG);
|
||||||
|
}
|
||||||
|
|
||||||
|
visibleChars = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LexerModule lmCIL(SCLEX_CIL, LexerCIL::LexerFactoryCIL, "cil", cilWordListDesc);
|
@ -24,9 +24,7 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
// Is an end of line character
|
// Is an end of line character
|
||||||
inline bool IsEOL(const int ch) {
|
inline bool IsEOL(const int ch) {
|
||||||
@ -142,12 +140,12 @@ inline bool SetNumericConstantState(StyleContext &scDoc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the next word in uppercase from the current position (keyword lookahead)
|
// Get the next word in uppercase from the current position (keyword lookahead)
|
||||||
inline bool GetNextWordUpper(Accessor &styler, unsigned int uiStartPos, int iLength, char *cWord) {
|
inline bool GetNextWordUpper(Accessor &styler, Sci_PositionU uiStartPos, Sci_Position iLength, char *cWord) {
|
||||||
|
|
||||||
unsigned int iIndex = 0; // Buffer Index
|
Sci_PositionU iIndex = 0; // Buffer Index
|
||||||
|
|
||||||
// Loop through the remaining string from the current position
|
// Loop through the remaining string from the current position
|
||||||
for (int iOffset = uiStartPos; iOffset < iLength; iOffset++) {
|
for (Sci_Position iOffset = uiStartPos; iOffset < iLength; iOffset++) {
|
||||||
// Get the character from the buffer using the offset
|
// Get the character from the buffer using the offset
|
||||||
char cCharacter = styler[iOffset];
|
char cCharacter = styler[iOffset];
|
||||||
if (IsEOL(cCharacter)) {
|
if (IsEOL(cCharacter)) {
|
||||||
@ -174,7 +172,7 @@ inline bool GetNextWordUpper(Accessor &styler, unsigned int uiStartPos, int iLen
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Clarion Language Colouring Procedure
|
// Clarion Language Colouring Procedure
|
||||||
static void ColouriseClarionDoc(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler, bool bCaseSensitive) {
|
static void ColouriseClarionDoc(Sci_PositionU uiStartPos, Sci_Position iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler, bool bCaseSensitive) {
|
||||||
|
|
||||||
int iParenthesesLevel = 0; // Parenthese Level
|
int iParenthesesLevel = 0; // Parenthese Level
|
||||||
int iColumn1Label = false; // Label starts in Column 1
|
int iColumn1Label = false; // Label starts in Column 1
|
||||||
@ -521,22 +519,22 @@ static void ColouriseClarionDoc(unsigned int uiStartPos, int iLength, int iInitS
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Clarion Language Case Sensitive Colouring Procedure
|
// Clarion Language Case Sensitive Colouring Procedure
|
||||||
static void ColouriseClarionDocSensitive(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler) {
|
static void ColouriseClarionDocSensitive(Sci_PositionU uiStartPos, Sci_Position iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler) {
|
||||||
|
|
||||||
ColouriseClarionDoc(uiStartPos, iLength, iInitStyle, wlKeywords, accStyler, true);
|
ColouriseClarionDoc(uiStartPos, iLength, iInitStyle, wlKeywords, accStyler, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clarion Language Case Insensitive Colouring Procedure
|
// Clarion Language Case Insensitive Colouring Procedure
|
||||||
static void ColouriseClarionDocInsensitive(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler) {
|
static void ColouriseClarionDocInsensitive(Sci_PositionU uiStartPos, Sci_Position iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler) {
|
||||||
|
|
||||||
ColouriseClarionDoc(uiStartPos, iLength, iInitStyle, wlKeywords, accStyler, false);
|
ColouriseClarionDoc(uiStartPos, iLength, iInitStyle, wlKeywords, accStyler, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill Buffer
|
// Fill Buffer
|
||||||
|
|
||||||
static void FillBuffer(unsigned int uiStart, unsigned int uiEnd, Accessor &accStyler, char *szBuffer, unsigned int uiLength) {
|
static void FillBuffer(Sci_PositionU uiStart, Sci_PositionU uiEnd, Accessor &accStyler, char *szBuffer, Sci_PositionU uiLength) {
|
||||||
|
|
||||||
unsigned int uiPos = 0;
|
Sci_PositionU uiPos = 0;
|
||||||
|
|
||||||
while ((uiPos < uiEnd - uiStart + 1) && (uiPos < uiLength-1)) {
|
while ((uiPos < uiEnd - uiStart + 1) && (uiPos < uiLength-1)) {
|
||||||
szBuffer[uiPos] = static_cast<char>(toupper(accStyler[uiStart + uiPos]));
|
szBuffer[uiPos] = static_cast<char>(toupper(accStyler[uiStart + uiPos]));
|
||||||
@ -599,19 +597,19 @@ static int ClassifyClarionFoldPoint(int iLevel, const char* szString) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Clarion Language Folding Procedure
|
// Clarion Language Folding Procedure
|
||||||
static void FoldClarionDoc(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *[], Accessor &accStyler) {
|
static void FoldClarionDoc(Sci_PositionU uiStartPos, Sci_Position iLength, int iInitStyle, WordList *[], Accessor &accStyler) {
|
||||||
|
|
||||||
unsigned int uiEndPos = uiStartPos + iLength;
|
Sci_PositionU uiEndPos = uiStartPos + iLength;
|
||||||
int iLineCurrent = accStyler.GetLine(uiStartPos);
|
Sci_Position iLineCurrent = accStyler.GetLine(uiStartPos);
|
||||||
int iLevelPrev = accStyler.LevelAt(iLineCurrent) & SC_FOLDLEVELNUMBERMASK;
|
int iLevelPrev = accStyler.LevelAt(iLineCurrent) & SC_FOLDLEVELNUMBERMASK;
|
||||||
int iLevelCurrent = iLevelPrev;
|
int iLevelCurrent = iLevelPrev;
|
||||||
char chNext = accStyler[uiStartPos];
|
char chNext = accStyler[uiStartPos];
|
||||||
int iStyle = iInitStyle;
|
int iStyle = iInitStyle;
|
||||||
int iStyleNext = accStyler.StyleAt(uiStartPos);
|
int iStyleNext = accStyler.StyleAt(uiStartPos);
|
||||||
int iVisibleChars = 0;
|
int iVisibleChars = 0;
|
||||||
int iLastStart = 0;
|
Sci_Position iLastStart = 0;
|
||||||
|
|
||||||
for (unsigned int uiPos = uiStartPos; uiPos < uiEndPos; uiPos++) {
|
for (Sci_PositionU uiPos = uiStartPos; uiPos < uiEndPos; uiPos++) {
|
||||||
|
|
||||||
char chChar = chNext;
|
char chChar = chNext;
|
||||||
chNext = accStyler.SafeGetCharAt(uiPos + 1);
|
chNext = accStyler.SafeGetCharAt(uiPos + 1);
|
||||||
|
@ -26,9 +26,7 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
#define IN_DIVISION 0x01
|
#define IN_DIVISION 0x01
|
||||||
#define IN_DECLARATIVES 0x02
|
#define IN_DECLARATIVES 0x02
|
||||||
@ -64,12 +62,12 @@ static int CountBits(int nBits)
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void getRange(unsigned int start,
|
static void getRange(Sci_PositionU start,
|
||||||
unsigned int end,
|
Sci_PositionU end,
|
||||||
Accessor &styler,
|
Accessor &styler,
|
||||||
char *s,
|
char *s,
|
||||||
unsigned int len) {
|
Sci_PositionU len) {
|
||||||
unsigned int i = 0;
|
Sci_PositionU i = 0;
|
||||||
while ((i < end - start + 1) && (i < len-1)) {
|
while ((i < end - start + 1) && (i < len-1)) {
|
||||||
s[i] = static_cast<char>(tolower(styler[start + i]));
|
s[i] = static_cast<char>(tolower(styler[start + i]));
|
||||||
i++;
|
i++;
|
||||||
@ -77,12 +75,12 @@ static void getRange(unsigned int start,
|
|||||||
s[i] = '\0';
|
s[i] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ColourTo(Accessor &styler, unsigned int end, unsigned int attr) {
|
static void ColourTo(Accessor &styler, Sci_PositionU end, unsigned int attr) {
|
||||||
styler.ColourTo(end, attr);
|
styler.ColourTo(end, attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int classifyWordCOBOL(unsigned int start, unsigned int end, /*WordList &keywords*/WordList *keywordlists[], Accessor &styler, int nContainment, bool *bAarea) {
|
static int classifyWordCOBOL(Sci_PositionU start, Sci_PositionU end, /*WordList &keywords*/WordList *keywordlists[], Accessor &styler, int nContainment, bool *bAarea) {
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
WordList& a_keywords = *keywordlists[0];
|
WordList& a_keywords = *keywordlists[0];
|
||||||
@ -142,7 +140,7 @@ static int classifyWordCOBOL(unsigned int start, unsigned int end, /*WordList &k
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ColouriseCOBOLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
|
static void ColouriseCOBOLDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[],
|
||||||
Accessor &styler) {
|
Accessor &styler) {
|
||||||
|
|
||||||
styler.StartAt(startPos);
|
styler.StartAt(startPos);
|
||||||
@ -152,11 +150,11 @@ static void ColouriseCOBOLDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
state = SCE_C_DEFAULT;
|
state = SCE_C_DEFAULT;
|
||||||
char chPrev = ' ';
|
char chPrev = ' ';
|
||||||
char chNext = styler[startPos];
|
char chNext = styler[startPos];
|
||||||
unsigned int lengthDoc = startPos + length;
|
Sci_PositionU lengthDoc = startPos + length;
|
||||||
|
|
||||||
int nContainment;
|
int nContainment;
|
||||||
|
|
||||||
int currentLine = styler.GetLine(startPos);
|
Sci_Position currentLine = styler.GetLine(startPos);
|
||||||
if (currentLine > 0) {
|
if (currentLine > 0) {
|
||||||
styler.SetLineState(currentLine, styler.GetLineState(currentLine-1));
|
styler.SetLineState(currentLine, styler.GetLineState(currentLine-1));
|
||||||
nContainment = styler.GetLineState(currentLine);
|
nContainment = styler.GetLineState(currentLine);
|
||||||
@ -170,7 +168,7 @@ static void ColouriseCOBOLDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
bool bNewLine = true;
|
bool bNewLine = true;
|
||||||
bool bAarea = !isspacechar(chNext);
|
bool bAarea = !isspacechar(chNext);
|
||||||
int column = 0;
|
int column = 0;
|
||||||
for (unsigned int i = startPos; i < lengthDoc; i++) {
|
for (Sci_PositionU i = startPos; i < lengthDoc; i++) {
|
||||||
char ch = chNext;
|
char ch = chNext;
|
||||||
|
|
||||||
chNext = styler.SafeGetCharAt(i + 1);
|
chNext = styler.SafeGetCharAt(i + 1);
|
||||||
@ -277,7 +275,7 @@ static void ColouriseCOBOLDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
if (ch == '\r' || ch == '\n') {
|
if (ch == '\r' || ch == '\n') {
|
||||||
if (((i > styler.GetStartSegment() + 2) || (
|
if (((i > styler.GetStartSegment() + 2) || (
|
||||||
(initStyle == SCE_C_COMMENTDOC) &&
|
(initStyle == SCE_C_COMMENTDOC) &&
|
||||||
(styler.GetStartSegment() == static_cast<unsigned int>(startPos))))) {
|
(styler.GetStartSegment() == static_cast<Sci_PositionU>(startPos))))) {
|
||||||
ColourTo(styler, i, state);
|
ColourTo(styler, i, state);
|
||||||
state = SCE_C_DEFAULT;
|
state = SCE_C_DEFAULT;
|
||||||
}
|
}
|
||||||
@ -309,12 +307,12 @@ static void ColouriseCOBOLDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
ColourTo(styler, lengthDoc - 1, state);
|
ColourTo(styler, lengthDoc - 1, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FoldCOBOLDoc(unsigned int startPos, int length, int, WordList *[],
|
static void FoldCOBOLDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *[],
|
||||||
Accessor &styler) {
|
Accessor &styler) {
|
||||||
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
||||||
unsigned int endPos = startPos + length;
|
Sci_PositionU endPos = startPos + length;
|
||||||
int visibleChars = 0;
|
int visibleChars = 0;
|
||||||
int lineCurrent = styler.GetLine(startPos);
|
Sci_Position lineCurrent = styler.GetLine(startPos);
|
||||||
int levelPrev = lineCurrent > 0 ? styler.LevelAt(lineCurrent - 1) & SC_FOLDLEVELNUMBERMASK : 0xFFF;
|
int levelPrev = lineCurrent > 0 ? styler.LevelAt(lineCurrent - 1) & SC_FOLDLEVELNUMBERMASK : 0xFFF;
|
||||||
char chNext = styler[startPos];
|
char chNext = styler[startPos];
|
||||||
|
|
||||||
@ -322,7 +320,7 @@ static void FoldCOBOLDoc(unsigned int startPos, int length, int, WordList *[],
|
|||||||
bool bAarea = !isspacechar(chNext);
|
bool bAarea = !isspacechar(chNext);
|
||||||
int column = 0;
|
int column = 0;
|
||||||
bool bComment = false;
|
bool bComment = false;
|
||||||
for (unsigned int i = startPos; i < endPos; i++) {
|
for (Sci_PositionU i = startPos; i < endPos; i++) {
|
||||||
char ch = chNext;
|
char ch = chNext;
|
||||||
chNext = styler.SafeGetCharAt(i + 1);
|
chNext = styler.SafeGetCharAt(i + 1);
|
||||||
++column;
|
++column;
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
@ -22,6 +23,7 @@
|
|||||||
#include "Scintilla.h"
|
#include "Scintilla.h"
|
||||||
#include "SciLexer.h"
|
#include "SciLexer.h"
|
||||||
|
|
||||||
|
#include "StringCopy.h"
|
||||||
#include "WordList.h"
|
#include "WordList.h"
|
||||||
#include "LexAccessor.h"
|
#include "LexAccessor.h"
|
||||||
#include "Accessor.h"
|
#include "Accessor.h"
|
||||||
@ -32,14 +34,12 @@
|
|||||||
#include "SparseState.h"
|
#include "SparseState.h"
|
||||||
#include "SubStyles.h"
|
#include "SubStyles.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
// Use an unnamed namespace to protect the functions and classes from name conflicts
|
// Use an unnamed namespace to protect the functions and classes from name conflicts
|
||||||
|
|
||||||
bool IsSpaceEquiv(int state) {
|
bool IsSpaceEquiv(int state) noexcept {
|
||||||
return (state <= SCE_C_COMMENTDOC) ||
|
return (state <= SCE_C_COMMENTDOC) ||
|
||||||
// including SCE_C_DEFAULT, SCE_C_COMMENT, SCE_C_COMMENTLINE
|
// including SCE_C_DEFAULT, SCE_C_COMMENT, SCE_C_COMMENTLINE
|
||||||
(state == SCE_C_COMMENTLINEDOC) || (state == SCE_C_COMMENTDOCKEYWORD) ||
|
(state == SCE_C_COMMENTLINEDOC) || (state == SCE_C_COMMENTDOCKEYWORD) ||
|
||||||
@ -53,10 +53,10 @@ bool IsSpaceEquiv(int state) {
|
|||||||
// a = b+++/ptn/...
|
// a = b+++/ptn/...
|
||||||
// Putting a space between the '++' post-inc operator and the '+' binary op
|
// Putting a space between the '++' post-inc operator and the '+' binary op
|
||||||
// fixes this, and is highly recommended for readability anyway.
|
// fixes this, and is highly recommended for readability anyway.
|
||||||
bool FollowsPostfixOperator(StyleContext &sc, LexAccessor &styler) {
|
bool FollowsPostfixOperator(const StyleContext &sc, LexAccessor &styler) {
|
||||||
int pos = (int) sc.currentPos;
|
Sci_Position pos = sc.currentPos;
|
||||||
while (--pos > 0) {
|
while (--pos > 0) {
|
||||||
char ch = styler[pos];
|
const char ch = styler[pos];
|
||||||
if (ch == '+' || ch == '-') {
|
if (ch == '+' || ch == '-') {
|
||||||
return styler[pos - 1] == ch;
|
return styler[pos - 1] == ch;
|
||||||
}
|
}
|
||||||
@ -64,13 +64,13 @@ bool FollowsPostfixOperator(StyleContext &sc, LexAccessor &styler) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool followsReturnKeyword(StyleContext &sc, LexAccessor &styler) {
|
bool followsReturnKeyword(const StyleContext &sc, LexAccessor &styler) {
|
||||||
// Don't look at styles, so no need to flush.
|
// Don't look at styles, so no need to flush.
|
||||||
int pos = (int) sc.currentPos;
|
Sci_Position pos = sc.currentPos;
|
||||||
int currentLine = styler.GetLine(pos);
|
const Sci_Position currentLine = styler.GetLine(pos);
|
||||||
int lineStartPos = styler.LineStart(currentLine);
|
const Sci_Position lineStartPos = styler.LineStart(currentLine);
|
||||||
while (--pos > lineStartPos) {
|
while (--pos > lineStartPos) {
|
||||||
char ch = styler.SafeGetCharAt(pos);
|
const char ch = styler.SafeGetCharAt(pos);
|
||||||
if (ch != ' ' && ch != '\t') {
|
if (ch != ' ' && ch != '\t') {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -86,13 +86,13 @@ bool followsReturnKeyword(StyleContext &sc, LexAccessor &styler) {
|
|||||||
return !*s;
|
return !*s;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsSpaceOrTab(int ch) {
|
bool IsSpaceOrTab(int ch) noexcept {
|
||||||
return ch == ' ' || ch == '\t';
|
return ch == ' ' || ch == '\t';
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OnlySpaceOrTab(const std::string &s) {
|
bool OnlySpaceOrTab(const std::string &s) noexcept {
|
||||||
for (std::string::const_iterator it = s.begin(); it != s.end(); ++it) {
|
for (const char ch : s) {
|
||||||
if (!IsSpaceOrTab(*it))
|
if (!IsSpaceOrTab(ch))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -100,11 +100,11 @@ bool OnlySpaceOrTab(const std::string &s) {
|
|||||||
|
|
||||||
std::vector<std::string> StringSplit(const std::string &text, int separator) {
|
std::vector<std::string> StringSplit(const std::string &text, int separator) {
|
||||||
std::vector<std::string> vs(text.empty() ? 0 : 1);
|
std::vector<std::string> vs(text.empty() ? 0 : 1);
|
||||||
for (std::string::const_iterator it = text.begin(); it != text.end(); ++it) {
|
for (const char ch : text) {
|
||||||
if (*it == separator) {
|
if (ch == separator) {
|
||||||
vs.push_back(std::string());
|
vs.emplace_back();
|
||||||
} else {
|
} else {
|
||||||
vs.back() += *it;
|
vs.back() += ch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return vs;
|
return vs;
|
||||||
@ -141,21 +141,21 @@ BracketPair FindBracketPair(std::vector<std::string> &tokens) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void highlightTaskMarker(StyleContext &sc, LexAccessor &styler,
|
void highlightTaskMarker(StyleContext &sc, LexAccessor &styler,
|
||||||
int activity, WordList &markerList, bool caseSensitive){
|
int activity, const WordList &markerList, bool caseSensitive){
|
||||||
if ((isoperator(sc.chPrev) || IsASpace(sc.chPrev)) && markerList.Length()) {
|
if ((isoperator(sc.chPrev) || IsASpace(sc.chPrev)) && markerList.Length()) {
|
||||||
const int lengthMarker = 50;
|
const int lengthMarker = 50;
|
||||||
char marker[lengthMarker+1];
|
char marker[lengthMarker+1] = "";
|
||||||
int currPos = (int) sc.currentPos;
|
const Sci_Position currPos = static_cast<Sci_Position>(sc.currentPos);
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (i < lengthMarker) {
|
while (i < lengthMarker) {
|
||||||
char ch = styler.SafeGetCharAt(currPos + i);
|
const char ch = styler.SafeGetCharAt(currPos + i);
|
||||||
if (IsASpace(ch) || isoperator(ch)) {
|
if (IsASpace(ch) || isoperator(ch)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (caseSensitive)
|
if (caseSensitive)
|
||||||
marker[i] = ch;
|
marker[i] = ch;
|
||||||
else
|
else
|
||||||
marker[i] = static_cast<char>(tolower(ch));
|
marker[i] = MakeLowerCase(ch);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
marker[i] = '\0';
|
marker[i] = '\0';
|
||||||
@ -199,24 +199,34 @@ struct EscapeSequence {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string GetRestOfLine(LexAccessor &styler, int start, bool allowSpace) {
|
std::string GetRestOfLine(LexAccessor &styler, Sci_Position start, bool allowSpace) {
|
||||||
std::string restOfLine;
|
std::string restOfLine;
|
||||||
int i =0;
|
Sci_Position line = styler.GetLine(start);
|
||||||
|
Sci_Position pos = start;
|
||||||
|
Sci_Position endLine = styler.LineEnd(line);
|
||||||
char ch = styler.SafeGetCharAt(start, '\n');
|
char ch = styler.SafeGetCharAt(start, '\n');
|
||||||
int endLine = styler.LineEnd(styler.GetLine(start));
|
while (pos < endLine) {
|
||||||
while (((start+i) < endLine) && (ch != '\r')) {
|
if (ch == '\\' && ((pos + 1) == endLine)) {
|
||||||
char chNext = styler.SafeGetCharAt(start + i + 1, '\n');
|
// Continuation line
|
||||||
|
line++;
|
||||||
|
pos = styler.LineStart(line);
|
||||||
|
endLine = styler.LineEnd(line);
|
||||||
|
ch = styler.SafeGetCharAt(pos, '\n');
|
||||||
|
} else {
|
||||||
|
const char chNext = styler.SafeGetCharAt(pos + 1, '\n');
|
||||||
if (ch == '/' && (chNext == '/' || chNext == '*'))
|
if (ch == '/' && (chNext == '/' || chNext == '*'))
|
||||||
break;
|
break;
|
||||||
if (allowSpace || (ch != ' '))
|
if (allowSpace || (ch != ' ')) {
|
||||||
restOfLine += ch;
|
restOfLine += ch;
|
||||||
i++;
|
}
|
||||||
|
pos++;
|
||||||
ch = chNext;
|
ch = chNext;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return restOfLine;
|
return restOfLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsStreamCommentStyle(int style) {
|
bool IsStreamCommentStyle(int style) noexcept {
|
||||||
return style == SCE_C_COMMENT ||
|
return style == SCE_C_COMMENT ||
|
||||||
style == SCE_C_COMMENTDOC ||
|
style == SCE_C_COMMENTDOC ||
|
||||||
style == SCE_C_COMMENTDOCKEYWORD ||
|
style == SCE_C_COMMENTDOCKEYWORD ||
|
||||||
@ -224,12 +234,12 @@ bool IsStreamCommentStyle(int style) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct PPDefinition {
|
struct PPDefinition {
|
||||||
int line;
|
Sci_Position line;
|
||||||
std::string key;
|
std::string key;
|
||||||
std::string value;
|
std::string value;
|
||||||
bool isUndef;
|
bool isUndef;
|
||||||
std::string arguments;
|
std::string arguments;
|
||||||
PPDefinition(int line_, const std::string &key_, const std::string &value_, bool isUndef_ = false, 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_) {
|
line(line_), key(key_), value(value_), isUndef(isUndef_), arguments(arguments_) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -238,22 +248,26 @@ class LinePPState {
|
|||||||
int state;
|
int state;
|
||||||
int ifTaken;
|
int ifTaken;
|
||||||
int level;
|
int level;
|
||||||
bool ValidLevel() const {
|
bool ValidLevel() const noexcept {
|
||||||
return level >= 0 && level < 32;
|
return level >= 0 && level < 32;
|
||||||
}
|
}
|
||||||
int maskLevel() const {
|
int maskLevel() const noexcept {
|
||||||
|
if (level >= 0) {
|
||||||
return 1 << level;
|
return 1 << level;
|
||||||
|
} else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
LinePPState() : state(0), ifTaken(0), level(-1) {
|
LinePPState() : state(0), ifTaken(0), level(-1) {
|
||||||
}
|
}
|
||||||
bool IsInactive() const {
|
bool IsInactive() const noexcept {
|
||||||
return state != 0;
|
return state != 0;
|
||||||
}
|
}
|
||||||
bool CurrentIfTaken() const {
|
bool CurrentIfTaken() const noexcept {
|
||||||
return (ifTaken & maskLevel()) != 0;
|
return (ifTaken & maskLevel()) != 0;
|
||||||
}
|
}
|
||||||
void StartSection(bool on) {
|
void StartSection(bool on) noexcept {
|
||||||
level++;
|
level++;
|
||||||
if (ValidLevel()) {
|
if (ValidLevel()) {
|
||||||
if (on) {
|
if (on) {
|
||||||
@ -265,14 +279,14 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void EndSection() {
|
void EndSection() noexcept {
|
||||||
if (ValidLevel()) {
|
if (ValidLevel()) {
|
||||||
state &= ~maskLevel();
|
state &= ~maskLevel();
|
||||||
ifTaken &= ~maskLevel();
|
ifTaken &= ~maskLevel();
|
||||||
}
|
}
|
||||||
level--;
|
level--;
|
||||||
}
|
}
|
||||||
void InvertCurrentLevel() {
|
void InvertCurrentLevel() noexcept {
|
||||||
if (ValidLevel()) {
|
if (ValidLevel()) {
|
||||||
state ^= maskLevel();
|
state ^= maskLevel();
|
||||||
ifTaken |= maskLevel();
|
ifTaken |= maskLevel();
|
||||||
@ -285,14 +299,14 @@ public:
|
|||||||
class PPStates {
|
class PPStates {
|
||||||
std::vector<LinePPState> vlls;
|
std::vector<LinePPState> vlls;
|
||||||
public:
|
public:
|
||||||
LinePPState ForLine(int line) const {
|
LinePPState ForLine(Sci_Position line) const {
|
||||||
if ((line > 0) && (vlls.size() > static_cast<size_t>(line))) {
|
if ((line > 0) && (vlls.size() > static_cast<size_t>(line))) {
|
||||||
return vlls[line];
|
return vlls[line];
|
||||||
} else {
|
} else {
|
||||||
return LinePPState();
|
return LinePPState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void Add(int line, LinePPState lls) {
|
void Add(Sci_Position line, LinePPState lls) {
|
||||||
vlls.resize(line+1);
|
vlls.resize(line+1);
|
||||||
vlls[line] = lls;
|
vlls[line] = lls;
|
||||||
}
|
}
|
||||||
@ -320,6 +334,7 @@ struct OptionsCPP {
|
|||||||
std::string foldExplicitEnd;
|
std::string foldExplicitEnd;
|
||||||
bool foldExplicitAnywhere;
|
bool foldExplicitAnywhere;
|
||||||
bool foldPreprocessor;
|
bool foldPreprocessor;
|
||||||
|
bool foldPreprocessorAtElse;
|
||||||
bool foldCompact;
|
bool foldCompact;
|
||||||
bool foldAtElse;
|
bool foldAtElse;
|
||||||
OptionsCPP() {
|
OptionsCPP() {
|
||||||
@ -341,6 +356,7 @@ struct OptionsCPP {
|
|||||||
foldExplicitEnd = "";
|
foldExplicitEnd = "";
|
||||||
foldExplicitAnywhere = false;
|
foldExplicitAnywhere = false;
|
||||||
foldPreprocessor = false;
|
foldPreprocessor = false;
|
||||||
|
foldPreprocessorAtElse = false;
|
||||||
foldCompact = false;
|
foldCompact = false;
|
||||||
foldAtElse = false;
|
foldAtElse = false;
|
||||||
}
|
}
|
||||||
@ -412,6 +428,9 @@ struct OptionSetCPP : public OptionSet<OptionsCPP> {
|
|||||||
DefineProperty("fold.cpp.explicit.anywhere", &OptionsCPP::foldExplicitAnywhere,
|
DefineProperty("fold.cpp.explicit.anywhere", &OptionsCPP::foldExplicitAnywhere,
|
||||||
"Set this property to 1 to enable explicit fold points anywhere, not just in line comments.");
|
"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,
|
DefineProperty("fold.preprocessor", &OptionsCPP::foldPreprocessor,
|
||||||
"This option enables folding preprocessor directives when using the C++ lexer. "
|
"This option enables folding preprocessor directives when using the C++ lexer. "
|
||||||
"Includes C#'s explicit #region and #endregion folding directives.");
|
"Includes C#'s explicit #region and #endregion folding directives.");
|
||||||
@ -427,13 +446,46 @@ struct OptionSetCPP : public OptionSet<OptionsCPP> {
|
|||||||
|
|
||||||
const char styleSubable[] = {SCE_C_IDENTIFIER, SCE_C_COMMENTDOCKEYWORD, 0};
|
const char styleSubable[] = {SCE_C_IDENTIFIER, SCE_C_COMMENTDOCKEYWORD, 0};
|
||||||
|
|
||||||
|
LexicalClass lexicalClasses[] = {
|
||||||
|
// Lexer Cpp SCLEX_CPP SCE_C_:
|
||||||
|
0, "SCE_C_DEFAULT", "default", "White space",
|
||||||
|
1, "SCE_C_COMMENT", "comment", "Comment: /* */.",
|
||||||
|
2, "SCE_C_COMMENTLINE", "comment line", "Line Comment: //.",
|
||||||
|
3, "SCE_C_COMMENTDOC", "comment documentation", "Doc comment: block comments beginning with /** or /*!",
|
||||||
|
4, "SCE_C_NUMBER", "literal numeric", "Number",
|
||||||
|
5, "SCE_C_WORD", "keyword", "Keyword",
|
||||||
|
6, "SCE_C_STRING", "literal string", "Double quoted string",
|
||||||
|
7, "SCE_C_CHARACTER", "literal string character", "Single quoted string",
|
||||||
|
8, "SCE_C_UUID", "literal uuid", "UUIDs (only in IDL)",
|
||||||
|
9, "SCE_C_PREPROCESSOR", "preprocessor", "Preprocessor",
|
||||||
|
10, "SCE_C_OPERATOR", "operator", "Operators",
|
||||||
|
11, "SCE_C_IDENTIFIER", "identifier", "Identifiers",
|
||||||
|
12, "SCE_C_STRINGEOL", "error literal string", "End of line where string is not closed",
|
||||||
|
13, "SCE_C_VERBATIM", "literal string multiline raw", "Verbatim strings for C#",
|
||||||
|
14, "SCE_C_REGEX", "literal regex", "Regular expressions for JavaScript",
|
||||||
|
15, "SCE_C_COMMENTLINEDOC", "comment documentation line", "Doc Comment Line: line comments beginning with /// or //!.",
|
||||||
|
16, "SCE_C_WORD2", "identifier", "Keywords2",
|
||||||
|
17, "SCE_C_COMMENTDOCKEYWORD", "comment documentation keyword", "Comment keyword",
|
||||||
|
18, "SCE_C_COMMENTDOCKEYWORDERROR", "error comment documentation keyword", "Comment keyword error",
|
||||||
|
19, "SCE_C_GLOBALCLASS", "identifier", "Global class",
|
||||||
|
20, "SCE_C_STRINGRAW", "literal string multiline raw", "Raw strings for C++0x",
|
||||||
|
21, "SCE_C_TRIPLEVERBATIM", "literal string multiline raw", "Triple-quoted strings for Vala",
|
||||||
|
22, "SCE_C_HASHQUOTEDSTRING", "literal string", "Hash-quoted strings for Pike",
|
||||||
|
23, "SCE_C_PREPROCESSORCOMMENT", "comment preprocessor", "Preprocessor stream comment",
|
||||||
|
24, "SCE_C_PREPROCESSORCOMMENTDOC", "comment preprocessor documentation", "Preprocessor stream doc comment",
|
||||||
|
25, "SCE_C_USERLITERAL", "literal", "User defined literals",
|
||||||
|
26, "SCE_C_TASKMARKER", "comment taskmarker", "Task Marker",
|
||||||
|
27, "SCE_C_ESCAPESEQUENCE", "literal string escapesequence", "Escape sequence",
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class LexerCPP : public ILexerWithSubStyles {
|
class LexerCPP : public ILexer4 {
|
||||||
bool caseSensitive;
|
bool caseSensitive;
|
||||||
CharacterSet setWord;
|
CharacterSet setWord;
|
||||||
CharacterSet setNegationOp;
|
CharacterSet setNegationOp;
|
||||||
CharacterSet setArithmethicOp;
|
CharacterSet setAddOp;
|
||||||
|
CharacterSet setMultOp;
|
||||||
CharacterSet setRelOp;
|
CharacterSet setRelOp;
|
||||||
CharacterSet setLogicalOp;
|
CharacterSet setLogicalOp;
|
||||||
CharacterSet setWordStart;
|
CharacterSet setWordStart;
|
||||||
@ -455,7 +507,7 @@ class LexerCPP : public ILexerWithSubStyles {
|
|||||||
arguments.clear();
|
arguments.clear();
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
bool IsMacro() const {
|
bool IsMacro() const noexcept {
|
||||||
return !arguments.empty();
|
return !arguments.empty();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -468,86 +520,141 @@ class LexerCPP : public ILexerWithSubStyles {
|
|||||||
enum { activeFlag = 0x40 };
|
enum { activeFlag = 0x40 };
|
||||||
enum { ssIdentifier, ssDocKeyword };
|
enum { ssIdentifier, ssDocKeyword };
|
||||||
SubStyles subStyles;
|
SubStyles subStyles;
|
||||||
|
std::string returnBuffer;
|
||||||
public:
|
public:
|
||||||
explicit LexerCPP(bool caseSensitive_) :
|
explicit LexerCPP(bool caseSensitive_) :
|
||||||
caseSensitive(caseSensitive_),
|
caseSensitive(caseSensitive_),
|
||||||
setWord(CharacterSet::setAlphaNum, "._", 0x80, true),
|
setWord(CharacterSet::setAlphaNum, "._", 0x80, true),
|
||||||
setNegationOp(CharacterSet::setNone, "!"),
|
setNegationOp(CharacterSet::setNone, "!"),
|
||||||
setArithmethicOp(CharacterSet::setNone, "+-/*%"),
|
setAddOp(CharacterSet::setNone, "+-"),
|
||||||
|
setMultOp(CharacterSet::setNone, "*/%"),
|
||||||
setRelOp(CharacterSet::setNone, "=!<>"),
|
setRelOp(CharacterSet::setNone, "=!<>"),
|
||||||
setLogicalOp(CharacterSet::setNone, "|&"),
|
setLogicalOp(CharacterSet::setNone, "|&"),
|
||||||
subStyles(styleSubable, 0x80, 0x40, activeFlag) {
|
subStyles(styleSubable, 0x80, 0x40, activeFlag) {
|
||||||
}
|
}
|
||||||
virtual ~LexerCPP() {
|
virtual ~LexerCPP() {
|
||||||
}
|
}
|
||||||
void SCI_METHOD Release() {
|
void SCI_METHOD Release() override {
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
int SCI_METHOD Version() const {
|
int SCI_METHOD Version() const override {
|
||||||
return lvSubStyles;
|
return lvRelease4;
|
||||||
}
|
}
|
||||||
const char * SCI_METHOD PropertyNames() {
|
const char * SCI_METHOD PropertyNames() override {
|
||||||
return osCPP.PropertyNames();
|
return osCPP.PropertyNames();
|
||||||
}
|
}
|
||||||
int SCI_METHOD PropertyType(const char *name) {
|
int SCI_METHOD PropertyType(const char *name) override {
|
||||||
return osCPP.PropertyType(name);
|
return osCPP.PropertyType(name);
|
||||||
}
|
}
|
||||||
const char * SCI_METHOD DescribeProperty(const char *name) {
|
const char * SCI_METHOD DescribeProperty(const char *name) override {
|
||||||
return osCPP.DescribeProperty(name);
|
return osCPP.DescribeProperty(name);
|
||||||
}
|
}
|
||||||
int SCI_METHOD PropertySet(const char *key, const char *val);
|
Sci_Position SCI_METHOD PropertySet(const char *key, const char *val) override;
|
||||||
const char * SCI_METHOD DescribeWordListSets() {
|
const char * SCI_METHOD DescribeWordListSets() override {
|
||||||
return osCPP.DescribeWordListSets();
|
return osCPP.DescribeWordListSets();
|
||||||
}
|
}
|
||||||
int SCI_METHOD WordListSet(int n, const char *wl);
|
Sci_Position SCI_METHOD WordListSet(int n, const char *wl) override;
|
||||||
void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
|
void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) override;
|
||||||
void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
|
void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) override;
|
||||||
|
|
||||||
void * SCI_METHOD PrivateCall(int, void *) {
|
void * SCI_METHOD PrivateCall(int, void *) override {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SCI_METHOD LineEndTypesSupported() {
|
int SCI_METHOD LineEndTypesSupported() override {
|
||||||
return SC_LINE_END_TYPE_UNICODE;
|
return SC_LINE_END_TYPE_UNICODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SCI_METHOD AllocateSubStyles(int styleBase, int numberStyles) {
|
int SCI_METHOD AllocateSubStyles(int styleBase, int numberStyles) override {
|
||||||
return subStyles.Allocate(styleBase, numberStyles);
|
return subStyles.Allocate(styleBase, numberStyles);
|
||||||
}
|
}
|
||||||
int SCI_METHOD SubStylesStart(int styleBase) {
|
int SCI_METHOD SubStylesStart(int styleBase) override {
|
||||||
return subStyles.Start(styleBase);
|
return subStyles.Start(styleBase);
|
||||||
}
|
}
|
||||||
int SCI_METHOD SubStylesLength(int styleBase) {
|
int SCI_METHOD SubStylesLength(int styleBase) override {
|
||||||
return subStyles.Length(styleBase);
|
return subStyles.Length(styleBase);
|
||||||
}
|
}
|
||||||
int SCI_METHOD StyleFromSubStyle(int subStyle) {
|
int SCI_METHOD StyleFromSubStyle(int subStyle) override {
|
||||||
int styleBase = subStyles.BaseStyle(MaskActive(subStyle));
|
const int styleBase = subStyles.BaseStyle(MaskActive(subStyle));
|
||||||
int active = subStyle & activeFlag;
|
const int active = subStyle & activeFlag;
|
||||||
return styleBase | active;
|
return styleBase | active;
|
||||||
}
|
}
|
||||||
int SCI_METHOD PrimaryStyleFromStyle(int style) {
|
int SCI_METHOD PrimaryStyleFromStyle(int style) override {
|
||||||
return MaskActive(style);
|
return MaskActive(style);
|
||||||
}
|
}
|
||||||
void SCI_METHOD FreeSubStyles() {
|
void SCI_METHOD FreeSubStyles() override {
|
||||||
subStyles.Free();
|
subStyles.Free();
|
||||||
}
|
}
|
||||||
void SCI_METHOD SetIdentifiers(int style, const char *identifiers) {
|
void SCI_METHOD SetIdentifiers(int style, const char *identifiers) override {
|
||||||
subStyles.SetIdentifiers(style, identifiers);
|
subStyles.SetIdentifiers(style, identifiers);
|
||||||
}
|
}
|
||||||
int SCI_METHOD DistanceToSecondaryStyles() {
|
int SCI_METHOD DistanceToSecondaryStyles() override {
|
||||||
return activeFlag;
|
return activeFlag;
|
||||||
}
|
}
|
||||||
const char * SCI_METHOD GetSubStyleBases() {
|
const char * SCI_METHOD GetSubStyleBases() override {
|
||||||
return styleSubable;
|
return styleSubable;
|
||||||
}
|
}
|
||||||
|
int SCI_METHOD NamedStyles() override {
|
||||||
|
return std::max(subStyles.LastAllocated() + 1,
|
||||||
|
static_cast<int>(ELEMENTS(lexicalClasses))) +
|
||||||
|
activeFlag;
|
||||||
|
}
|
||||||
|
const char * SCI_METHOD NameOfStyle(int style) override {
|
||||||
|
if (style >= NamedStyles())
|
||||||
|
return "";
|
||||||
|
if (style < static_cast<int>(ELEMENTS(lexicalClasses)))
|
||||||
|
return lexicalClasses[style].name;
|
||||||
|
// TODO: inactive and substyles
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
const char * SCI_METHOD TagsOfStyle(int style) override {
|
||||||
|
if (style >= NamedStyles())
|
||||||
|
return "Excess";
|
||||||
|
returnBuffer.clear();
|
||||||
|
const int firstSubStyle = subStyles.FirstAllocated();
|
||||||
|
if (firstSubStyle >= 0) {
|
||||||
|
const int lastSubStyle = subStyles.LastAllocated();
|
||||||
|
if (((style >= firstSubStyle) && (style <= (lastSubStyle))) ||
|
||||||
|
((style >= firstSubStyle + activeFlag) && (style <= (lastSubStyle + activeFlag)))) {
|
||||||
|
int styleActive = style;
|
||||||
|
if (style > lastSubStyle) {
|
||||||
|
returnBuffer = "inactive ";
|
||||||
|
styleActive -= activeFlag;
|
||||||
|
}
|
||||||
|
const int styleMain = StyleFromSubStyle(styleActive);
|
||||||
|
returnBuffer += lexicalClasses[styleMain].tags;
|
||||||
|
return returnBuffer.c_str();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (style < static_cast<int>(ELEMENTS(lexicalClasses)))
|
||||||
|
return lexicalClasses[style].tags;
|
||||||
|
if (style >= activeFlag) {
|
||||||
|
returnBuffer = "inactive ";
|
||||||
|
const int styleActive = style - activeFlag;
|
||||||
|
if (styleActive < static_cast<int>(ELEMENTS(lexicalClasses)))
|
||||||
|
returnBuffer += lexicalClasses[styleActive].tags;
|
||||||
|
else
|
||||||
|
returnBuffer = "";
|
||||||
|
return returnBuffer.c_str();
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
const char * SCI_METHOD DescriptionOfStyle(int style) override {
|
||||||
|
if (style >= NamedStyles())
|
||||||
|
return "";
|
||||||
|
if (style < static_cast<int>(ELEMENTS(lexicalClasses)))
|
||||||
|
return lexicalClasses[style].description;
|
||||||
|
// TODO: inactive and substyles
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
static ILexer *LexerFactoryCPP() {
|
static ILexer4 *LexerFactoryCPP() {
|
||||||
return new LexerCPP(true);
|
return new LexerCPP(true);
|
||||||
}
|
}
|
||||||
static ILexer *LexerFactoryCPPInsensitive() {
|
static ILexer4 *LexerFactoryCPPInsensitive() {
|
||||||
return new LexerCPP(false);
|
return new LexerCPP(false);
|
||||||
}
|
}
|
||||||
static int MaskActive(int style) {
|
static int MaskActive(int style) noexcept {
|
||||||
return style & ~activeFlag;
|
return style & ~activeFlag;
|
||||||
}
|
}
|
||||||
void EvaluateTokens(std::vector<std::string> &tokens, const SymbolTable &preprocessorDefinitions);
|
void EvaluateTokens(std::vector<std::string> &tokens, const SymbolTable &preprocessorDefinitions);
|
||||||
@ -555,7 +662,7 @@ public:
|
|||||||
bool EvaluateExpression(const std::string &expr, const SymbolTable &preprocessorDefinitions);
|
bool EvaluateExpression(const std::string &expr, const SymbolTable &preprocessorDefinitions);
|
||||||
};
|
};
|
||||||
|
|
||||||
int SCI_METHOD LexerCPP::PropertySet(const char *key, const char *val) {
|
Sci_Position SCI_METHOD LexerCPP::PropertySet(const char *key, const char *val) {
|
||||||
if (osCPP.PropertySet(&options, key, val)) {
|
if (osCPP.PropertySet(&options, key, val)) {
|
||||||
if (strcmp(key, "lexer.cpp.allow.dollars") == 0) {
|
if (strcmp(key, "lexer.cpp.allow.dollars") == 0) {
|
||||||
setWord = CharacterSet(CharacterSet::setAlphaNum, "._", 0x80, true);
|
setWord = CharacterSet(CharacterSet::setAlphaNum, "._", 0x80, true);
|
||||||
@ -568,7 +675,7 @@ int SCI_METHOD LexerCPP::PropertySet(const char *key, const char *val) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SCI_METHOD LexerCPP::WordListSet(int n, const char *wl) {
|
Sci_Position SCI_METHOD LexerCPP::WordListSet(int n, const char *wl) {
|
||||||
WordList *wordListN = 0;
|
WordList *wordListN = 0;
|
||||||
switch (n) {
|
switch (n) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -590,7 +697,7 @@ int SCI_METHOD LexerCPP::WordListSet(int n, const char *wl) {
|
|||||||
wordListN = &markerList;
|
wordListN = &markerList;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int firstModification = -1;
|
Sci_Position firstModification = -1;
|
||||||
if (wordListN) {
|
if (wordListN) {
|
||||||
WordList wlNew;
|
WordList wlNew;
|
||||||
wlNew.Set(wl);
|
wlNew.Set(wl);
|
||||||
@ -606,8 +713,8 @@ int SCI_METHOD LexerCPP::WordListSet(int n, const char *wl) {
|
|||||||
if (cpEquals) {
|
if (cpEquals) {
|
||||||
std::string name(cpDefinition, cpEquals - cpDefinition);
|
std::string name(cpDefinition, cpEquals - cpDefinition);
|
||||||
std::string val(cpEquals+1);
|
std::string val(cpEquals+1);
|
||||||
size_t bracket = name.find('(');
|
const size_t bracket = name.find('(');
|
||||||
size_t bracketEnd = name.find(')');
|
const size_t bracketEnd = name.find(')');
|
||||||
if ((bracket != std::string::npos) && (bracketEnd != std::string::npos)) {
|
if ((bracket != std::string::npos) && (bracketEnd != std::string::npos)) {
|
||||||
// Macro
|
// Macro
|
||||||
std::string args = name.substr(bracket + 1, bracketEnd - bracket - 1);
|
std::string args = name.substr(bracket + 1, bracketEnd - bracket - 1);
|
||||||
@ -628,16 +735,7 @@ int SCI_METHOD LexerCPP::WordListSet(int n, const char *wl) {
|
|||||||
return firstModification;
|
return firstModification;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Functor used to truncate history
|
void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) {
|
||||||
struct After {
|
|
||||||
int line;
|
|
||||||
explicit After(int line_) : line(line_) {}
|
|
||||||
bool operator()(PPDefinition &p) const {
|
|
||||||
return p.line > line;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
|
|
||||||
LexAccessor styler(pAccess);
|
LexAccessor styler(pAccess);
|
||||||
|
|
||||||
CharacterSet setOKBeforeRE(CharacterSet::setNone, "([{=,:;!%^&*|?~+-");
|
CharacterSet setOKBeforeRE(CharacterSet::setNone, "([{=,:;!%^&*|?~+-");
|
||||||
@ -664,13 +762,13 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
|||||||
bool inRERange = false;
|
bool inRERange = false;
|
||||||
bool seenDocKeyBrace = false;
|
bool seenDocKeyBrace = false;
|
||||||
|
|
||||||
int lineCurrent = styler.GetLine(startPos);
|
Sci_Position lineCurrent = styler.GetLine(startPos);
|
||||||
if ((MaskActive(initStyle) == SCE_C_PREPROCESSOR) ||
|
if ((MaskActive(initStyle) == SCE_C_PREPROCESSOR) ||
|
||||||
(MaskActive(initStyle) == SCE_C_COMMENTLINE) ||
|
(MaskActive(initStyle) == SCE_C_COMMENTLINE) ||
|
||||||
(MaskActive(initStyle) == SCE_C_COMMENTLINEDOC)) {
|
(MaskActive(initStyle) == SCE_C_COMMENTLINEDOC)) {
|
||||||
// Set continuationLine if last character of previous line is '\'
|
// Set continuationLine if last character of previous line is '\'
|
||||||
if (lineCurrent > 0) {
|
if (lineCurrent > 0) {
|
||||||
int endLinePrevious = styler.LineEnd(lineCurrent - 1);
|
const Sci_Position endLinePrevious = styler.LineEnd(lineCurrent - 1);
|
||||||
if (endLinePrevious > 0) {
|
if (endLinePrevious > 0) {
|
||||||
continuationLine = styler.SafeGetCharAt(endLinePrevious-1) == '\\';
|
continuationLine = styler.SafeGetCharAt(endLinePrevious-1) == '\\';
|
||||||
}
|
}
|
||||||
@ -679,7 +777,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
|||||||
|
|
||||||
// look back to set chPrevNonWhite properly for better regex colouring
|
// look back to set chPrevNonWhite properly for better regex colouring
|
||||||
if (startPos > 0) {
|
if (startPos > 0) {
|
||||||
int back = startPos;
|
Sci_Position back = startPos;
|
||||||
while (--back && IsSpaceEquiv(MaskActive(styler.StyleAt(back))))
|
while (--back && IsSpaceEquiv(MaskActive(styler.StyleAt(back))))
|
||||||
;
|
;
|
||||||
if (MaskActive(styler.StyleAt(back)) == SCE_C_OPERATOR) {
|
if (MaskActive(styler.StyleAt(back)) == SCE_C_OPERATOR) {
|
||||||
@ -687,7 +785,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StyleContext sc(startPos, length, initStyle, styler, static_cast<unsigned char>(0xff));
|
StyleContext sc(startPos, length, initStyle, styler);
|
||||||
LinePPState preproc = vlls.ForLine(lineCurrent);
|
LinePPState preproc = vlls.ForLine(lineCurrent);
|
||||||
|
|
||||||
bool definitionsChanged = false;
|
bool definitionsChanged = false;
|
||||||
@ -697,18 +795,19 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
|||||||
if (!options.updatePreprocessor)
|
if (!options.updatePreprocessor)
|
||||||
ppDefineHistory.clear();
|
ppDefineHistory.clear();
|
||||||
|
|
||||||
std::vector<PPDefinition>::iterator itInvalid = std::find_if(ppDefineHistory.begin(), ppDefineHistory.end(), After(lineCurrent-1));
|
std::vector<PPDefinition>::iterator itInvalid = std::find_if(ppDefineHistory.begin(), ppDefineHistory.end(),
|
||||||
|
[lineCurrent](const PPDefinition &p) { return p.line >= lineCurrent; });
|
||||||
if (itInvalid != ppDefineHistory.end()) {
|
if (itInvalid != ppDefineHistory.end()) {
|
||||||
ppDefineHistory.erase(itInvalid, ppDefineHistory.end());
|
ppDefineHistory.erase(itInvalid, ppDefineHistory.end());
|
||||||
definitionsChanged = true;
|
definitionsChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
SymbolTable preprocessorDefinitions = preprocessorDefinitionsStart;
|
SymbolTable preprocessorDefinitions = preprocessorDefinitionsStart;
|
||||||
for (std::vector<PPDefinition>::iterator itDef = ppDefineHistory.begin(); itDef != ppDefineHistory.end(); ++itDef) {
|
for (const PPDefinition &ppDef : ppDefineHistory) {
|
||||||
if (itDef->isUndef)
|
if (ppDef.isUndef)
|
||||||
preprocessorDefinitions.erase(itDef->key);
|
preprocessorDefinitions.erase(ppDef.key);
|
||||||
else
|
else
|
||||||
preprocessorDefinitions[itDef->key] = SymbolValue(itDef->value, itDef->arguments);
|
preprocessorDefinitions[ppDef.key] = SymbolValue(ppDef.value, ppDef.arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string rawStringTerminator = rawStringTerminators.ValueAt(lineCurrent-1);
|
std::string rawStringTerminator = rawStringTerminators.ValueAt(lineCurrent-1);
|
||||||
@ -719,7 +818,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
|||||||
const WordClassifier &classifierIdentifiers = subStyles.Classifier(SCE_C_IDENTIFIER);
|
const WordClassifier &classifierIdentifiers = subStyles.Classifier(SCE_C_IDENTIFIER);
|
||||||
const WordClassifier &classifierDocKeyWords = subStyles.Classifier(SCE_C_COMMENTDOCKEYWORD);
|
const WordClassifier &classifierDocKeyWords = subStyles.Classifier(SCE_C_COMMENTDOCKEYWORD);
|
||||||
|
|
||||||
int lineEndNext = styler.LineEnd(lineCurrent);
|
Sci_Position lineEndNext = styler.LineEnd(lineCurrent);
|
||||||
|
|
||||||
for (; sc.More();) {
|
for (; sc.More();) {
|
||||||
|
|
||||||
@ -757,10 +856,13 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
|||||||
|
|
||||||
// Handle line continuation generically.
|
// Handle line continuation generically.
|
||||||
if (sc.ch == '\\') {
|
if (sc.ch == '\\') {
|
||||||
if (static_cast<int>((sc.currentPos+1)) >= lineEndNext) {
|
if (static_cast<Sci_Position>((sc.currentPos+1)) >= lineEndNext) {
|
||||||
lineCurrent++;
|
lineCurrent++;
|
||||||
lineEndNext = styler.LineEnd(lineCurrent);
|
lineEndNext = styler.LineEnd(lineCurrent);
|
||||||
vlls.Add(lineCurrent, preproc);
|
vlls.Add(lineCurrent, preproc);
|
||||||
|
if (rawStringTerminator != "") {
|
||||||
|
rawSTNew.Set(lineCurrent-1, rawStringTerminator);
|
||||||
|
}
|
||||||
sc.Forward();
|
sc.Forward();
|
||||||
if (sc.ch == '\r' && sc.chNext == '\n') {
|
if (sc.ch == '\r' && sc.chNext == '\n') {
|
||||||
// Even in UTF-8, \r and \n are separate
|
// Even in UTF-8, \r and \n are separate
|
||||||
@ -821,7 +923,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
|||||||
const bool raw = literalString && sc.chPrev == 'R' && !setInvalidRawFirst.Contains(sc.chNext);
|
const bool raw = literalString && sc.chPrev == 'R' && !setInvalidRawFirst.Contains(sc.chNext);
|
||||||
if (raw)
|
if (raw)
|
||||||
s[lenS--] = '\0';
|
s[lenS--] = '\0';
|
||||||
bool valid =
|
const bool valid =
|
||||||
(lenS == 0) ||
|
(lenS == 0) ||
|
||||||
((lenS == 1) && ((s[0] == 'L') || (s[0] == 'u') || (s[0] == 'U'))) ||
|
((lenS == 1) && ((s[0] == 'L') || (s[0] == 'u') || (s[0] == 'U'))) ||
|
||||||
((lenS == 2) && literalString && (s[0] == 'u') && (s[1] == '8'));
|
((lenS == 2) && literalString && (s[0] == 'u') && (s[1] == '8'));
|
||||||
@ -848,7 +950,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
|||||||
break;
|
break;
|
||||||
case SCE_C_PREPROCESSOR:
|
case SCE_C_PREPROCESSOR:
|
||||||
if (options.stylingWithinPreprocessor) {
|
if (options.stylingWithinPreprocessor) {
|
||||||
if (IsASpace(sc.ch)) {
|
if (IsASpace(sc.ch) || (sc.ch == '(')) {
|
||||||
sc.SetState(SCE_C_DEFAULT|activitySet);
|
sc.SetState(SCE_C_DEFAULT|activitySet);
|
||||||
}
|
}
|
||||||
} else if (isStringInPreprocessor && (sc.Match('>') || sc.Match('\"') || sc.atLineEnd)) {
|
} else if (isStringInPreprocessor && (sc.Match('>') || sc.Match('\"') || sc.atLineEnd)) {
|
||||||
@ -1026,7 +1128,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
|||||||
while ((sc.ch < 0x80) && islower(sc.ch))
|
while ((sc.ch < 0x80) && islower(sc.ch))
|
||||||
sc.Forward(); // gobble regex flags
|
sc.Forward(); // gobble regex flags
|
||||||
sc.SetState(SCE_C_DEFAULT|activitySet);
|
sc.SetState(SCE_C_DEFAULT|activitySet);
|
||||||
} else if (sc.ch == '\\' && (static_cast<int>(sc.currentPos+1) < lineEndNext)) {
|
} else if (sc.ch == '\\' && (static_cast<Sci_Position>(sc.currentPos+1) < lineEndNext)) {
|
||||||
// Gobble up the escaped character
|
// Gobble up the escaped character
|
||||||
sc.Forward();
|
sc.Forward();
|
||||||
} else if (sc.ch == '[') {
|
} else if (sc.ch == '[') {
|
||||||
@ -1052,7 +1154,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SCE_C_TRIPLEVERBATIM:
|
case SCE_C_TRIPLEVERBATIM:
|
||||||
if (sc.Match("\"\"\"")) {
|
if (sc.Match(R"(""")")) {
|
||||||
while (sc.Match('"')) {
|
while (sc.Match('"')) {
|
||||||
sc.Forward();
|
sc.Forward();
|
||||||
}
|
}
|
||||||
@ -1083,7 +1185,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
|||||||
if (sc.Match('@', '\"')) {
|
if (sc.Match('@', '\"')) {
|
||||||
sc.SetState(SCE_C_VERBATIM|activitySet);
|
sc.SetState(SCE_C_VERBATIM|activitySet);
|
||||||
sc.Forward();
|
sc.Forward();
|
||||||
} else if (options.triplequotedStrings && sc.Match("\"\"\"")) {
|
} else if (options.triplequotedStrings && sc.Match(R"(""")")) {
|
||||||
sc.SetState(SCE_C_TRIPLEVERBATIM|activitySet);
|
sc.SetState(SCE_C_TRIPLEVERBATIM|activitySet);
|
||||||
sc.Forward(2);
|
sc.Forward(2);
|
||||||
} else if (options.hashquotedStrings && sc.Match('#', '\"')) {
|
} else if (options.hashquotedStrings && sc.Match('#', '\"')) {
|
||||||
@ -1132,8 +1234,8 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
|||||||
if (MaskActive(styler.StyleAt(sc.currentPos - 1)) == SCE_C_STRINGRAW) {
|
if (MaskActive(styler.StyleAt(sc.currentPos - 1)) == SCE_C_STRINGRAW) {
|
||||||
sc.SetState(SCE_C_STRINGRAW|activitySet);
|
sc.SetState(SCE_C_STRINGRAW|activitySet);
|
||||||
rawStringTerminator = ")";
|
rawStringTerminator = ")";
|
||||||
for (int termPos = sc.currentPos + 1;; termPos++) {
|
for (Sci_Position termPos = sc.currentPos + 1;; termPos++) {
|
||||||
char chTerminator = styler.SafeGetCharAt(termPos, '(');
|
const char chTerminator = styler.SafeGetCharAt(termPos, '(');
|
||||||
if (chTerminator == '(')
|
if (chTerminator == '(')
|
||||||
break;
|
break;
|
||||||
rawStringTerminator += chTerminator;
|
rawStringTerminator += chTerminator;
|
||||||
@ -1164,14 +1266,14 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
|||||||
} else {
|
} else {
|
||||||
if (options.trackPreprocessor) {
|
if (options.trackPreprocessor) {
|
||||||
if (sc.Match("ifdef") || sc.Match("ifndef")) {
|
if (sc.Match("ifdef") || sc.Match("ifndef")) {
|
||||||
bool isIfDef = sc.Match("ifdef");
|
const bool isIfDef = sc.Match("ifdef");
|
||||||
int i = isIfDef ? 5 : 6;
|
const int startRest = isIfDef ? 5 : 6;
|
||||||
std::string restOfLine = GetRestOfLine(styler, sc.currentPos + i + 1, false);
|
std::string restOfLine = GetRestOfLine(styler, sc.currentPos + startRest + 1, false);
|
||||||
bool foundDef = preprocessorDefinitions.find(restOfLine) != preprocessorDefinitions.end();
|
bool foundDef = preprocessorDefinitions.find(restOfLine) != preprocessorDefinitions.end();
|
||||||
preproc.StartSection(isIfDef == foundDef);
|
preproc.StartSection(isIfDef == foundDef);
|
||||||
} else if (sc.Match("if")) {
|
} else if (sc.Match("if")) {
|
||||||
std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 2, true);
|
std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 2, true);
|
||||||
bool ifGood = EvaluateExpression(restOfLine, preprocessorDefinitions);
|
const bool ifGood = EvaluateExpression(restOfLine, preprocessorDefinitions);
|
||||||
preproc.StartSection(ifGood);
|
preproc.StartSection(ifGood);
|
||||||
} else if (sc.Match("else")) {
|
} else if (sc.Match("else")) {
|
||||||
if (!preproc.CurrentIfTaken()) {
|
if (!preproc.CurrentIfTaken()) {
|
||||||
@ -1189,8 +1291,8 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
|||||||
// Ensure only one chosen out of #if .. #elif .. #elif .. #else .. #endif
|
// Ensure only one chosen out of #if .. #elif .. #elif .. #else .. #endif
|
||||||
if (!preproc.CurrentIfTaken()) {
|
if (!preproc.CurrentIfTaken()) {
|
||||||
// Similar to #if
|
// Similar to #if
|
||||||
std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 2, true);
|
std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 4, true);
|
||||||
bool ifGood = EvaluateExpression(restOfLine, preprocessorDefinitions);
|
const bool ifGood = EvaluateExpression(restOfLine, preprocessorDefinitions);
|
||||||
if (ifGood) {
|
if (ifGood) {
|
||||||
preproc.InvertCurrentLevel();
|
preproc.InvertCurrentLevel();
|
||||||
activitySet = preproc.IsInactive() ? activeFlag : 0;
|
activitySet = preproc.IsInactive() ? activeFlag : 0;
|
||||||
@ -1238,6 +1340,8 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
|||||||
while ((startValue < restOfLine.length()) && IsSpaceOrTab(restOfLine[startValue]))
|
while ((startValue < restOfLine.length()) && IsSpaceOrTab(restOfLine[startValue]))
|
||||||
startValue++;
|
startValue++;
|
||||||
std::string value = restOfLine.substr(startValue);
|
std::string value = restOfLine.substr(startValue);
|
||||||
|
if (OnlySpaceOrTab(value))
|
||||||
|
value = "1"; // No value defaults to 1
|
||||||
preprocessorDefinitions[key] = value;
|
preprocessorDefinitions[key] = value;
|
||||||
ppDefineHistory.push_back(PPDefinition(lineCurrent, key, value));
|
ppDefineHistory.push_back(PPDefinition(lineCurrent, key, value));
|
||||||
definitionsChanged = true;
|
definitionsChanged = true;
|
||||||
@ -1279,34 +1383,34 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
|||||||
// level store to make it easy to pick up with each increment
|
// level store to make it easy to pick up with each increment
|
||||||
// and to make it possible to fiddle the current level for "} else {".
|
// and to make it possible to fiddle the current level for "} else {".
|
||||||
|
|
||||||
void SCI_METHOD LexerCPP::Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
|
void SCI_METHOD LexerCPP::Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) {
|
||||||
|
|
||||||
if (!options.fold)
|
if (!options.fold)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
LexAccessor styler(pAccess);
|
LexAccessor styler(pAccess);
|
||||||
|
|
||||||
unsigned int endPos = startPos + length;
|
const Sci_PositionU endPos = startPos + length;
|
||||||
int visibleChars = 0;
|
int visibleChars = 0;
|
||||||
bool inLineComment = false;
|
bool inLineComment = false;
|
||||||
int lineCurrent = styler.GetLine(startPos);
|
Sci_Position lineCurrent = styler.GetLine(startPos);
|
||||||
int levelCurrent = SC_FOLDLEVELBASE;
|
int levelCurrent = SC_FOLDLEVELBASE;
|
||||||
if (lineCurrent > 0)
|
if (lineCurrent > 0)
|
||||||
levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
|
levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
|
||||||
unsigned int lineStartNext = styler.LineStart(lineCurrent+1);
|
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent+1);
|
||||||
int levelMinCurrent = levelCurrent;
|
int levelMinCurrent = levelCurrent;
|
||||||
int levelNext = levelCurrent;
|
int levelNext = levelCurrent;
|
||||||
char chNext = styler[startPos];
|
char chNext = styler[startPos];
|
||||||
int styleNext = MaskActive(styler.StyleAt(startPos));
|
int styleNext = MaskActive(styler.StyleAt(startPos));
|
||||||
int style = MaskActive(initStyle);
|
int style = MaskActive(initStyle);
|
||||||
const bool userDefinedFoldMarkers = !options.foldExplicitStart.empty() && !options.foldExplicitEnd.empty();
|
const bool userDefinedFoldMarkers = !options.foldExplicitStart.empty() && !options.foldExplicitEnd.empty();
|
||||||
for (unsigned int i = startPos; i < endPos; i++) {
|
for (Sci_PositionU i = startPos; i < endPos; i++) {
|
||||||
char ch = chNext;
|
const char ch = chNext;
|
||||||
chNext = styler.SafeGetCharAt(i + 1);
|
chNext = styler.SafeGetCharAt(i + 1);
|
||||||
int stylePrev = style;
|
const int stylePrev = style;
|
||||||
style = styleNext;
|
style = styleNext;
|
||||||
styleNext = MaskActive(styler.StyleAt(i + 1));
|
styleNext = MaskActive(styler.StyleAt(i + 1));
|
||||||
bool atEOL = i == (lineStartNext-1);
|
const bool atEOL = i == (lineStartNext-1);
|
||||||
if ((style == SCE_C_COMMENTLINE) || (style == SCE_C_COMMENTLINEDOC))
|
if ((style == SCE_C_COMMENTLINE) || (style == SCE_C_COMMENTLINEDOC))
|
||||||
inLineComment = true;
|
inLineComment = true;
|
||||||
if (options.foldComment && options.foldCommentMultiline && IsStreamCommentStyle(style) && !inLineComment) {
|
if (options.foldComment && options.foldCommentMultiline && IsStreamCommentStyle(style) && !inLineComment) {
|
||||||
@ -1326,7 +1430,7 @@ void SCI_METHOD LexerCPP::Fold(unsigned int startPos, int length, int initStyle,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((ch == '/') && (chNext == '/')) {
|
if ((ch == '/') && (chNext == '/')) {
|
||||||
char chNext2 = styler.SafeGetCharAt(i + 2);
|
const char chNext2 = styler.SafeGetCharAt(i + 2);
|
||||||
if (chNext2 == '{') {
|
if (chNext2 == '{') {
|
||||||
levelNext++;
|
levelNext++;
|
||||||
} else if (chNext2 == '}') {
|
} else if (chNext2 == '}') {
|
||||||
@ -1337,7 +1441,7 @@ void SCI_METHOD LexerCPP::Fold(unsigned int startPos, int length, int initStyle,
|
|||||||
}
|
}
|
||||||
if (options.foldPreprocessor && (style == SCE_C_PREPROCESSOR)) {
|
if (options.foldPreprocessor && (style == SCE_C_PREPROCESSOR)) {
|
||||||
if (ch == '#') {
|
if (ch == '#') {
|
||||||
unsigned int j = i + 1;
|
Sci_PositionU j = i + 1;
|
||||||
while ((j < endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) {
|
while ((j < endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) {
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
@ -1346,17 +1450,21 @@ void SCI_METHOD LexerCPP::Fold(unsigned int startPos, int length, int initStyle,
|
|||||||
} else if (styler.Match(j, "end")) {
|
} else if (styler.Match(j, "end")) {
|
||||||
levelNext--;
|
levelNext--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.foldPreprocessorAtElse && (styler.Match(j, "else") || styler.Match(j, "elif"))) {
|
||||||
|
levelMinCurrent--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (options.foldSyntaxBased && (style == SCE_C_OPERATOR)) {
|
if (options.foldSyntaxBased && (style == SCE_C_OPERATOR)) {
|
||||||
if (ch == '{' || ch == '[') {
|
if (ch == '{' || ch == '[' || ch == '(') {
|
||||||
// Measure the minimum before a '{' to allow
|
// Measure the minimum before a '{' to allow
|
||||||
// folding on "} else {"
|
// folding on "} else {"
|
||||||
if (levelMinCurrent > levelNext) {
|
if (options.foldAtElse && levelMinCurrent > levelNext) {
|
||||||
levelMinCurrent = levelNext;
|
levelMinCurrent = levelNext;
|
||||||
}
|
}
|
||||||
levelNext++;
|
levelNext++;
|
||||||
} else if (ch == '}' || ch == ']') {
|
} else if (ch == '}' || ch == ']' || ch == ')') {
|
||||||
levelNext--;
|
levelNext--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1364,7 +1472,9 @@ void SCI_METHOD LexerCPP::Fold(unsigned int startPos, int length, int initStyle,
|
|||||||
visibleChars++;
|
visibleChars++;
|
||||||
if (atEOL || (i == endPos-1)) {
|
if (atEOL || (i == endPos-1)) {
|
||||||
int levelUse = levelCurrent;
|
int levelUse = levelCurrent;
|
||||||
if (options.foldSyntaxBased && options.foldAtElse) {
|
if ((options.foldSyntaxBased && options.foldAtElse) ||
|
||||||
|
(options.foldPreprocessor && options.foldPreprocessorAtElse)
|
||||||
|
) {
|
||||||
levelUse = levelMinCurrent;
|
levelUse = levelMinCurrent;
|
||||||
}
|
}
|
||||||
int lev = levelUse | levelNext << 16;
|
int lev = levelUse | levelNext << 16;
|
||||||
@ -1379,7 +1489,7 @@ void SCI_METHOD LexerCPP::Fold(unsigned int startPos, int length, int initStyle,
|
|||||||
lineStartNext = styler.LineStart(lineCurrent+1);
|
lineStartNext = styler.LineStart(lineCurrent+1);
|
||||||
levelCurrent = levelNext;
|
levelCurrent = levelNext;
|
||||||
levelMinCurrent = levelCurrent;
|
levelMinCurrent = levelCurrent;
|
||||||
if (atEOL && (i == static_cast<unsigned int>(styler.Length()-1))) {
|
if (atEOL && (i == static_cast<Sci_PositionU>(styler.Length()-1))) {
|
||||||
// There is an empty line at end of file so give it same level and empty
|
// There is an empty line at end of file so give it same level and empty
|
||||||
styler.SetLevel(lineCurrent, (levelCurrent | levelCurrent << 16) | SC_FOLDLEVELWHITEFLAG);
|
styler.SetLevel(lineCurrent, (levelCurrent | levelCurrent << 16) | SC_FOLDLEVELWHITEFLAG);
|
||||||
}
|
}
|
||||||
@ -1419,6 +1529,7 @@ void LexerCPP::EvaluateTokens(std::vector<std::string> &tokens, const SymbolTabl
|
|||||||
if (it != preprocessorDefinitions.end()) {
|
if (it != preprocessorDefinitions.end()) {
|
||||||
val = "1";
|
val = "1";
|
||||||
}
|
}
|
||||||
|
tokens.erase(tokens.begin() + i + 1, tokens.begin() + i + 2);
|
||||||
}
|
}
|
||||||
tokens[i] = val;
|
tokens[i] = val;
|
||||||
} else {
|
} else {
|
||||||
@ -1481,8 +1592,8 @@ void LexerCPP::EvaluateTokens(std::vector<std::string> &tokens, const SymbolTabl
|
|||||||
tokens.insert(tokens.begin() + i, macroTokens.begin(), macroTokens.end());
|
tokens.insert(tokens.begin() + i, macroTokens.begin(), macroTokens.end());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Identifier not found
|
// Identifier not found and value defaults to zero
|
||||||
tokens.erase(tokens.begin() + i);
|
tokens[i] = "0";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
i++;
|
i++;
|
||||||
@ -1519,18 +1630,20 @@ void LexerCPP::EvaluateTokens(std::vector<std::string> &tokens, const SymbolTabl
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Evaluate expressions in precedence order
|
// Evaluate expressions in precedence order
|
||||||
enum precedence { precArithmetic, precRelative, precLogical };
|
enum precedence { precMult, precAdd, precRelative
|
||||||
for (int prec=precArithmetic; prec <= precLogical; prec++) {
|
, precLogical, /* end marker */ precLast };
|
||||||
|
for (int prec = precMult; prec < precLast; prec++) {
|
||||||
// Looking at 3 tokens at a time so end at 2 before end
|
// Looking at 3 tokens at a time so end at 2 before end
|
||||||
for (size_t k=0; (k+2)<tokens.size();) {
|
for (size_t k=0; (k+2)<tokens.size();) {
|
||||||
char chOp = tokens[k+1][0];
|
const char chOp = tokens[k+1][0];
|
||||||
if (
|
if (
|
||||||
((prec==precArithmetic) && setArithmethicOp.Contains(chOp)) ||
|
((prec==precMult) && setMultOp.Contains(chOp)) ||
|
||||||
|
((prec==precAdd) && setAddOp.Contains(chOp)) ||
|
||||||
((prec==precRelative) && setRelOp.Contains(chOp)) ||
|
((prec==precRelative) && setRelOp.Contains(chOp)) ||
|
||||||
((prec==precLogical) && setLogicalOp.Contains(chOp))
|
((prec==precLogical) && setLogicalOp.Contains(chOp))
|
||||||
) {
|
) {
|
||||||
int valA = atoi(tokens[k].c_str());
|
const int valA = atoi(tokens[k].c_str());
|
||||||
int valB = atoi(tokens[k+2].c_str());
|
const int valB = atoi(tokens[k+2].c_str());
|
||||||
int result = 0;
|
int result = 0;
|
||||||
if (tokens[k+1] == "+")
|
if (tokens[k+1] == "+")
|
||||||
result = valA + valB;
|
result = valA + valB;
|
||||||
@ -1558,11 +1671,9 @@ void LexerCPP::EvaluateTokens(std::vector<std::string> &tokens, const SymbolTabl
|
|||||||
result = valA || valB;
|
result = valA || valB;
|
||||||
else if (tokens[k+1] == "&&")
|
else if (tokens[k+1] == "&&")
|
||||||
result = valA && valB;
|
result = valA && valB;
|
||||||
char sResult[30];
|
|
||||||
sprintf(sResult, "%d", result);
|
|
||||||
std::vector<std::string>::iterator itInsert =
|
std::vector<std::string>::iterator itInsert =
|
||||||
tokens.erase(tokens.begin() + k, tokens.begin() + k + 3);
|
tokens.erase(tokens.begin() + k, tokens.begin() + k + 3);
|
||||||
tokens.insert(itInsert, sResult);
|
tokens.insert(itInsert, std::to_string(result));
|
||||||
} else {
|
} else {
|
||||||
k++;
|
k++;
|
||||||
}
|
}
|
||||||
@ -1617,7 +1728,7 @@ bool LexerCPP::EvaluateExpression(const std::string &expr, const SymbolTable &pr
|
|||||||
EvaluateTokens(tokens, preprocessorDefinitions);
|
EvaluateTokens(tokens, preprocessorDefinitions);
|
||||||
|
|
||||||
// "0" or "" -> false else true
|
// "0" or "" -> false else true
|
||||||
bool isFalse = tokens.empty() ||
|
const bool isFalse = tokens.empty() ||
|
||||||
((tokens.size() == 1) && ((tokens[0] == "") || tokens[0] == "0"));
|
((tokens.size() == 1) && ((tokens[0] == "") || tokens[0] == "0"));
|
||||||
return !isFalse;
|
return !isFalse;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
// Scintilla source code edit control
|
// Scintilla source code edit control
|
||||||
|
// Encoding: UTF-8
|
||||||
/** @file LexCSS.cxx
|
/** @file LexCSS.cxx
|
||||||
** Lexer for Cascading Style Sheets
|
** Lexer for Cascading Style Sheets
|
||||||
** Written by Jakub Vrána
|
** Written by Jakub Vrána
|
||||||
** Improved by Philippe Lhoste (CSS2)
|
** Improved by Philippe Lhoste (CSS2)
|
||||||
** Improved by Ross McKay (SCSS mode; see http://sass-lang.com/ )
|
** Improved by Ross McKay (SCSS mode; see http://sass-lang.com/ )
|
||||||
**/
|
**/
|
||||||
@ -31,9 +32,7 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static inline bool IsAWordChar(const unsigned int ch) {
|
static inline bool IsAWordChar(const unsigned int ch) {
|
||||||
@ -58,11 +57,11 @@ inline bool IsCssOperator(const int ch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// look behind (from start of document to our start position) to determine current nesting level
|
// look behind (from start of document to our start position) to determine current nesting level
|
||||||
inline int NestingLevelLookBehind(unsigned int startPos, Accessor &styler) {
|
inline int NestingLevelLookBehind(Sci_PositionU startPos, Accessor &styler) {
|
||||||
int ch;
|
int ch;
|
||||||
int nestingLevel = 0;
|
int nestingLevel = 0;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < startPos; i++) {
|
for (Sci_PositionU i = 0; i < startPos; i++) {
|
||||||
ch = styler.SafeGetCharAt(i);
|
ch = styler.SafeGetCharAt(i);
|
||||||
if (ch == '{')
|
if (ch == '{')
|
||||||
nestingLevel++;
|
nestingLevel++;
|
||||||
@ -73,7 +72,7 @@ inline int NestingLevelLookBehind(unsigned int startPos, Accessor &styler) {
|
|||||||
return nestingLevel;
|
return nestingLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) {
|
static void ColouriseCssDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], Accessor &styler) {
|
||||||
WordList &css1Props = *keywordlists[0];
|
WordList &css1Props = *keywordlists[0];
|
||||||
WordList &pseudoClasses = *keywordlists[1];
|
WordList &pseudoClasses = *keywordlists[1];
|
||||||
WordList &css2Props = *keywordlists[2];
|
WordList &css2Props = *keywordlists[2];
|
||||||
@ -131,7 +130,7 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo
|
|||||||
if (lastStateC == -1) {
|
if (lastStateC == -1) {
|
||||||
// backtrack to get last state:
|
// backtrack to get last state:
|
||||||
// comments are like whitespace, so we must return to the previous state
|
// comments are like whitespace, so we must return to the previous state
|
||||||
unsigned int i = startPos;
|
Sci_PositionU i = startPos;
|
||||||
for (; i > 0; i--) {
|
for (; i > 0; i--) {
|
||||||
if ((lastStateC = styler.StyleAt(i-1)) != SCE_CSS_COMMENT) {
|
if ((lastStateC = styler.StyleAt(i-1)) != SCE_CSS_COMMENT) {
|
||||||
if (lastStateC == SCE_CSS_OPERATOR) {
|
if (lastStateC == SCE_CSS_OPERATOR) {
|
||||||
@ -165,7 +164,7 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo
|
|||||||
if (sc.state == SCE_CSS_DOUBLESTRING || sc.state == SCE_CSS_SINGLESTRING) {
|
if (sc.state == SCE_CSS_DOUBLESTRING || sc.state == SCE_CSS_SINGLESTRING) {
|
||||||
if (sc.ch != (sc.state == SCE_CSS_DOUBLESTRING ? '\"' : '\''))
|
if (sc.ch != (sc.state == SCE_CSS_DOUBLESTRING ? '\"' : '\''))
|
||||||
continue;
|
continue;
|
||||||
unsigned int i = sc.currentPos;
|
Sci_PositionU i = sc.currentPos;
|
||||||
while (i && styler[i-1] == '\\')
|
while (i && styler[i-1] == '\\')
|
||||||
i--;
|
i--;
|
||||||
if ((sc.currentPos - i) % 2 == 1)
|
if ((sc.currentPos - i) % 2 == 1)
|
||||||
@ -175,7 +174,7 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo
|
|||||||
|
|
||||||
if (sc.state == SCE_CSS_OPERATOR) {
|
if (sc.state == SCE_CSS_OPERATOR) {
|
||||||
if (op == ' ') {
|
if (op == ' ') {
|
||||||
unsigned int i = startPos;
|
Sci_PositionU i = startPos;
|
||||||
op = styler.SafeGetCharAt(i-1);
|
op = styler.SafeGetCharAt(i-1);
|
||||||
opPrev = styler.SafeGetCharAt(i-2);
|
opPrev = styler.SafeGetCharAt(i-2);
|
||||||
while (--i) {
|
while (--i) {
|
||||||
@ -347,6 +346,7 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo
|
|||||||
case SCE_CSS_DEFAULT:
|
case SCE_CSS_DEFAULT:
|
||||||
if (isLessDocument) // give priority to pseudo elements
|
if (isLessDocument) // give priority to pseudo elements
|
||||||
break;
|
break;
|
||||||
|
// Falls through.
|
||||||
case SCE_CSS_VALUE:
|
case SCE_CSS_VALUE:
|
||||||
lastStateVar = sc.state;
|
lastStateVar = sc.state;
|
||||||
sc.SetState(SCE_CSS_VARIABLE);
|
sc.SetState(SCE_CSS_VARIABLE);
|
||||||
@ -380,10 +380,10 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo
|
|||||||
// check for nested rule selector
|
// check for nested rule selector
|
||||||
if (sc.state == SCE_CSS_IDENTIFIER && (IsAWordChar(sc.ch) || sc.ch == ':' || sc.ch == '.' || sc.ch == '#')) {
|
if (sc.state == SCE_CSS_IDENTIFIER && (IsAWordChar(sc.ch) || sc.ch == ':' || sc.ch == '.' || sc.ch == '#')) {
|
||||||
// look ahead to see whether { comes before next ; and }
|
// look ahead to see whether { comes before next ; and }
|
||||||
unsigned int endPos = startPos + length;
|
Sci_PositionU endPos = startPos + length;
|
||||||
int ch;
|
int ch;
|
||||||
|
|
||||||
for (unsigned int i = sc.currentPos; i < endPos; i++) {
|
for (Sci_PositionU i = sc.currentPos; i < endPos; i++) {
|
||||||
ch = styler.SafeGetCharAt(i);
|
ch = styler.SafeGetCharAt(i);
|
||||||
if (ch == ';' || ch == '}')
|
if (ch == ';' || ch == '}')
|
||||||
break;
|
break;
|
||||||
@ -502,17 +502,17 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo
|
|||||||
sc.Complete();
|
sc.Complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FoldCSSDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
|
static void FoldCSSDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *[], Accessor &styler) {
|
||||||
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
|
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
|
||||||
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
||||||
unsigned int endPos = startPos + length;
|
Sci_PositionU endPos = startPos + length;
|
||||||
int visibleChars = 0;
|
int visibleChars = 0;
|
||||||
int lineCurrent = styler.GetLine(startPos);
|
Sci_Position lineCurrent = styler.GetLine(startPos);
|
||||||
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
|
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
|
||||||
int levelCurrent = levelPrev;
|
int levelCurrent = levelPrev;
|
||||||
char chNext = styler[startPos];
|
char chNext = styler[startPos];
|
||||||
bool inComment = (styler.StyleAt(startPos-1) == SCE_CSS_COMMENT);
|
bool inComment = (styler.StyleAt(startPos-1) == SCE_CSS_COMMENT);
|
||||||
for (unsigned int i = startPos; i < endPos; i++) {
|
for (Sci_PositionU i = startPos; i < endPos; i++) {
|
||||||
char ch = chNext;
|
char ch = chNext;
|
||||||
chNext = styler.SafeGetCharAt(i + 1);
|
chNext = styler.SafeGetCharAt(i + 1);
|
||||||
int style = styler.StyleAt(i);
|
int style = styler.StyleAt(i);
|
||||||
|
@ -37,6 +37,10 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
|
|
||||||
|
#if defined(__clang__)
|
||||||
|
#pragma clang diagnostic ignored "-Wcomma"
|
||||||
|
#endif
|
||||||
|
|
||||||
// Since the Microsoft __iscsym[f] funcs are not ANSI...
|
// Since the Microsoft __iscsym[f] funcs are not ANSI...
|
||||||
inline int iscaml(int c) {return isalnum(c) || c == '_';}
|
inline int iscaml(int c) {return isalnum(c) || c == '_';}
|
||||||
inline int iscamlf(int c) {return isalpha(c) || c == '_';}
|
inline int iscamlf(int c) {return isalpha(c) || c == '_';}
|
||||||
@ -46,9 +50,7 @@ static const int baseT[24] = {
|
|||||||
0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0,16 /* M - X */
|
0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0,16 /* M - X */
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILD_AS_EXTERNAL_LEXER
|
#ifdef BUILD_AS_EXTERNAL_LEXER
|
||||||
/*
|
/*
|
||||||
@ -66,18 +68,18 @@ using namespace Scintilla;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void ColouriseCamlDoc(
|
static void ColouriseCamlDoc(
|
||||||
unsigned int startPos, int length,
|
Sci_PositionU startPos, Sci_Position length,
|
||||||
int initStyle,
|
int initStyle,
|
||||||
WordList *keywordlists[],
|
WordList *keywordlists[],
|
||||||
Accessor &styler);
|
Accessor &styler);
|
||||||
|
|
||||||
static void FoldCamlDoc(
|
static void FoldCamlDoc(
|
||||||
unsigned int startPos, int length,
|
Sci_PositionU startPos, Sci_Position length,
|
||||||
int initStyle,
|
int initStyle,
|
||||||
WordList *keywordlists[],
|
WordList *keywordlists[],
|
||||||
Accessor &styler);
|
Accessor &styler);
|
||||||
|
|
||||||
static void InternalLexOrFold(int lexOrFold, unsigned int startPos, int length,
|
static void InternalLexOrFold(int lexOrFold, Sci_PositionU startPos, Sci_Position length,
|
||||||
int initStyle, char *words[], WindowID window, char *props);
|
int initStyle, char *words[], WindowID window, char *props);
|
||||||
|
|
||||||
static const char* LexerName = "caml";
|
static const char* LexerName = "caml";
|
||||||
@ -109,7 +111,7 @@ long Platform::SendScintillaPointer(WindowID w, unsigned int msg, unsigned long
|
|||||||
reinterpret_cast<LPARAM>(lParam));
|
reinterpret_cast<LPARAM>(lParam));
|
||||||
}
|
}
|
||||||
|
|
||||||
void EXT_LEXER_DECL Fold(unsigned int lexer, unsigned int startPos, int length,
|
void EXT_LEXER_DECL Fold(unsigned int lexer, Sci_PositionU startPos, Sci_Position length,
|
||||||
int initStyle, char *words[], WindowID window, char *props)
|
int initStyle, char *words[], WindowID window, char *props)
|
||||||
{
|
{
|
||||||
// below useless evaluation(s) to supress "not used" warnings
|
// below useless evaluation(s) to supress "not used" warnings
|
||||||
@ -138,7 +140,7 @@ void EXT_LEXER_DECL GetLexerName(unsigned int Index, char *name, int buflength)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EXT_LEXER_DECL Lex(unsigned int lexer, unsigned int startPos, int length,
|
void EXT_LEXER_DECL Lex(unsigned int lexer, Sci_PositionU startPos, Sci_Position length,
|
||||||
int initStyle, char *words[], WindowID window, char *props)
|
int initStyle, char *words[], WindowID window, char *props)
|
||||||
{
|
{
|
||||||
// below useless evaluation(s) to supress "not used" warnings
|
// below useless evaluation(s) to supress "not used" warnings
|
||||||
@ -147,7 +149,7 @@ void EXT_LEXER_DECL Lex(unsigned int lexer, unsigned int startPos, int length,
|
|||||||
InternalLexOrFold(0, startPos, length, initStyle, words, window, props);
|
InternalLexOrFold(0, startPos, length, initStyle, words, window, props);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InternalLexOrFold(int foldOrLex, unsigned int startPos, int length,
|
static void InternalLexOrFold(int foldOrLex, Sci_PositionU startPos, Sci_Position length,
|
||||||
int initStyle, char *words[], WindowID window, char *props)
|
int initStyle, char *words[], WindowID window, char *props)
|
||||||
{
|
{
|
||||||
// create and initialize a WindowAccessor (including contained PropSet)
|
// create and initialize a WindowAccessor (including contained PropSet)
|
||||||
@ -180,7 +182,7 @@ static
|
|||||||
#endif /* BUILD_AS_EXTERNAL_LEXER */
|
#endif /* BUILD_AS_EXTERNAL_LEXER */
|
||||||
|
|
||||||
void ColouriseCamlDoc(
|
void ColouriseCamlDoc(
|
||||||
unsigned int startPos, int length,
|
Sci_PositionU startPos, Sci_Position length,
|
||||||
int initStyle,
|
int initStyle,
|
||||||
WordList *keywordlists[],
|
WordList *keywordlists[],
|
||||||
Accessor &styler)
|
Accessor &styler)
|
||||||
@ -188,7 +190,8 @@ void ColouriseCamlDoc(
|
|||||||
// initialize styler
|
// initialize styler
|
||||||
StyleContext sc(startPos, length, initStyle, styler);
|
StyleContext sc(startPos, length, initStyle, styler);
|
||||||
|
|
||||||
int chBase = 0, chToken = 0, chLit = 0;
|
Sci_PositionU chToken = 0;
|
||||||
|
int chBase = 0, chLit = 0;
|
||||||
WordList& keywords = *keywordlists[0];
|
WordList& keywords = *keywordlists[0];
|
||||||
WordList& keywords2 = *keywordlists[1];
|
WordList& keywords2 = *keywordlists[1];
|
||||||
WordList& keywords3 = *keywordlists[2];
|
WordList& keywords3 = *keywordlists[2];
|
||||||
@ -206,7 +209,7 @@ void ColouriseCamlDoc(
|
|||||||
while (sc.More()) {
|
while (sc.More()) {
|
||||||
// set up [per-char] state info
|
// set up [per-char] state info
|
||||||
int state2 = -1; // (ASSUME no state change)
|
int state2 = -1; // (ASSUME no state change)
|
||||||
int chColor = sc.currentPos - 1;// (ASSUME standard coloring range)
|
Sci_Position chColor = sc.currentPos - 1;// (ASSUME standard coloring range)
|
||||||
bool advance = true; // (ASSUME scanner "eats" 1 char)
|
bool advance = true; // (ASSUME scanner "eats" 1 char)
|
||||||
|
|
||||||
// step state machine
|
// step state machine
|
||||||
@ -254,11 +257,11 @@ void ColouriseCamlDoc(
|
|||||||
case SCE_CAML_IDENTIFIER:
|
case SCE_CAML_IDENTIFIER:
|
||||||
// [try to] interpret as [additional] identifier char
|
// [try to] interpret as [additional] identifier char
|
||||||
if (!(iscaml(sc.ch) || sc.Match('\''))) {
|
if (!(iscaml(sc.ch) || sc.Match('\''))) {
|
||||||
const int n = sc.currentPos - chToken;
|
const Sci_Position n = sc.currentPos - chToken;
|
||||||
if (n < 24) {
|
if (n < 24) {
|
||||||
// length is believable as keyword, [re-]construct token
|
// length is believable as keyword, [re-]construct token
|
||||||
char t[24];
|
char t[24];
|
||||||
for (int i = -n; i < 0; i++)
|
for (Sci_Position i = -n; i < 0; i++)
|
||||||
t[n + i] = static_cast<char>(sc.GetRelative(i));
|
t[n + i] = static_cast<char>(sc.GetRelative(i));
|
||||||
t[n] = '\0';
|
t[n] = '\0';
|
||||||
// special-case "_" token as KEYWORD
|
// special-case "_" token as KEYWORD
|
||||||
@ -367,6 +370,7 @@ void ColouriseCamlDoc(
|
|||||||
break;
|
break;
|
||||||
}/* else
|
}/* else
|
||||||
// fall through for SML char literal (handle like string) */
|
// fall through for SML char literal (handle like string) */
|
||||||
|
// Falls through.
|
||||||
|
|
||||||
case SCE_CAML_STRING:
|
case SCE_CAML_STRING:
|
||||||
// [try to] interpret as [additional] [SML char/] string literal char
|
// [try to] interpret as [additional] [SML char/] string literal char
|
||||||
@ -390,7 +394,7 @@ void ColouriseCamlDoc(
|
|||||||
state2 = SCE_CAML_STRING, sc.ch = ' ' /* (...\") */, chColor++,
|
state2 = SCE_CAML_STRING, sc.ch = ' ' /* (...\") */, chColor++,
|
||||||
styler.ColourTo(chColor, SCE_CAML_WHITE), styler.Flush();
|
styler.ColourTo(chColor, SCE_CAML_WHITE), styler.Flush();
|
||||||
// ... then backtrack to determine original SML literal type
|
// ... then backtrack to determine original SML literal type
|
||||||
int p = chColor - 2;
|
Sci_Position p = chColor - 2;
|
||||||
for (; p >= 0 && styler.StyleAt(p) == SCE_CAML_WHITE; p--) ;
|
for (; p >= 0 && styler.StyleAt(p) == SCE_CAML_WHITE; p--) ;
|
||||||
if (p >= 0)
|
if (p >= 0)
|
||||||
state2 = static_cast<int>(styler.StyleAt(p));
|
state2 = static_cast<int>(styler.StyleAt(p));
|
||||||
@ -437,7 +441,7 @@ void ColouriseCamlDoc(
|
|||||||
static
|
static
|
||||||
#endif /* BUILD_AS_EXTERNAL_LEXER */
|
#endif /* BUILD_AS_EXTERNAL_LEXER */
|
||||||
void FoldCamlDoc(
|
void FoldCamlDoc(
|
||||||
unsigned int, int,
|
Sci_PositionU, Sci_Position,
|
||||||
int,
|
int,
|
||||||
WordList *[],
|
WordList *[],
|
||||||
Accessor &)
|
Accessor &)
|
||||||
|
@ -24,9 +24,7 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
static bool isCmakeNumber(char ch)
|
static bool isCmakeNumber(char ch)
|
||||||
{
|
{
|
||||||
@ -43,10 +41,10 @@ static bool isCmakeLetter(char ch)
|
|||||||
return(ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
|
return(ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool CmakeNextLineHasElse(unsigned int start, unsigned int end, Accessor &styler)
|
static bool CmakeNextLineHasElse(Sci_PositionU start, Sci_PositionU end, Accessor &styler)
|
||||||
{
|
{
|
||||||
int nNextLine = -1;
|
Sci_Position nNextLine = -1;
|
||||||
for ( unsigned int i = start; i < end; i++ ) {
|
for ( Sci_PositionU i = start; i < end; i++ ) {
|
||||||
char cNext = styler.SafeGetCharAt( i );
|
char cNext = styler.SafeGetCharAt( i );
|
||||||
if ( cNext == '\n' ) {
|
if ( cNext == '\n' ) {
|
||||||
nNextLine = i+1;
|
nNextLine = i+1;
|
||||||
@ -57,7 +55,7 @@ static bool CmakeNextLineHasElse(unsigned int start, unsigned int end, Accessor
|
|||||||
if ( nNextLine == -1 ) // We never foudn the next line...
|
if ( nNextLine == -1 ) // We never foudn the next line...
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for ( unsigned int firstChar = nNextLine; firstChar < end; firstChar++ ) {
|
for ( Sci_PositionU firstChar = nNextLine; firstChar < end; firstChar++ ) {
|
||||||
char cNext = styler.SafeGetCharAt( firstChar );
|
char cNext = styler.SafeGetCharAt( firstChar );
|
||||||
if ( cNext == ' ' )
|
if ( cNext == ' ' )
|
||||||
continue;
|
continue;
|
||||||
@ -71,7 +69,7 @@ static bool CmakeNextLineHasElse(unsigned int start, unsigned int end, Accessor
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int calculateFoldCmake(unsigned int start, unsigned int end, int foldlevel, Accessor &styler, bool bElse)
|
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 the word is too long, it is not what we are looking for
|
||||||
if ( end - start > 20 )
|
if ( end - start > 20 )
|
||||||
@ -100,7 +98,7 @@ static int calculateFoldCmake(unsigned int start, unsigned int end, int foldleve
|
|||||||
return newFoldlevel;
|
return newFoldlevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int classifyWordCmake(unsigned int start, unsigned int end, WordList *keywordLists[], Accessor &styler )
|
static int classifyWordCmake(Sci_PositionU start, Sci_PositionU end, WordList *keywordLists[], Accessor &styler )
|
||||||
{
|
{
|
||||||
char word[100] = {0};
|
char word[100] = {0};
|
||||||
char lowercaseWord[100] = {0};
|
char lowercaseWord[100] = {0};
|
||||||
@ -109,7 +107,7 @@ static int classifyWordCmake(unsigned int start, unsigned int end, WordList *key
|
|||||||
WordList &Parameters = *keywordLists[1];
|
WordList &Parameters = *keywordLists[1];
|
||||||
WordList &UserDefined = *keywordLists[2];
|
WordList &UserDefined = *keywordLists[2];
|
||||||
|
|
||||||
for (unsigned int i = 0; i < end - start + 1 && i < 99; i++) {
|
for (Sci_PositionU i = 0; i < end - start + 1 && i < 99; i++) {
|
||||||
word[i] = static_cast<char>( styler[ start + i ] );
|
word[i] = static_cast<char>( styler[ start + i ] );
|
||||||
lowercaseWord[i] = static_cast<char>(tolower(word[i]));
|
lowercaseWord[i] = static_cast<char>(tolower(word[i]));
|
||||||
}
|
}
|
||||||
@ -162,7 +160,7 @@ static int classifyWordCmake(unsigned int start, unsigned int end, WordList *key
|
|||||||
return SCE_CMAKE_DEFAULT;
|
return SCE_CMAKE_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ColouriseCmakeDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler)
|
static void ColouriseCmakeDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *keywordLists[], Accessor &styler)
|
||||||
{
|
{
|
||||||
int state = SCE_CMAKE_DEFAULT;
|
int state = SCE_CMAKE_DEFAULT;
|
||||||
if ( startPos > 0 )
|
if ( startPos > 0 )
|
||||||
@ -171,14 +169,14 @@ static void ColouriseCmakeDoc(unsigned int startPos, int length, int, WordList *
|
|||||||
styler.StartAt( startPos );
|
styler.StartAt( startPos );
|
||||||
styler.GetLine( startPos );
|
styler.GetLine( startPos );
|
||||||
|
|
||||||
unsigned int nLengthDoc = startPos + length;
|
Sci_PositionU nLengthDoc = startPos + length;
|
||||||
styler.StartSegment( startPos );
|
styler.StartSegment( startPos );
|
||||||
|
|
||||||
char cCurrChar;
|
char cCurrChar;
|
||||||
bool bVarInString = false;
|
bool bVarInString = false;
|
||||||
bool bClassicVarInString = false;
|
bool bClassicVarInString = false;
|
||||||
|
|
||||||
unsigned int i;
|
Sci_PositionU i;
|
||||||
for ( i = startPos; i < nLengthDoc; i++ ) {
|
for ( i = startPos; i < nLengthDoc; i++ ) {
|
||||||
cCurrChar = styler.SafeGetCharAt( i );
|
cCurrChar = styler.SafeGetCharAt( i );
|
||||||
char cNextChar = styler.SafeGetCharAt(i+1);
|
char cNextChar = styler.SafeGetCharAt(i+1);
|
||||||
@ -263,8 +261,8 @@ static void ColouriseCmakeDoc(unsigned int startPos, int length, int, WordList *
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( cNextChar == '\r' || cNextChar == '\n' ) {
|
if ( cNextChar == '\r' || cNextChar == '\n' ) {
|
||||||
int nCurLine = styler.GetLine(i+1);
|
Sci_Position nCurLine = styler.GetLine(i+1);
|
||||||
int nBack = i;
|
Sci_Position nBack = i;
|
||||||
// We need to check if the previous line has a \ in it...
|
// We need to check if the previous line has a \ in it...
|
||||||
bool bNextLine = false;
|
bool bNextLine = false;
|
||||||
|
|
||||||
@ -377,7 +375,7 @@ static void ColouriseCmakeDoc(unsigned int startPos, int length, int, WordList *
|
|||||||
styler.ColourTo(nLengthDoc-1,state);
|
styler.ColourTo(nLengthDoc-1,state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FoldCmakeDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler)
|
static void FoldCmakeDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *[], Accessor &styler)
|
||||||
{
|
{
|
||||||
// No folding enabled, no reason to continue...
|
// No folding enabled, no reason to continue...
|
||||||
if ( styler.GetPropertyInt("fold") == 0 )
|
if ( styler.GetPropertyInt("fold") == 0 )
|
||||||
@ -385,18 +383,18 @@ static void FoldCmakeDoc(unsigned int startPos, int length, int, WordList *[], A
|
|||||||
|
|
||||||
bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) == 1;
|
bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) == 1;
|
||||||
|
|
||||||
int lineCurrent = styler.GetLine(startPos);
|
Sci_Position lineCurrent = styler.GetLine(startPos);
|
||||||
unsigned int safeStartPos = styler.LineStart( lineCurrent );
|
Sci_PositionU safeStartPos = styler.LineStart( lineCurrent );
|
||||||
|
|
||||||
bool bArg1 = true;
|
bool bArg1 = true;
|
||||||
int nWordStart = -1;
|
Sci_Position nWordStart = -1;
|
||||||
|
|
||||||
int levelCurrent = SC_FOLDLEVELBASE;
|
int levelCurrent = SC_FOLDLEVELBASE;
|
||||||
if (lineCurrent > 0)
|
if (lineCurrent > 0)
|
||||||
levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
|
levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
|
||||||
int levelNext = levelCurrent;
|
int levelNext = levelCurrent;
|
||||||
|
|
||||||
for (unsigned int i = safeStartPos; i < startPos + length; i++) {
|
for (Sci_PositionU i = safeStartPos; i < startPos + length; i++) {
|
||||||
char chCurr = styler.SafeGetCharAt(i);
|
char chCurr = styler.SafeGetCharAt(i);
|
||||||
|
|
||||||
if ( bArg1 ) {
|
if ( bArg1 ) {
|
||||||
|
@ -14,7 +14,8 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "Platform.h"
|
#include <algorithm>
|
||||||
|
|
||||||
#include "ILexer.h"
|
#include "ILexer.h"
|
||||||
#include "Scintilla.h"
|
#include "Scintilla.h"
|
||||||
#include "SciLexer.h"
|
#include "SciLexer.h"
|
||||||
@ -26,9 +27,7 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
static bool IsSpaceEquiv(int state) {
|
static bool IsSpaceEquiv(int state) {
|
||||||
return (state == SCE_COFFEESCRIPT_DEFAULT
|
return (state == SCE_COFFEESCRIPT_DEFAULT
|
||||||
@ -40,6 +39,36 @@ static bool IsSpaceEquiv(int state) {
|
|||||||
|| state == SCE_COFFEESCRIPT_REGEX);
|
|| 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 '-'.
|
// Preconditions: sc.currentPos points to a character after '+' or '-'.
|
||||||
// The test for pos reaching 0 should be redundant,
|
// The test for pos reaching 0 should be redundant,
|
||||||
// and is in only for safety measures.
|
// and is in only for safety measures.
|
||||||
@ -48,7 +77,7 @@ static bool IsSpaceEquiv(int state) {
|
|||||||
// Putting a space between the '++' post-inc operator and the '+' binary op
|
// Putting a space between the '++' post-inc operator and the '+' binary op
|
||||||
// fixes this, and is highly recommended for readability anyway.
|
// fixes this, and is highly recommended for readability anyway.
|
||||||
static bool FollowsPostfixOperator(StyleContext &sc, Accessor &styler) {
|
static bool FollowsPostfixOperator(StyleContext &sc, Accessor &styler) {
|
||||||
int pos = (int) sc.currentPos;
|
Sci_Position pos = (Sci_Position) sc.currentPos;
|
||||||
while (--pos > 0) {
|
while (--pos > 0) {
|
||||||
char ch = styler[pos];
|
char ch = styler[pos];
|
||||||
if (ch == '+' || ch == '-') {
|
if (ch == '+' || ch == '-') {
|
||||||
@ -58,29 +87,21 @@ static bool FollowsPostfixOperator(StyleContext &sc, Accessor &styler) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool followsReturnKeyword(StyleContext &sc, Accessor &styler) {
|
static bool followsKeyword(StyleContext &sc, Accessor &styler) {
|
||||||
// Don't look at styles, so no need to flush.
|
Sci_Position pos = (Sci_Position) sc.currentPos;
|
||||||
int pos = (int) sc.currentPos;
|
Sci_Position currentLine = styler.GetLine(pos);
|
||||||
int currentLine = styler.GetLine(pos);
|
Sci_Position lineStartPos = styler.LineStart(currentLine);
|
||||||
int lineStartPos = styler.LineStart(currentLine);
|
|
||||||
while (--pos > lineStartPos) {
|
while (--pos > lineStartPos) {
|
||||||
char ch = styler.SafeGetCharAt(pos);
|
char ch = styler.SafeGetCharAt(pos);
|
||||||
if (ch != ' ' && ch != '\t') {
|
if (ch != ' ' && ch != '\t') {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const char *retBack = "nruter";
|
styler.Flush();
|
||||||
const char *s = retBack;
|
return styler.StyleAt(pos) == SCE_COFFEESCRIPT_WORD;
|
||||||
while (*s
|
|
||||||
&& pos >= lineStartPos
|
|
||||||
&& styler.SafeGetCharAt(pos) == *s) {
|
|
||||||
s++;
|
|
||||||
pos--;
|
|
||||||
}
|
|
||||||
return !*s;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ColouriseCoffeeScriptDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
|
static void ColouriseCoffeeScriptDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[],
|
||||||
Accessor &styler) {
|
Accessor &styler) {
|
||||||
|
|
||||||
WordList &keywords = *keywordlists[0];
|
WordList &keywords = *keywordlists[0];
|
||||||
@ -96,10 +117,31 @@ static void ColouriseCoffeeScriptDoc(unsigned int startPos, int length, int init
|
|||||||
int chPrevNonWhite = ' ';
|
int chPrevNonWhite = ' ';
|
||||||
int visibleChars = 0;
|
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
|
// look back to set chPrevNonWhite properly for better regex colouring
|
||||||
int endPos = startPos + length;
|
Sci_Position endPos = startPos + length;
|
||||||
if (startPos > 0 && IsSpaceEquiv(initStyle)) {
|
if (startPos > 0 && IsSpaceEquiv(initStyle)) {
|
||||||
unsigned int back = startPos;
|
Sci_PositionU back = startPos;
|
||||||
styler.Flush();
|
styler.Flush();
|
||||||
while (back > 0 && IsSpaceEquiv(styler.StyleAt(--back)))
|
while (back > 0 && IsSpaceEquiv(styler.StyleAt(--back)))
|
||||||
;
|
;
|
||||||
@ -117,7 +159,7 @@ static void ColouriseCoffeeScriptDoc(unsigned int startPos, int length, int init
|
|||||||
|
|
||||||
StyleContext sc(startPos, endPos - startPos, initStyle, styler);
|
StyleContext sc(startPos, endPos - startPos, initStyle, styler);
|
||||||
|
|
||||||
for (; sc.More(); sc.Forward()) {
|
for (; sc.More();) {
|
||||||
|
|
||||||
if (sc.atLineStart) {
|
if (sc.atLineStart) {
|
||||||
// Reset states to beginning of colourise so no surprises
|
// Reset states to beginning of colourise so no surprises
|
||||||
@ -146,6 +188,8 @@ static void ColouriseCoffeeScriptDoc(unsigned int startPos, int length, int init
|
|||||||
sc.ChangeState(SCE_COFFEESCRIPT_WORD2);
|
sc.ChangeState(SCE_COFFEESCRIPT_WORD2);
|
||||||
} else if (keywords4.InList(s)) {
|
} else if (keywords4.InList(s)) {
|
||||||
sc.ChangeState(SCE_COFFEESCRIPT_GLOBALCLASS);
|
sc.ChangeState(SCE_COFFEESCRIPT_GLOBALCLASS);
|
||||||
|
} else if (sc.LengthCurrent() > 0 && s[0] == '@') {
|
||||||
|
sc.ChangeState(SCE_COFFEESCRIPT_INSTANCEPROPERTY);
|
||||||
}
|
}
|
||||||
sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
|
sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
|
||||||
}
|
}
|
||||||
@ -153,6 +197,7 @@ static void ColouriseCoffeeScriptDoc(unsigned int startPos, int length, int init
|
|||||||
case SCE_COFFEESCRIPT_WORD:
|
case SCE_COFFEESCRIPT_WORD:
|
||||||
case SCE_COFFEESCRIPT_WORD2:
|
case SCE_COFFEESCRIPT_WORD2:
|
||||||
case SCE_COFFEESCRIPT_GLOBALCLASS:
|
case SCE_COFFEESCRIPT_GLOBALCLASS:
|
||||||
|
case SCE_COFFEESCRIPT_INSTANCEPROPERTY:
|
||||||
if (!setWord.Contains(sc.ch)) {
|
if (!setWord.Contains(sc.ch)) {
|
||||||
sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
|
sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
|
||||||
}
|
}
|
||||||
@ -169,6 +214,15 @@ static void ColouriseCoffeeScriptDoc(unsigned int startPos, int length, int init
|
|||||||
}
|
}
|
||||||
} else if (sc.ch == '\"') {
|
} else if (sc.ch == '\"') {
|
||||||
sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT);
|
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;
|
break;
|
||||||
case SCE_COFFEESCRIPT_CHARACTER:
|
case SCE_COFFEESCRIPT_CHARACTER:
|
||||||
@ -239,7 +293,7 @@ static void ColouriseCoffeeScriptDoc(unsigned int startPos, int length, int init
|
|||||||
sc.Forward();
|
sc.Forward();
|
||||||
} else if (sc.ch == '/'
|
} else if (sc.ch == '/'
|
||||||
&& (setOKBeforeRE.Contains(chPrevNonWhite)
|
&& (setOKBeforeRE.Contains(chPrevNonWhite)
|
||||||
|| followsReturnKeyword(sc, styler))
|
|| followsKeyword(sc, styler))
|
||||||
&& (!setCouldBePostOp.Contains(chPrevNonWhite)
|
&& (!setCouldBePostOp.Contains(chPrevNonWhite)
|
||||||
|| !FollowsPostfixOperator(sc, styler))) {
|
|| !FollowsPostfixOperator(sc, styler))) {
|
||||||
sc.SetState(SCE_COFFEESCRIPT_REGEX); // JavaScript's RegEx
|
sc.SetState(SCE_COFFEESCRIPT_REGEX); // JavaScript's RegEx
|
||||||
@ -257,6 +311,19 @@ static void ColouriseCoffeeScriptDoc(unsigned int startPos, int length, int init
|
|||||||
}
|
}
|
||||||
} else if (isoperator(static_cast<char>(sc.ch))) {
|
} else if (isoperator(static_cast<char>(sc.ch))) {
|
||||||
sc.SetState(SCE_COFFEESCRIPT_OPERATOR);
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -264,14 +331,15 @@ static void ColouriseCoffeeScriptDoc(unsigned int startPos, int length, int init
|
|||||||
chPrevNonWhite = sc.ch;
|
chPrevNonWhite = sc.ch;
|
||||||
visibleChars++;
|
visibleChars++;
|
||||||
}
|
}
|
||||||
|
sc.Forward();
|
||||||
}
|
}
|
||||||
sc.Complete();
|
sc.Complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool IsCommentLine(int line, Accessor &styler) {
|
static bool IsCommentLine(Sci_Position line, Accessor &styler) {
|
||||||
int pos = styler.LineStart(line);
|
Sci_Position pos = styler.LineStart(line);
|
||||||
int eol_pos = styler.LineStart(line + 1) - 1;
|
Sci_Position eol_pos = styler.LineStart(line + 1) - 1;
|
||||||
for (int i = pos; i < eol_pos; i++) {
|
for (Sci_Position i = pos; i < eol_pos; i++) {
|
||||||
char ch = styler[i];
|
char ch = styler[i];
|
||||||
if (ch == '#')
|
if (ch == '#')
|
||||||
return true;
|
return true;
|
||||||
@ -281,12 +349,12 @@ static bool IsCommentLine(int line, Accessor &styler) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FoldCoffeeScriptDoc(unsigned int startPos, int length, int,
|
static void FoldCoffeeScriptDoc(Sci_PositionU startPos, Sci_Position length, int,
|
||||||
WordList *[], Accessor &styler) {
|
WordList *[], Accessor &styler) {
|
||||||
// A simplified version of FoldPyDoc
|
// A simplified version of FoldPyDoc
|
||||||
const int maxPos = startPos + length;
|
const Sci_Position maxPos = startPos + length;
|
||||||
const int maxLines = styler.GetLine(maxPos - 1); // Requested last line
|
const Sci_Position maxLines = styler.GetLine(maxPos - 1); // Requested last line
|
||||||
const int docLines = styler.GetLine(styler.Length() - 1); // Available last line
|
const Sci_Position docLines = styler.GetLine(styler.Length() - 1); // Available last line
|
||||||
|
|
||||||
// property fold.coffeescript.comment
|
// property fold.coffeescript.comment
|
||||||
const bool foldComment = styler.GetPropertyInt("fold.coffeescript.comment") != 0;
|
const bool foldComment = styler.GetPropertyInt("fold.coffeescript.comment") != 0;
|
||||||
@ -298,7 +366,7 @@ static void FoldCoffeeScriptDoc(unsigned int startPos, int length, int,
|
|||||||
// and so we can fix any preceding fold level (which is why we go back
|
// and so we can fix any preceding fold level (which is why we go back
|
||||||
// at least one line in all cases)
|
// at least one line in all cases)
|
||||||
int spaceFlags = 0;
|
int spaceFlags = 0;
|
||||||
int lineCurrent = styler.GetLine(startPos);
|
Sci_Position lineCurrent = styler.GetLine(startPos);
|
||||||
int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL);
|
int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL);
|
||||||
while (lineCurrent > 0) {
|
while (lineCurrent > 0) {
|
||||||
lineCurrent--;
|
lineCurrent--;
|
||||||
@ -321,7 +389,7 @@ static void FoldCoffeeScriptDoc(unsigned int startPos, int length, int,
|
|||||||
|
|
||||||
// Gather info
|
// Gather info
|
||||||
int lev = indentCurrent;
|
int lev = indentCurrent;
|
||||||
int lineNext = lineCurrent + 1;
|
Sci_Position lineNext = lineCurrent + 1;
|
||||||
int indentNext = indentCurrent;
|
int indentNext = indentCurrent;
|
||||||
if (lineNext <= docLines) {
|
if (lineNext <= docLines) {
|
||||||
// Information about next line is only available if not at end of document
|
// Information about next line is only available if not at end of document
|
||||||
@ -358,14 +426,14 @@ static void FoldCoffeeScriptDoc(unsigned int startPos, int length, int,
|
|||||||
}
|
}
|
||||||
|
|
||||||
const int levelAfterComments = indentNext & SC_FOLDLEVELNUMBERMASK;
|
const int levelAfterComments = indentNext & SC_FOLDLEVELNUMBERMASK;
|
||||||
const int levelBeforeComments = Platform::Maximum(indentCurrentLevel,levelAfterComments);
|
const int levelBeforeComments = std::max(indentCurrentLevel,levelAfterComments);
|
||||||
|
|
||||||
// Now set all the indent levels on the lines we skipped
|
// Now set all the indent levels on the lines we skipped
|
||||||
// Do this from end to start. Once we encounter one line
|
// Do this from end to start. Once we encounter one line
|
||||||
// which is indented more than the line after the end of
|
// which is indented more than the line after the end of
|
||||||
// the comment-block, use the level of the block before
|
// the comment-block, use the level of the block before
|
||||||
|
|
||||||
int skipLine = lineNext;
|
Sci_Position skipLine = lineNext;
|
||||||
int skipLevel = levelAfterComments;
|
int skipLevel = levelAfterComments;
|
||||||
|
|
||||||
while (--skipLine > lineCurrent) {
|
while (--skipLine > lineCurrent) {
|
||||||
|
@ -27,18 +27,16 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler)
|
static void ColouriseConfDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *keywordLists[], Accessor &styler)
|
||||||
{
|
{
|
||||||
int state = SCE_CONF_DEFAULT;
|
int state = SCE_CONF_DEFAULT;
|
||||||
char chNext = styler[startPos];
|
char chNext = styler[startPos];
|
||||||
int lengthDoc = startPos + length;
|
Sci_Position lengthDoc = startPos + length;
|
||||||
// create a buffer large enough to take the largest chunk...
|
// create a buffer large enough to take the largest chunk...
|
||||||
char *buffer = new char[length+1];
|
char *buffer = new char[length+1];
|
||||||
int bufferCount = 0;
|
Sci_Position bufferCount = 0;
|
||||||
|
|
||||||
// this assumes that we have 2 keyword list in conf.properties
|
// this assumes that we have 2 keyword list in conf.properties
|
||||||
WordList &directives = *keywordLists[0];
|
WordList &directives = *keywordLists[0];
|
||||||
@ -48,7 +46,7 @@ static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *k
|
|||||||
// using the hand-written state machine shown below
|
// using the hand-written state machine shown below
|
||||||
styler.StartAt(startPos);
|
styler.StartAt(startPos);
|
||||||
styler.StartSegment(startPos);
|
styler.StartSegment(startPos);
|
||||||
for (int i = startPos; i < lengthDoc; i++) {
|
for (Sci_Position i = startPos; i < lengthDoc; i++) {
|
||||||
char ch = chNext;
|
char ch = chNext;
|
||||||
chNext = styler.SafeGetCharAt(i + 1);
|
chNext = styler.SafeGetCharAt(i + 1);
|
||||||
|
|
||||||
|
@ -25,19 +25,17 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordList
|
static void ColouriseNncrontabDoc(Sci_PositionU startPos, Sci_Position length, int, WordList
|
||||||
*keywordLists[], Accessor &styler)
|
*keywordLists[], Accessor &styler)
|
||||||
{
|
{
|
||||||
int state = SCE_NNCRONTAB_DEFAULT;
|
int state = SCE_NNCRONTAB_DEFAULT;
|
||||||
char chNext = styler[startPos];
|
char chNext = styler[startPos];
|
||||||
int lengthDoc = startPos + length;
|
Sci_Position lengthDoc = startPos + length;
|
||||||
// create a buffer large enough to take the largest chunk...
|
// create a buffer large enough to take the largest chunk...
|
||||||
char *buffer = new char[length+1];
|
char *buffer = new char[length+1];
|
||||||
int bufferCount = 0;
|
Sci_Position bufferCount = 0;
|
||||||
// used when highliting environment variables inside quoted string:
|
// used when highliting environment variables inside quoted string:
|
||||||
bool insideString = false;
|
bool insideString = false;
|
||||||
|
|
||||||
@ -50,7 +48,7 @@ static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordLi
|
|||||||
// using the hand-written state machine shown below
|
// using the hand-written state machine shown below
|
||||||
styler.StartAt(startPos);
|
styler.StartAt(startPos);
|
||||||
styler.StartSegment(startPos);
|
styler.StartSegment(startPos);
|
||||||
for (int i = startPos; i < lengthDoc; i++) {
|
for (Sci_Position i = startPos; i < lengthDoc; i++) {
|
||||||
char ch = chNext;
|
char ch = chNext;
|
||||||
chNext = styler.SafeGetCharAt(i + 1);
|
chNext = styler.SafeGetCharAt(i + 1);
|
||||||
|
|
||||||
|
@ -24,9 +24,7 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline bool IsAWordChar(const int ch) {
|
static inline bool IsAWordChar(const int ch) {
|
||||||
return (ch < 0x80) && (isalnum(ch) || ch == '.' ||
|
return (ch < 0x80) && (isalnum(ch) || ch == '.' ||
|
||||||
@ -51,7 +49,7 @@ static inline bool IsCsoundOperator(char ch) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ColouriseCsoundDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
|
static void ColouriseCsoundDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[],
|
||||||
Accessor &styler) {
|
Accessor &styler) {
|
||||||
|
|
||||||
WordList &opcode = *keywordlists[0];
|
WordList &opcode = *keywordlists[0];
|
||||||
@ -150,17 +148,17 @@ static void ColouriseCsoundDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
sc.Complete();
|
sc.Complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FoldCsoundInstruments(unsigned int startPos, int length, int /* initStyle */, WordList *[],
|
static void FoldCsoundInstruments(Sci_PositionU startPos, Sci_Position length, int /* initStyle */, WordList *[],
|
||||||
Accessor &styler) {
|
Accessor &styler) {
|
||||||
unsigned int lengthDoc = startPos + length;
|
Sci_PositionU lengthDoc = startPos + length;
|
||||||
int visibleChars = 0;
|
int visibleChars = 0;
|
||||||
int lineCurrent = styler.GetLine(startPos);
|
Sci_Position lineCurrent = styler.GetLine(startPos);
|
||||||
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
|
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
|
||||||
int levelCurrent = levelPrev;
|
int levelCurrent = levelPrev;
|
||||||
char chNext = styler[startPos];
|
char chNext = styler[startPos];
|
||||||
int stylePrev = 0;
|
int stylePrev = 0;
|
||||||
int styleNext = styler.StyleAt(startPos);
|
int styleNext = styler.StyleAt(startPos);
|
||||||
for (unsigned int i = startPos; i < lengthDoc; i++) {
|
for (Sci_PositionU i = startPos; i < lengthDoc; i++) {
|
||||||
char ch = chNext;
|
char ch = chNext;
|
||||||
chNext = styler.SafeGetCharAt(i + 1);
|
chNext = styler.SafeGetCharAt(i + 1);
|
||||||
int style = styleNext;
|
int style = styleNext;
|
||||||
|
@ -27,10 +27,9 @@
|
|||||||
#include "CharacterSet.h"
|
#include "CharacterSet.h"
|
||||||
#include "LexerModule.h"
|
#include "LexerModule.h"
|
||||||
#include "OptionSet.h"
|
#include "OptionSet.h"
|
||||||
|
#include "DefaultLexer.h"
|
||||||
|
|
||||||
#ifdef SCI_NAMESPACE
|
|
||||||
using namespace Scintilla;
|
using namespace Scintilla;
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Nested comments require keeping the value of the nesting level for every
|
/* Nested comments require keeping the value of the nesting level for every
|
||||||
position in the document. But since scintilla always styles line by line,
|
position in the document. But since scintilla always styles line by line,
|
||||||
@ -145,7 +144,7 @@ struct OptionSetD : public OptionSet<OptionsD> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class LexerD : public ILexer {
|
class LexerD : public DefaultLexer {
|
||||||
bool caseSensitive;
|
bool caseSensitive;
|
||||||
WordList keywords;
|
WordList keywords;
|
||||||
WordList keywords2;
|
WordList keywords2;
|
||||||
@ -162,49 +161,49 @@ public:
|
|||||||
}
|
}
|
||||||
virtual ~LexerD() {
|
virtual ~LexerD() {
|
||||||
}
|
}
|
||||||
void SCI_METHOD Release() {
|
void SCI_METHOD Release() override {
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
int SCI_METHOD Version() const {
|
int SCI_METHOD Version() const override {
|
||||||
return lvOriginal;
|
return lvRelease4;
|
||||||
}
|
}
|
||||||
const char * SCI_METHOD PropertyNames() {
|
const char * SCI_METHOD PropertyNames() override {
|
||||||
return osD.PropertyNames();
|
return osD.PropertyNames();
|
||||||
}
|
}
|
||||||
int SCI_METHOD PropertyType(const char *name) {
|
int SCI_METHOD PropertyType(const char *name) override {
|
||||||
return osD.PropertyType(name);
|
return osD.PropertyType(name);
|
||||||
}
|
}
|
||||||
const char * SCI_METHOD DescribeProperty(const char *name) {
|
const char * SCI_METHOD DescribeProperty(const char *name) override {
|
||||||
return osD.DescribeProperty(name);
|
return osD.DescribeProperty(name);
|
||||||
}
|
}
|
||||||
int SCI_METHOD PropertySet(const char *key, const char *val);
|
Sci_Position SCI_METHOD PropertySet(const char *key, const char *val) override;
|
||||||
const char * SCI_METHOD DescribeWordListSets() {
|
const char * SCI_METHOD DescribeWordListSets() override {
|
||||||
return osD.DescribeWordListSets();
|
return osD.DescribeWordListSets();
|
||||||
}
|
}
|
||||||
int SCI_METHOD WordListSet(int n, const char *wl);
|
Sci_Position SCI_METHOD WordListSet(int n, const char *wl) override;
|
||||||
void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
|
void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) override;
|
||||||
void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
|
void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) override;
|
||||||
|
|
||||||
void * SCI_METHOD PrivateCall(int, void *) {
|
void * SCI_METHOD PrivateCall(int, void *) override {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ILexer *LexerFactoryD() {
|
static ILexer4 *LexerFactoryD() {
|
||||||
return new LexerD(true);
|
return new LexerD(true);
|
||||||
}
|
}
|
||||||
static ILexer *LexerFactoryDInsensitive() {
|
static ILexer4 *LexerFactoryDInsensitive() {
|
||||||
return new LexerD(false);
|
return new LexerD(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
int SCI_METHOD LexerD::PropertySet(const char *key, const char *val) {
|
Sci_Position SCI_METHOD LexerD::PropertySet(const char *key, const char *val) {
|
||||||
if (osD.PropertySet(&options, key, val)) {
|
if (osD.PropertySet(&options, key, val)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SCI_METHOD LexerD::WordListSet(int n, const char *wl) {
|
Sci_Position SCI_METHOD LexerD::WordListSet(int n, const char *wl) {
|
||||||
WordList *wordListN = 0;
|
WordList *wordListN = 0;
|
||||||
switch (n) {
|
switch (n) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -229,7 +228,7 @@ int SCI_METHOD LexerD::WordListSet(int n, const char *wl) {
|
|||||||
wordListN = &keywords7;
|
wordListN = &keywords7;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int firstModification = -1;
|
Sci_Position firstModification = -1;
|
||||||
if (wordListN) {
|
if (wordListN) {
|
||||||
WordList wlNew;
|
WordList wlNew;
|
||||||
wlNew.Set(wl);
|
wlNew.Set(wl);
|
||||||
@ -241,14 +240,14 @@ int SCI_METHOD LexerD::WordListSet(int n, const char *wl) {
|
|||||||
return firstModification;
|
return firstModification;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SCI_METHOD LexerD::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
|
void SCI_METHOD LexerD::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) {
|
||||||
LexAccessor styler(pAccess);
|
LexAccessor styler(pAccess);
|
||||||
|
|
||||||
int styleBeforeDCKeyword = SCE_D_DEFAULT;
|
int styleBeforeDCKeyword = SCE_D_DEFAULT;
|
||||||
|
|
||||||
StyleContext sc(startPos, length, initStyle, styler);
|
StyleContext sc(startPos, length, initStyle, styler);
|
||||||
|
|
||||||
int curLine = styler.GetLine(startPos);
|
Sci_Position curLine = styler.GetLine(startPos);
|
||||||
int curNcLevel = curLine > 0? styler.GetLineState(curLine-1): 0;
|
int curNcLevel = curLine > 0? styler.GetLineState(curLine-1): 0;
|
||||||
bool numFloat = false; // Float literals have '+' and '-' signs
|
bool numFloat = false; // Float literals have '+' and '-' signs
|
||||||
bool numHex = false;
|
bool numHex = false;
|
||||||
@ -471,16 +470,16 @@ void SCI_METHOD LexerD::Lex(unsigned int startPos, int length, int initStyle, ID
|
|||||||
// level store to make it easy to pick up with each increment
|
// level store to make it easy to pick up with each increment
|
||||||
// and to make it possible to fiddle the current level for "} else {".
|
// and to make it possible to fiddle the current level for "} else {".
|
||||||
|
|
||||||
void SCI_METHOD LexerD::Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
|
void SCI_METHOD LexerD::Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) {
|
||||||
|
|
||||||
if (!options.fold)
|
if (!options.fold)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
LexAccessor styler(pAccess);
|
LexAccessor styler(pAccess);
|
||||||
|
|
||||||
unsigned int endPos = startPos + length;
|
Sci_PositionU endPos = startPos + length;
|
||||||
int visibleChars = 0;
|
int visibleChars = 0;
|
||||||
int lineCurrent = styler.GetLine(startPos);
|
Sci_Position lineCurrent = styler.GetLine(startPos);
|
||||||
int levelCurrent = SC_FOLDLEVELBASE;
|
int levelCurrent = SC_FOLDLEVELBASE;
|
||||||
if (lineCurrent > 0)
|
if (lineCurrent > 0)
|
||||||
levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
|
levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
|
||||||
@ -491,7 +490,7 @@ void SCI_METHOD LexerD::Fold(unsigned int startPos, int length, int initStyle, I
|
|||||||
int style = initStyle;
|
int style = initStyle;
|
||||||
bool foldAtElse = options.foldAtElseInt >= 0 ? options.foldAtElseInt != 0 : options.foldAtElse;
|
bool foldAtElse = options.foldAtElseInt >= 0 ? options.foldAtElseInt != 0 : options.foldAtElse;
|
||||||
const bool userDefinedFoldMarkers = !options.foldExplicitStart.empty() && !options.foldExplicitEnd.empty();
|
const bool userDefinedFoldMarkers = !options.foldExplicitStart.empty() && !options.foldExplicitEnd.empty();
|
||||||
for (unsigned int i = startPos; i < endPos; i++) {
|
for (Sci_PositionU i = startPos; i < endPos; i++) {
|
||||||
char ch = chNext;
|
char ch = chNext;
|
||||||
chNext = styler.SafeGetCharAt(i + 1);
|
chNext = styler.SafeGetCharAt(i + 1);
|
||||||
int stylePrev = style;
|
int stylePrev = style;
|
||||||
|