mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-14 02:27:40 -04:00
Initial Commit of CyanWorlds.com Engine Open Source Client/Plugin
This commit is contained in:
@ -0,0 +1,249 @@
|
||||
<?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" />
|
||||
<title>
|
||||
Scintilla and SciTE
|
||||
</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
|
||||
Component Design</font></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>
|
||||
Top level structure
|
||||
</h2>
|
||||
<p>
|
||||
Scintilla consists of three major layers of C++ code
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
Portability Library
|
||||
</li>
|
||||
<li>
|
||||
Core Code
|
||||
</li>
|
||||
<li>
|
||||
Platform Events and API
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
The primary purpose of this structure is to separate the platform dependent code from the
|
||||
platform independent core code. This makes it easier to port Scintilla to a new platform and
|
||||
ensures that most readers of the code do not have to deal with platform details. To minimise
|
||||
portability problems and avoid code bloat, a conservative subset of C++ is used in Scintilla
|
||||
with no exception handling, run time type information or use of the standard C++
|
||||
library and with limited use of templates.
|
||||
</p>
|
||||
<p>
|
||||
The currently supported platforms, Windows, GTK+/Linux and wxWindows are fairly similar in
|
||||
many ways.
|
||||
Each has windows, menus and bitmaps. These features generally work in similar ways so each
|
||||
has a way to move a window or draw a red line. Sometimes one platform requires a sequence of
|
||||
calls rather than a single call. At other times, the differences are more profound. Reading
|
||||
the Windows clipboard occurs synchronously but reading the GTK+ clipboard requires a request
|
||||
call that will be asynchronously answered with a message containing the clipboard data.
|
||||
The wxWindows platform is available from the <a href="http://wxwindows.org/">wxWindows site</a>
|
||||
</p>
|
||||
<br />
|
||||
<h3>
|
||||
Portability Library
|
||||
</h3>
|
||||
<p>
|
||||
This is a fairly small and thin layer over the platform's native capabilities.
|
||||
</p>
|
||||
<p>
|
||||
The portability library is defined in Platform.h and is implemented once for each platform.
|
||||
PlatWin.cxx defines the Windows variants of the methods and PlatGTK.cxx the GTK+ variants.
|
||||
</p>
|
||||
<p>
|
||||
Several of the classes here hold platform specific object identifiers and act as proxies to
|
||||
these platform objects. Most client code can thus manipulate the platform objects without
|
||||
caring which is the current platform. Sometimes client code needs access to the underlying
|
||||
object identifiers and this is provided by the GetID method. The underlying types of the
|
||||
platform specific identifiers are typedefed to common names to allow them to be transferred
|
||||
around in client code where needed.
|
||||
</p>
|
||||
<h4>
|
||||
Point, PRectangle
|
||||
</h4>
|
||||
<p>
|
||||
These are simple classes provided to hold the commonly used geometric primitives. A
|
||||
PRectangle follows the Mac / Windows convention of not including its bottom and right sides
|
||||
instead of including all its sides as is normal in GTK+. It is not called Rectangle as this may be
|
||||
the name of a macro on Windows.
|
||||
</p>
|
||||
<h4>
|
||||
Colour, ColourPair, Palette
|
||||
</h4>
|
||||
<p>
|
||||
Colour holds a platform specific colour identifier - COLORREF for Windows and GdkColor for
|
||||
GTK+. The red, green and blue components that make up the colour are limited to the 8 bits of
|
||||
precision available on Windows. ColourPairs are used because not all possible colours are
|
||||
always available. Using an 8 bit colour mode, which is a common setting for both Windows and
|
||||
GTK+, only 256 colours are possible on the display. Thus when an application asks for a dull
|
||||
red, say #400000, it may only be allocated an already available colour such as #800000 or
|
||||
#330000. With 16 or 2 colour modes even less choice is available and the application will
|
||||
have to use the limited set of already available colours.
|
||||
</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>
|
||||
Font
|
||||
</h4>
|
||||
<p>
|
||||
Font holds a platform specific font identifier - HFONT for Windows, GdkFont* for GTK+. It
|
||||
does not own the identifier and so will not delete the platform font object in its
|
||||
destructor. Client code should call Destroy at appropriate times.
|
||||
</p>
|
||||
<h4>
|
||||
Surface
|
||||
</h4>
|
||||
<p>
|
||||
Surface is an abstraction over each platform's concept of somewhere that graphical drawing
|
||||
operations can be done. It may wrap an already created drawing place such as a window or be
|
||||
used to create a bitmap that can be drawn into and later copied onto another surface. On
|
||||
Windows it wraps a HDC and possibly a HBITMAP. On GTK+ it wraps a GdkDrawable* and possibly a
|
||||
GdkPixmap*. Other platform specific objects are created (and correctly destroyed) whenever
|
||||
required to perform drawing actions.
|
||||
</p>
|
||||
<p>
|
||||
Drawing operations provided include drawing filled and unfilled polygons, lines, rectangles,
|
||||
ellipses and text. The height and width of text as well as other details can be measured.
|
||||
Operations can be clipped to a rectangle. Most of the calls are stateless with all parameters
|
||||
being passed at each call. The exception to this is line drawing which is performed by
|
||||
calling MoveTo and then LineTo.
|
||||
</p>
|
||||
<h4>
|
||||
Window
|
||||
</h4>
|
||||
<p>
|
||||
Window acts as a proxy to a platform window allowing operations such as showing, moving,
|
||||
redrawing, and destroying to be performed. It contains a platform specific window identifier
|
||||
- HWND for Windows, GtkWidget* for GTK+.
|
||||
</p>
|
||||
<h4>
|
||||
ListBox
|
||||
</h4>
|
||||
<p>
|
||||
ListBox is a subclass of Window and acts as a proxy to a platform listbox adding methods for
|
||||
operations such as adding, retrieving, and selecting items.
|
||||
</p>
|
||||
<h4>
|
||||
Menu
|
||||
</h4>
|
||||
<p>
|
||||
Menu is a small helper class for constructing popup menus. It contains the platform specific
|
||||
menu identifier - HMENU for Windows, GtkItemFactory* for GTK+. Most of the work in
|
||||
constructing menus requires access to platform events and so is done in the Platform Events
|
||||
and API layer.
|
||||
</p>
|
||||
<h4>
|
||||
Platform
|
||||
</h4>
|
||||
<p>
|
||||
The Platform class is used to access the facilities of the platform. System wide parameters
|
||||
such as double click speed and chrome colour are available from Platform. Utility functions
|
||||
such as DebugPrintf are also available from Platform.
|
||||
</p>
|
||||
<h3>
|
||||
Core Code
|
||||
</h3>
|
||||
<p>
|
||||
The bulk of Scintilla's code is platform independent. This is made up of the CellBuffer,
|
||||
ContractionState, Document, Editor, Indicator, LineMarker, Style, ViewStyle, KeyMap,
|
||||
ScintillaBase, CallTip,
|
||||
and AutoComplete primary classes.
|
||||
</p>
|
||||
<h4>
|
||||
CellBuffer
|
||||
</h4>
|
||||
<p>
|
||||
A CellBuffer holds text and styling information, the undo stack, the assignment of line
|
||||
markers to lines, and the fold structure.
|
||||
</p>
|
||||
<p>
|
||||
A cell contains a character byte and its associated style byte. The current state of the
|
||||
cell buffer is the sequence of cells that make up the text and a sequence of line information
|
||||
containing the starting position of each line and any markers assigned to each line.
|
||||
</p>
|
||||
<p>
|
||||
The undo stack holds a sequence of actions on the cell buffer. Each action is one of a text
|
||||
insertion, a text deletion or an undo start action. The start actions are used to group
|
||||
sequences of text insertions and deletions together so they can be undone together. To
|
||||
perform an undo operation, each insertion or deletion is undone in reverse sequence.
|
||||
Similarly, redo reapplies each action to the buffer in sequence. Whenever a character is
|
||||
inserted in the buffer either directly through a call such as InsertString or through undo or
|
||||
redo, its styling byte is initially set to zero. Client code is responsible for styling each
|
||||
character whenever convenient. Styling information is not stored in undo actions.
|
||||
</p>
|
||||
<h4>
|
||||
Document
|
||||
</h4>
|
||||
<p>
|
||||
A document contains a CellBuffer and deals with some higher level abstractions such as
|
||||
words, DBCS character sequences and line end character sequences. It is responsible for
|
||||
managing the styling process and for notifying other objects when changes occur to the
|
||||
document.
|
||||
</p>
|
||||
<h4>
|
||||
Editor
|
||||
</h4>
|
||||
<p>
|
||||
The Editor object is central to Scintilla. It is responsible for displaying a document and
|
||||
responding to user actions and requests from the container. It uses ContractionState, Indicator,
|
||||
LineMarker, Style, and ViewStyle objects to display the document and a KeyMap class to
|
||||
map key presses to functions.
|
||||
The visibility of each line is kept in the ContractionState which is also responsible for mapping
|
||||
from display lines to documents lines and vice versa.
|
||||
</p>
|
||||
<p>
|
||||
There may be multiple Editor objects attached to one Document object. Changes to a
|
||||
document are broadcast to the editors through the DocWatcher mechanism.
|
||||
</p>
|
||||
<h4>
|
||||
ScintillaBase
|
||||
</h4>
|
||||
<p>
|
||||
ScintillaBase is a subclass of Editor and adds extra windowing features including display of
|
||||
calltips, autocompletion lists and context menus. These features use CallTip and AutoComplete
|
||||
objects. This class is optional so a lightweight implementation of Scintilla may bypass it if
|
||||
the added functionality is not required.
|
||||
</p>
|
||||
<h3>
|
||||
Platform Events and API
|
||||
</h3>
|
||||
<p>
|
||||
Each platform uses different mechanisms for receiving events. On Windows, events are
|
||||
received through messages and COM. On GTK+, callback functions are used.
|
||||
</p>
|
||||
<p>
|
||||
For each platform, a class is derived from ScintillaBase (and thus from Editor). This is
|
||||
ScintillaWin on Windows and ScintillaGTK on GTK+. These classes are responsible for
|
||||
connecting to the platforms event mechanism and also to implement some virtual methods in
|
||||
Editor and ScintillaBase which are different on the platforms. For example, this layer has to
|
||||
support this difference between the synchronous Windows clipboard and the asynchronous GTK+
|
||||
clipboard.
|
||||
</p>
|
||||
<p>
|
||||
The external API is defined in this layer as each platform has different preferred styles of
|
||||
API - messages on Windows and function calls on GTK+. This also allows multiple APIs to be
|
||||
defined on a platform. The currently available API on GTK+ is similar to the Windows API and
|
||||
does not follow platform conventions well. A second API could be implemented here that did
|
||||
follow platform conventions.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -0,0 +1,56 @@
|
||||
<?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" />
|
||||
<title>
|
||||
Scintilla icons
|
||||
</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>
|
||||
Icons
|
||||
</h2>
|
||||
<p>
|
||||
These images may be used under the same license as Scintilla.
|
||||
</p>
|
||||
<p>
|
||||
Drawn by Iago Rubio, Philippe Lhoste, and Neil Hodgson.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://prdownloads.sourceforge.net/scintilla/icons1.zip?download">zip format</a> (70K)
|
||||
</p>
|
||||
<table>
|
||||
<tr>
|
||||
<td>For autocompletion lists</td>
|
||||
<td colspan="3">For margin markers</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>12x12</td>
|
||||
<td>16x16</td>
|
||||
<td>24x24</td>
|
||||
<td>32x32</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><img src="12.png" /></td>
|
||||
<td valign="top"><img src="16.png" /></td>
|
||||
<td valign="top"><img src="24.png" /></td>
|
||||
<td valign="top"><img src="32.png" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,226 @@
|
||||
How to write a scintilla lexer
|
||||
|
||||
A lexer for a particular language determines how a specified range of
|
||||
text shall be colored. Writing a lexer is relatively straightforward
|
||||
because the lexer need only color given text. The harder job of
|
||||
determining how much text actually needs to be colored is handled by
|
||||
Scintilla itself, that is, the lexer's caller.
|
||||
|
||||
|
||||
Parameters
|
||||
|
||||
The lexer for language LLL has the following prototype:
|
||||
|
||||
static void ColouriseLLLDoc (
|
||||
unsigned int startPos, int length,
|
||||
int initStyle,
|
||||
WordList *keywordlists[],
|
||||
Accessor &styler);
|
||||
|
||||
The styler parameter is an Accessor object. The lexer must use this
|
||||
object to access the text to be colored. The lexer gets the character
|
||||
at position i using styler.SafeGetCharAt(i);
|
||||
|
||||
The startPos and length parameters indicate the range of text to be
|
||||
recolored; the lexer must determine the proper color for all characters
|
||||
in positions startPos through startPos+length.
|
||||
|
||||
The initStyle parameter indicates the initial state, that is, the state
|
||||
at the character before startPos. States also indicate the coloring to
|
||||
be used for a particular range of text.
|
||||
|
||||
Note: the character at StartPos is assumed to start a line, so if a
|
||||
newline terminates the initStyle state the lexer should enter its
|
||||
default state (or whatever state should follow initStyle).
|
||||
|
||||
The keywordlists parameter specifies the keywords that the lexer must
|
||||
recognize. A WordList class object contains methods that make simplify
|
||||
the recognition of keywords. Present lexers use a helper function
|
||||
called classifyWordLLL to recognize keywords. These functions show how
|
||||
to use the keywordlists parameter to recognize keywords. This
|
||||
documentation will not discuss keywords further.
|
||||
|
||||
|
||||
The lexer code
|
||||
|
||||
The task of a lexer can be summarized briefly: for each range r of
|
||||
characters that are to be colored the same, the lexer should call
|
||||
|
||||
styler.ColourTo(i, state)
|
||||
|
||||
where i is the position of the last character of the range r. The lexer
|
||||
should set the state variable to the coloring state of the character at
|
||||
position i and continue until the entire text has been colored.
|
||||
|
||||
Note 1: the styler (Accessor) object remembers the i parameter in the
|
||||
previous calls to styler.ColourTo, so the single i parameter suffices to
|
||||
indicate a range of characters.
|
||||
|
||||
Note 2: As a side effect of calling styler.ColourTo(i,state), the
|
||||
coloring states of all characters in the range are remembered so that
|
||||
Scintilla may set the initStyle parameter correctly on future calls to
|
||||
the
|
||||
lexer.
|
||||
|
||||
|
||||
Lexer organization
|
||||
|
||||
There are at least two ways to organize the code of each lexer. Present
|
||||
lexers use what might be called a "character-based" approach: the outer
|
||||
loop iterates over characters, like this:
|
||||
|
||||
lengthDoc = startPos + length ;
|
||||
for (unsigned int i = startPos; i < lengthDoc; i++) {
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
<< handle special cases >>
|
||||
switch(state) {
|
||||
// Handlers examine only ch and chNext.
|
||||
// Handlers call styler.ColorTo(i,state) if the state changes.
|
||||
case state_1: << handle ch in state 1 >>
|
||||
case state_2: << handle ch in state 2 >>
|
||||
...
|
||||
case state_n: << handle ch in state n >>
|
||||
}
|
||||
chPrev = ch;
|
||||
}
|
||||
styler.ColourTo(lengthDoc - 1, state);
|
||||
|
||||
|
||||
An alternative would be to use a "state-based" approach. The outer loop
|
||||
would iterate over states, like this:
|
||||
|
||||
lengthDoc = startPos+lenth ;
|
||||
for ( unsigned int i = startPos ;; ) {
|
||||
char ch = styler.SafeGetCharAt(i);
|
||||
int new_state = 0 ;
|
||||
switch ( state ) {
|
||||
// scanners set new_state if they set the next state.
|
||||
case state_1: << scan to the end of state 1 >> break ;
|
||||
case state_2: << scan to the end of state 2 >> break ;
|
||||
case default_state:
|
||||
<< scan to the next non-default state and set new_state >>
|
||||
}
|
||||
styler.ColourTo(i, state);
|
||||
if ( i >= lengthDoc ) break ;
|
||||
if ( ! new_state ) {
|
||||
ch = styler.SafeGetCharAt(i);
|
||||
<< set state based on ch in the default state >>
|
||||
}
|
||||
}
|
||||
styler.ColourTo(lengthDoc - 1, state);
|
||||
|
||||
This approach might seem to be more natural. State scanners are simpler
|
||||
than character scanners because less needs to be done. For example,
|
||||
there is no need to test for the start of a C string inside the scanner
|
||||
for a C comment. Also this way makes it natural to define routines that
|
||||
could be used by more than one scanner; for example, a scanToEndOfLine
|
||||
routine.
|
||||
|
||||
However, the special cases handled in the main loop in the
|
||||
character-based approach would have to be handled by each state scanner,
|
||||
so both approaches have advantages. These special cases are discussed
|
||||
below.
|
||||
|
||||
Special case: Lead characters
|
||||
|
||||
Lead bytes are part of DBCS processing for languages such as Japanese
|
||||
using an encoding such as Shift-JIS. In these encodings, extended
|
||||
(16-bit) characters are encoded as a lead byte followed by a trail byte.
|
||||
|
||||
Lead bytes are rarely of any lexical significance, normally only being
|
||||
allowed within strings and comments. In such contexts, lexers should
|
||||
ignore ch if styler.IsLeadByte(ch) returns TRUE.
|
||||
|
||||
Note: UTF-8 is simpler than Shift-JIS, so no special handling is
|
||||
applied for it. All UTF-8 extended characters are >= 128 and none are
|
||||
lexically significant in programming languages which, so far, use only
|
||||
characters in ASCII for operators, comment markers, etc.
|
||||
|
||||
|
||||
Special case: Folding
|
||||
|
||||
Folding may be performed in the lexer function. It is better to use a
|
||||
separate folder function as that avoids some troublesome interaction
|
||||
between styling and folding. The folder function will be run after the
|
||||
lexer function if folding is enabled. The rest of this section explains
|
||||
how to perform folding within the lexer function.
|
||||
|
||||
During initialization, lexers that support folding set
|
||||
|
||||
bool fold = styler.GetPropertyInt("fold");
|
||||
|
||||
If folding is enabled in the editor, fold will be TRUE and the lexer
|
||||
should call:
|
||||
|
||||
styler.SetLevel(line, level);
|
||||
|
||||
at the end of each line and just before exiting.
|
||||
|
||||
The line parameter is simply the count of the number of newlines seen.
|
||||
It's initial value is styler.GetLine(startPos) and it is incremented
|
||||
(after calling styler.SetLevel) whenever a newline is seen.
|
||||
|
||||
The level parameter is the desired indentation level in the low 12 bits,
|
||||
along with flag bits in the upper four bits. The indentation level
|
||||
depends on the language. For C++, it is incremented when the lexer sees
|
||||
a '{' and decremented when the lexer sees a '}' (outside of strings and
|
||||
comments, of course).
|
||||
|
||||
The following flag bits, defined in Scintilla.h, may be set or cleared
|
||||
in the flags parameter. The SC_FOLDLEVELWHITEFLAG flag is set if the
|
||||
lexer considers that the line contains nothing but whitespace. The
|
||||
SC_FOLDLEVELHEADERFLAG flag indicates that the line is a fold point.
|
||||
This normally means that the next line has a greater level than present
|
||||
line. However, the lexer may have some other basis for determining a
|
||||
fold point. For example, a lexer might create a header line for the
|
||||
first line of a function definition rather than the last.
|
||||
|
||||
The SC_FOLDLEVELNUMBERMASK mask denotes the level number in the low 12
|
||||
bits of the level param. This mask may be used to isolate either flags
|
||||
or level numbers.
|
||||
|
||||
For example, the C++ lexer contains the following code when a newline is
|
||||
seen:
|
||||
|
||||
if (fold) {
|
||||
int lev = levelPrev;
|
||||
|
||||
// Set the "all whitespace" bit if the line is blank.
|
||||
if (visChars == 0)
|
||||
lev |= SC_FOLDLEVELWHITEFLAG;
|
||||
|
||||
// Set the "header" bit if needed.
|
||||
if ((levelCurrent > levelPrev) && (visChars > 0))
|
||||
lev |= SC_FOLDLEVELHEADERFLAG;
|
||||
styler.SetLevel(lineCurrent, lev);
|
||||
|
||||
// reinitialize the folding vars describing the present line.
|
||||
lineCurrent++;
|
||||
visChars = 0; // Number of non-whitespace characters on the line.
|
||||
levelPrev = levelCurrent;
|
||||
}
|
||||
|
||||
The following code appears in the C++ lexer just before exit:
|
||||
|
||||
// Fill in the real level of the next line, keeping the current flags
|
||||
// as they will be filled in later.
|
||||
if (fold) {
|
||||
// Mask off the level number, leaving only the previous flags.
|
||||
int flagsNext = styler.LevelAt(lineCurrent);
|
||||
flagsNext &= ~SC_FOLDLEVELNUMBERMASK;
|
||||
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
|
||||
}
|
||||
|
||||
|
||||
Don't worry about performance
|
||||
|
||||
The writer of a lexer may safely ignore performance considerations: the
|
||||
cost of redrawing the screen is several orders of magnitude greater than
|
||||
the cost of function calls, etc. Moreover, Scintilla performs all the
|
||||
important optimizations; Scintilla ensures that a lexer will be called
|
||||
only to recolor text that actually needs to be recolored. Finally, it
|
||||
is not necessary to avoid extra calls to styler.ColourTo: the sytler
|
||||
object buffers calls to ColourTo to avoid multiple updates of the
|
||||
screen.
|
||||
|
||||
Page contributed by Edward K. Ream
|
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
@ -0,0 +1,251 @@
|
||||
<?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" />
|
||||
<title>
|
||||
Scintilla and SciTE Code Style Preferences
|
||||
</title>
|
||||
<style>
|
||||
.S0 {
|
||||
color: #808080;
|
||||
}
|
||||
.S1 {
|
||||
font-family: Comic Sans MS;
|
||||
color: #007F00;
|
||||
font-size: 9pt;
|
||||
}
|
||||
.S2 {
|
||||
font-family: Comic Sans MS;
|
||||
color: #007F00;
|
||||
font-size: 9pt;
|
||||
}
|
||||
.S3 {
|
||||
font-family: Comic Sans MS;
|
||||
color: #3F703F;
|
||||
font-size: 9pt;
|
||||
}
|
||||
.S4 {
|
||||
color: #007F7F;
|
||||
}
|
||||
.S5 {
|
||||
font-weight: bold;
|
||||
color: #00007F;
|
||||
}
|
||||
.S6 {
|
||||
color: #7F007F;
|
||||
}
|
||||
.S7 {
|
||||
color: #7F007F;
|
||||
}
|
||||
.S8 {
|
||||
color: #804080;
|
||||
}
|
||||
.S9 {
|
||||
color: #7F7F00;
|
||||
}
|
||||
.S10 {
|
||||
font-weight: bold;
|
||||
color: #000000;
|
||||
}
|
||||
.S12 {
|
||||
font-family: Courier New;
|
||||
color: #000000;
|
||||
background: #E0C0E0;
|
||||
font-size: 10pt;
|
||||
}
|
||||
.S13 {
|
||||
font-family: Courier New;
|
||||
color: #007F00;
|
||||
background: #E0FFE0;
|
||||
font-size: 10pt;
|
||||
}
|
||||
.S14 {
|
||||
font-family: Courier New;
|
||||
color: #3F7F3F;
|
||||
background: #E0F0FF;
|
||||
font-size: 10pt;
|
||||
}
|
||||
.S15 {
|
||||
font-family: Comic Sans MS;
|
||||
color: #3F703F;
|
||||
font-size: 9pt;
|
||||
}
|
||||
SPAN {
|
||||
font-family: Verdana;
|
||||
font-size: 10pt;
|
||||
}
|
||||
</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
|
||||
and SciTE</font></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>
|
||||
Code Style
|
||||
</h2>
|
||||
<h3>
|
||||
Introduction
|
||||
</h3>
|
||||
<p>
|
||||
The source code of Scintilla and SciTE follow my preferences.
|
||||
Some of these decisions are arbitrary and based on my sense of aesthetics
|
||||
but its good to have all the code look the same even if its not exactly how
|
||||
everyone would prefer.
|
||||
</p>
|
||||
<p>
|
||||
Code that does not follow these conventions will be accepted, but will be modified
|
||||
as time goes by to fit the conventions. Scintilla code follows the conventions more
|
||||
closely than SciTE except for lexers which are relatively independent modules.
|
||||
Lexers that are maintained by others are left as they are submitted except that
|
||||
warnings will be fixed so the whole project can compile cleanly.
|
||||
</p>
|
||||
<p>
|
||||
The <a href="http://astyle.sourceforge.net/">AStyle</a> formatting
|
||||
program with a '-tapO' argument formats code in much the right way although
|
||||
there are a few bugs in AStyle. The scite/scripts/Fixer.py script will run AStyle
|
||||
over a C++ source file and fix up some of those bugs.
|
||||
</p>
|
||||
<h3>
|
||||
Language features
|
||||
</h3>
|
||||
<p>
|
||||
Design goals for Scintilla and SciTE include portability to currently available C++
|
||||
compilers on diverse platforms with high performance and low resource usage.
|
||||
Scintilla has stricter portability requirements to SciTE as it may be ported to
|
||||
low capability platforms such as Windows CE or PalmOS but it is less likely
|
||||
SciTE will be.
|
||||
</p>
|
||||
<p>
|
||||
To achieve portability, only a subset of C++ features are used. Exceptions are
|
||||
not available on some platforms such as Windows CE so exceptions are not used
|
||||
and thus the standard C++ library can not be used.
|
||||
Template support differs between compilers so is not used in Scintilla but there
|
||||
are some simple uses in SciTE.
|
||||
Run-time type information adds to memory use so is turned off.
|
||||
Name spaces are not used.
|
||||
</p>
|
||||
<p>
|
||||
The goto statement is not used because of bad memories from my first job
|
||||
maintaining FORTRAN programs. The union feature is not used as it can lead to
|
||||
non-type-safe value access.
|
||||
</p>
|
||||
<h3>
|
||||
Casting
|
||||
</h3>
|
||||
<p>
|
||||
Do not use old C style casts like (char *)s. Instead use the most strict form of C++
|
||||
cast possible like const_cast<char *>(s). Use static_cast and const_cast
|
||||
where possible rather than reinterpret_cast. Because the code is compiled with
|
||||
run-time type information turned off, dynamic_cast will not work.
|
||||
</p>
|
||||
<p>
|
||||
The benefit to using the new style casts is that they explicitly detail what evil is
|
||||
occurring and act as signals that something potentially unsafe is being done.
|
||||
</p>
|
||||
<p>
|
||||
Code that treats const seriously is easier to reason about both for humans
|
||||
and compilers, so use const parameters and avoid const_cast.
|
||||
</p>
|
||||
<h3>
|
||||
Warnings
|
||||
</h3>
|
||||
<p>
|
||||
To help ensure code is well written and portable, it is compiled with almost all
|
||||
warnings turned on. This sometimes results in warnings about code that is
|
||||
completely good (false positives) but changing the code to avoid the warnings
|
||||
is generally fast and has little impact on readability.
|
||||
</p>
|
||||
<p>
|
||||
Initialise all variables and minimise the scope of variables. If a variable is defined
|
||||
just before its use then it can't be misused by code before that point.
|
||||
Use loop declarations that are compatible with both the C++ standard and currently
|
||||
available compilers.
|
||||
</p>
|
||||
<h3>
|
||||
Allocation
|
||||
</h3>
|
||||
<p>
|
||||
As exceptions are not used, memory exhaustion can occur.
|
||||
This should be checked for and handled but there is quite a lot of Scintilla and
|
||||
SciTE code that doesn't yet.
|
||||
Fixed length buffers are often used as these are simple and avoid the need to
|
||||
worry about memory exhaustion but then require that buffer lengths are
|
||||
respected.
|
||||
</p>
|
||||
<p>
|
||||
The C++ new and delete operators are preferred over C's malloc and free
|
||||
as new and delete are type safe.
|
||||
</p>
|
||||
<h3>
|
||||
Bracketing
|
||||
</h3>
|
||||
<p>
|
||||
Start brackets, '{', should be located on the line of the control structure they
|
||||
start and end brackets, '}', should be at the indented start of a line. When there is
|
||||
an else clause, this occurs on the same line as the '}'.
|
||||
This format uses less lines than alternatives, allowing more code to be seen on screen.
|
||||
Fully bracketed control
|
||||
structures are preferred because this makes it more likely that modifications will
|
||||
be correct and it allows Scintilla's folder to work. No braces on returned
|
||||
expressions as return is a keyword, not a function call.
|
||||
</p>
|
||||
<SPAN class=S0></SPAN><SPAN class=S5>bool</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>fn</SPAN><SPAN class=S10>(</SPAN><SPAN class=S5>int</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>a</SPAN><SPAN class=S10>)</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
|
||||
</SPAN><SPAN class=S5>if</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>a</SPAN><SPAN class=S10>)</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
|
||||
</SPAN><SPAN class=S11>s</SPAN><SPAN class=S10>();</SPAN><SPAN class=S0><BR>
|
||||
</SPAN><SPAN class=S11>t</SPAN><SPAN class=S10>();</SPAN><SPAN class=S0><BR>
|
||||
</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0> </SPAN><SPAN class=S5>else</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
|
||||
</SPAN><SPAN class=S11>u</SPAN><SPAN class=S10>();</SPAN><SPAN class=S0><BR>
|
||||
</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0><BR>
|
||||
</SPAN><SPAN class=S5>return</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>!</SPAN><SPAN class=S11>a</SPAN><SPAN class=S10>;</SPAN><SPAN class=S0><BR>
|
||||
</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0><BR>
|
||||
</SPAN> <h3>
|
||||
Spacing
|
||||
</h3>
|
||||
<p>
|
||||
Spaces on both sides of '=' and comparison operators and no attempt to line up '='.
|
||||
No space before or after '(', when used in calls, but a space after every ','.
|
||||
No spaces between tokens in short expressions but may be present in
|
||||
longer expressions. Space before '{'. No space before ';'.
|
||||
No space after '*' when used to mean pointer and no space after '[' or ']'.
|
||||
One space between keywords and '('.
|
||||
</p>
|
||||
<SPAN class=S0></SPAN><SPAN class=S5>void</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>StoreConditionally</SPAN><SPAN class=S10>(</SPAN><SPAN class=S5>int</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>c</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S5>const</SPAN><SPAN class=S0> </SPAN><SPAN class=S5>char</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>*</SPAN><SPAN class=S11>s</SPAN><SPAN class=S10>)</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
|
||||
</SPAN><SPAN class=S5>if</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>c</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>&&</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>baseSegment</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>==</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>trustSegment</SPAN><SPAN class=S10>[</SPAN><SPAN class=S6>"html"</SPAN><SPAN class=S10>]))</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
|
||||
</SPAN><SPAN class=S11>baseSegment</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>=</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>s</SPAN><SPAN class=S10>+</SPAN><SPAN class=S4>1</SPAN><SPAN class=S10>;</SPAN><SPAN class=S0><BR>
|
||||
</SPAN><SPAN class=S11>Store</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>s</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>baseSegment</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S6>"html"</SPAN><SPAN class=S10>);</SPAN><SPAN class=S0><BR>
|
||||
</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0><BR>
|
||||
</SPAN><SPAN class=S10>}</SPAN>
|
||||
<h3>
|
||||
Names
|
||||
</h3>
|
||||
<p>
|
||||
Identifiers use mixed case and no underscores.
|
||||
Class, function and method names start with an uppercase letter and use
|
||||
further upper case letters to distinguish words. Variables start with a lower
|
||||
case letter and use upper case letters to distinguish words.
|
||||
Loop counters and similar variables can have simple names like 'i'.
|
||||
Function calls should be differentiated from method calls with an initial '::'
|
||||
global scope modifier.
|
||||
</p>
|
||||
<SPAN class=S0></SPAN><SPAN class=S5>class</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>StorageZone</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
|
||||
</SPAN><SPAN class=S5>public</SPAN><SPAN class=S10>:</SPAN><SPAN class=S0><BR>
|
||||
</SPAN><SPAN class=S5>void</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>Store</SPAN><SPAN class=S10>(</SPAN><SPAN class=S5>const</SPAN><SPAN class=S0> </SPAN><SPAN class=S5>char</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>*</SPAN><SPAN class=S11>s</SPAN><SPAN class=S10>)</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
|
||||
</SPAN><SPAN class=S11>Media</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>*</SPAN><SPAN class=S11>mediaStore</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>=</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>::</SPAN><SPAN class=S11>GetBaseMedia</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>zoneDefault</SPAN><SPAN class=S10>);</SPAN><SPAN class=S0><BR>
|
||||
</SPAN><SPAN class=S5>for</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>(</SPAN><SPAN class=S5>int</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>i</SPAN><SPAN class=S10>=</SPAN><SPAN class=S11>mediaStore</SPAN><SPAN class=S10>-></SPAN><SPAN class=S11>cursor</SPAN><SPAN class=S10>;</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>mediaStore</SPAN><SPAN class=S10>[</SPAN><SPAN class=S11>i</SPAN><SPAN class=S10>],</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>i</SPAN><SPAN class=S10>++)</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
|
||||
</SPAN><SPAN class=S11>mediaStore</SPAN><SPAN class=S10>-></SPAN><SPAN class=S11>Persist</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>s</SPAN><SPAN class=S10>[</SPAN><SPAN class=S11>i</SPAN><SPAN class=S10>]);</SPAN><SPAN class=S0><BR>
|
||||
</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0><BR>
|
||||
</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0><BR>
|
||||
</SPAN><SPAN class=S10>};</SPAN>
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
After Width: | Height: | Size: 9.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 6.0 KiB |
File diff suppressed because it is too large
Load Diff
@ -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="HTML Tidy, see www.w3.org" />
|
||||
<meta name="generator" content="SciTE" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<title>
|
||||
Download Scintilla
|
||||
</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">Download
|
||||
Scintilla</font></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<font size="4"> <a href="http://prdownloads.sourceforge.net/scintilla/scintilla171.zip?download">
|
||||
Windows</a>
|
||||
<a href="http://prdownloads.sourceforge.net/scintilla/scintilla171.tgz?download">
|
||||
GTK+/Linux</a>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>
|
||||
Download.
|
||||
</h2>
|
||||
<p>
|
||||
The <a href="License.txt">license</a> for using Scintilla or SciTE is similar to that of Python
|
||||
containing very few restrictions.
|
||||
</p>
|
||||
<h3>
|
||||
Release 1.71
|
||||
</h3>
|
||||
<h4>
|
||||
Source Code
|
||||
</h4>
|
||||
The source code package contains all of the source code for Scintilla but no binary
|
||||
executable code and is available in
|
||||
<ul>
|
||||
<li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla171.zip?download">zip format</a> (720K) commonly used on Windows</li>
|
||||
<li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla171.tgz?download">tgz format</a> (620K) commonly used on Linux and compatible operating systems</li>
|
||||
</ul>
|
||||
Instructions for building on both Windows and Linux are included in the readme file.
|
||||
<h4>
|
||||
Windows Executable Code
|
||||
</h4>
|
||||
There is no download available containing only the Scintilla DLL.
|
||||
However, it is included in the <a href="SciTEDownload.html">SciTE
|
||||
executable full download</a> as SciLexer.DLL.
|
||||
<p>
|
||||
<a href="SciTEDownload.html">SciTE</a> is a good demonstration of Scintilla.
|
||||
</p>
|
||||
<p>
|
||||
Previous versions can be downloaded from the <a href="ScintillaHistory.html">history
|
||||
page</a>.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,507 @@
|
||||
<?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" />
|
||||
<title>
|
||||
Scintilla and SciTE Related Sites
|
||||
</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>
|
||||
Related Sites
|
||||
</h2>
|
||||
<h3>
|
||||
Ports and Bindings of Scintilla
|
||||
</h3>
|
||||
<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>
|
||||
is an ActiveX Control wrapper that support all Scintilla functions and additional high level functions.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://sourceforge.net/projects/jintilla/">Jintilla</a>
|
||||
is a JNI wrapper that allows Scintilla to be used in Java with
|
||||
both SWT and AWT.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://delphisci.sourceforge.net/">Delphi Scintilla Interface Components</a>
|
||||
is a FREE collection of components that makes it easy to use the
|
||||
Scintilla source code editing control from within Delphi and C++ Builder.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.lehigh.edu/~jrl1/">wxStEdit</a>
|
||||
is a library and sample program that provides extra features over wxStyledTextControl.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.naughter.com/scintilla.html">CScintillaCtrl, CScintillaView & CScintillaDoc</a>
|
||||
are freeware MFC classes to encapsulate Scintilla.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://sourceforge.net/projects/scide/">ScintillaNet
|
||||
</a> is an encapsulation of Scintilla for use within the .NET framework.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.riverbankcomputing.co.uk/qscintilla/index.php">QScintilla
|
||||
</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.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.adapower.com/gwindows/">
|
||||
GWindows</a> is a Win32 RAD GUI Framework for Ada 95 that
|
||||
includes a binding of Scintilla.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.templatetamer.org/index.php?DolphinScintilla">
|
||||
DolphinScintilla</a> is a DolphinSmalltalk wrapper for Scintilla.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/scintilla/ScintillaVB/">ScintillaVB</a>
|
||||
is an ActiveX control written in VB that encapsulates Scintilla.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://savannah.nongnu.org/projects/fxscintilla/">FXScintilla
|
||||
</a> is a port of Scintilla to the FOX platform. FXRuby includes Ruby
|
||||
bindings for FXScintilla.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.pnotepad.org/scintilla/">Delphi wrapper</a> for
|
||||
Scintilla which is also usable from Borland C++ Builder.
|
||||
</p>
|
||||
<p>
|
||||
The wxStyledTextCtrl editor component in the
|
||||
<a href="http://wxwindows.org/">wxWindows</a> cross platform toolkit is based on Scintilla.<br />
|
||||
A Python binding for wxStyledTextCtrl is part of <a href="http://wxpython.org/">wxPython</a>.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://sourceforge.net/projects/moleskine/">gtkscintilla</a>
|
||||
is an alternative GTK class implementation for scintilla.
|
||||
This implementation acts more like a Gtk+ object, with many methods rather
|
||||
than just scintilla_send_message() and is available as a shared library.
|
||||
This implementation works with GTK 1.x.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://sourceforge.net/projects/moleskine/">gtkscintilla2</a>
|
||||
is an alternative GTK class implementation for scintilla
|
||||
similar to the above, but for GTK 2.x.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.wingide.com/opensource/pyscintilla.html">pyscintilla</a>
|
||||
is the original Python binding for Scintilla's default GTK
|
||||
1.x class. Includes some additional support, such as native printing on
|
||||
Windows. The binding is hand-written rather than auto-generated from the
|
||||
Scintilla.iface file.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://sourceforge.net/projects/moleskine/">pygtkscintilla</a>
|
||||
is a Python binding for gtk1.x scintilla that uses
|
||||
gtkscintilla instead of the default GTK class.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://sra.itc.it/people/cavada/PyScintilla2.html">pyscintilla2</a>
|
||||
is a Python binding for GTK 2.x scintilla that uses
|
||||
gtkscintilla2.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/scintilla/scintillactrl/">ScintillaCtrl</a>
|
||||
is an unmaintained ActiveX control wrapper for Scintilla.
|
||||
</p>
|
||||
<h3>
|
||||
Projects using Scintilla
|
||||
</h3>
|
||||
<p>
|
||||
<a href="http://pype.sourceforge.net/">PyPE</a>
|
||||
is an editor written in Python with the wxPython GUI toolkit.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://home.mweb.co.za/sd/sdonovan/sciboo.html">Sciboo</a>
|
||||
is an editor based on ScintillaNET.
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://sourceforge.net/projects/tsct/">The Scite Config Tool</a>
|
||||
is a graphical user interface for changing SciTE properties files.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.totalcmd.net/plugring/SciLister.html">Scintilla Lister</a>
|
||||
is a plugin for Total Commander allowing viewing all documents with syntax highlighting
|
||||
inside Total Commander.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://chscite.sourceforge.net">ChSciTE</a>
|
||||
is a free IDE for C/C++ interpreter Ch. It runs cross platform.
|
||||
Ch is for cross-platform scripting, shell
|
||||
programming, 2D/3D plotting, numerical computing, and embedded
|
||||
scripting.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://codeblocks.org/">
|
||||
Code::Blocks</a> is an open source, cross platform free C++ IDE.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://notepad-plus.sourceforge.net/uk/site.htm">
|
||||
Notepad++</a> is a free source code editor under Windows.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://gubed.mccabe.nu/">
|
||||
Gubed</a> is a cross platform program to debug PHP scripts.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.lesser-software.com/lswdnl.htm">
|
||||
LSW DotNet-Lab</a> is a development environment for the .NET platform.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://glintercept.nutty.org/">
|
||||
GLIntercept</a> is an OpenGL function call interceptor that uses SciTE as a
|
||||
run-time shader editor.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://xined.sourceforge.net/">
|
||||
Xin</a> is an open-source XML editor for Windows.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://wxguide.sourceforge.net/indexedit.html">
|
||||
wyoEditor</a> is "A nice editor with a well designed and consistent look and feel".
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.flos-freeware.ch/notepad2.html">
|
||||
Notepad2</a> is "Yet another Notepad replacement".
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://pycrash.sourceforge.net/index.php?type=3">
|
||||
PyCrash Viewer</a> can examine crash dumps of Python programs.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.cabletest.com/mpt-discovery.shtml">
|
||||
MPT series Wire Analyzers</a> use Scintilla and SciTE.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.mygenerationsoftware.com">MyGeneration</a>
|
||||
is a .NET based code generator.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://cssed.sourceforge.net">CSSED</a>
|
||||
is a tiny GTK2 CSS editor.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.atari-soldiers.com/dide.html">DIDE</a>
|
||||
is a free IDE for the D language on Windows.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://wxghostscript.sourceforge.net/">
|
||||
IdePS</a>
|
||||
is a free Integrated Development Environment for PostScript
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://cute.sourceforge.net/">
|
||||
CUTE</a>
|
||||
is a user-friendly source code editor easily extended using Python.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.spaceblue.com/venis/">
|
||||
Venis IX</a>,
|
||||
the Visual Environment for NSIS (Nullsoft Scriptable Install System).
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.parinya.ca/">
|
||||
MinGW Developer Studio</a>
|
||||
is a simple C/C++ IDE for the MinGW compiler on Windows.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.die-offenbachs.de/detlev/eric3.html">Eric3</a>
|
||||
is a Python IDE written using PyQt and QScintilla.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.templatetamer.com/">TemplateTamer</a>
|
||||
is a tool for development of template based PHP web pages.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.bomberstudios.com/sciteflash/">SciTE|Flash</a>
|
||||
is a free Scintilla-based ActionScript editor for Windows.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.computersciencelab.com/CppIde.htm">CPPIDE</a>
|
||||
is part of some commercial high-school oriented programming course software.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.phpwebclasses.org/index.php?node=13">phpSciTE</a>
|
||||
is a free distribution of SciTE for Windows customised for use with PHP
|
||||
and bundled with a PHP API file and online help.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.blazingtools.com/is.html">Instant Source</a>
|
||||
is a commercial tool for looking at the HTML on web sites.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.codejoin.com/radon/">RAD.On++</a>
|
||||
is a free C++ Rapid Application Developer for Win32.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.luascript.thersgb.net/index.htm">wxLua</a> is both
|
||||
a binding of the wxWindows classes for Lua and a small IDE that works on Linux
|
||||
and Windows.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://wxbasic.sourceforge.net/">wxBasic</a> is an open source
|
||||
Basic interpreter that uses the wxWindows toolkit. A small IDE is under construction.
|
||||
</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>
|
||||
<a href="http://visual-mingw.sourceforge.net/">Visual MinGW</a> is an
|
||||
IDE for the MinGW compiler system.This runs on Windows with gcc.
|
||||
</p>
|
||||
<p>
|
||||
The <a href="http://archaeopteryx.com/wingide">Wing IDE</a> is a
|
||||
complete integrated development environment for the Python programming
|
||||
language.
|
||||
Available on Intel based Linux and Windows and on MacOS X through XDarwin.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.gorlice.net.pl/~rybak/luaide/">LuaIDE</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.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://gaiacrtn.free.fr/practical-ruby/index.html">Practical Ruby</a>
|
||||
is an IDE for Ruby on Windows.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.gnuenterprise.org/">GNUe</a>
|
||||
is a suite of tools and applications for solving the needs of the enterprise.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://silvercity.sourceforge.net/">SilverCity</a>
|
||||
is a lexing package that can provide lexical analysis for over 20 programming
|
||||
and markup languages.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.akbkhome.com/Projects/phpmole-IDE/">Php mole</a>
|
||||
is an integrated development enviroment for developing (primarily)
|
||||
web based and phpgtk based applications.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://hapdebugger.sourceforge.net/">HAP Python Remote Debugger</a>
|
||||
is a Python debugger that can run on one Windows machine debugging a Python program running
|
||||
on either the same or another machine.
|
||||
</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 wxWindows, wxPython and
|
||||
wxStyledTextControl.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.pragmaticprogrammer.com/ruby/downloads/ruby-install.html">Ruby installation</a>
|
||||
that includes SciTE set up for Ruby using an included copy of the "Programming Ruby" book for help.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.lcc.ufrn.br/~milano/ild/index.html">Interactive LuaSpace Development</a>
|
||||
is a graphical environment for LuaSpace which combines the CORBA platform
|
||||
with the language Lua.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://sourceforge.net/projects/pycrust/">PyCrust</a> is an interactive
|
||||
Python shell based on wxPython.
|
||||
</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>
|
||||
<a href="http://www.activestate.com/Products/Komodo/">Komodo</a>
|
||||
is a cross-platform multi-language development environment built
|
||||
as an application of Mozilla.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.xtgsystems.com/lua/">titmouse</a>
|
||||
is a Lua editor/debugger for Windows. It is available as both a component
|
||||
and an application.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://llt.chez.tiscali.fr/">Filerx</a>
|
||||
is a project manager for SciTE on Windows.
|
||||
Open source and includes an implementation of SciTE's Director interface so
|
||||
will be of interest to others wanting to control SciTE.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://anjuta.sourceforge.net/">Anjuta</a>
|
||||
is an open source C/C++ IDE for Linux/GNOME.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.develop.com/genx/">Gen<X></a>
|
||||
is a <i>code generalisation</i> product for Win32 that uses Scintilla in the X-Code Editor (which
|
||||
can also be used for general purpose editing) and for editing HTML in the HTML Dialog
|
||||
Editor.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.micampe.it/software/moleskine/">Moleskine</a> is a Scintilla
|
||||
based editor for GTK+. More ambitious than SciTE with plans
|
||||
for MDI, printing, and session management.
|
||||
Includes a new GTK+ wrapper widget for Scintilla.
|
||||
</p>
|
||||
<p>
|
||||
A <a href="http://www.burgaud.com">version of SciTE for Win32</a> enhanced
|
||||
with a tab control to allow easy movement between buffers.
|
||||
Go to the "Goodies" area on this site.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.suneido.com">
|
||||
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.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.BitBuilder.com">
|
||||
BitLeaf</a> is a new GNOME based development environment.
|
||||
Currently at an early stage of development.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://agast.dyndns.org/agast/home.html">
|
||||
Agast</a> is an authoring system for adventure games which includes
|
||||
a customised version of SciTE.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://oss.software.ibm.com/developerworks/opensource/sashxb/">
|
||||
SashXB for Linux</a> is an open source application development tool by
|
||||
IBM that uses Scintilla.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://boa-constructor.sourceforge.net/">Boa Constructor</a> is a RAD GUI
|
||||
Building IDE for the wxWindows cross platform platform. Written using wxPython with the
|
||||
wxStyledTextCtrl used as its editor.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.python.org/windows/">PythonWin</a>, a Win32 IDE for Python, uses
|
||||
Scintilla for both its editing and interactive windows.
|
||||
</p>
|
||||
<h3>
|
||||
Editing Components
|
||||
</h3>
|
||||
<p>
|
||||
<a href="http://gtksourceview.sourceforge.net/index.html">GtkSourceView</a>
|
||||
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.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://aeditor.rubyforge.org/">AEditor</a>
|
||||
is a free source code editing component implemented in Ruby.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.actiprosoftware.com/Products/DotNet/SyntaxEditor/Default.aspx">SyntaxEditor</a>
|
||||
is a commercial native .Net source code editing component.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://jedit.sourceforge.net/">jEdit</a> is a good Open Source syntax colouring
|
||||
editor written in and for Java.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.gtk.org/">GTK+</a>, the GIMP Toolkit, contains a rich text editing
|
||||
widget.<br />
|
||||
<a href="http://gedit.sourceforge.net/">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
|
||||
widget based on the GTK+ text widget.<br />
|
||||
<a href="http://gide.gdev.net/">gIDE</a> is an IDE based on GTK+.<br />
|
||||
<a href="http://www.bahnhof.se/~mikeh/linux_software.html">GtkExText</a> is a source code
|
||||
oriented text widget for GTK+.
|
||||
-->
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.codeguru.com/">CodeGuru</a> has source code for several Win32 MFC based
|
||||
editors.
|
||||
</p>
|
||||
<a href="http://synedit.sourceforge.net/">SynEdit</a> is a Win32 edit control written
|
||||
in Delphi.
|
||||
<p>
|
||||
<a href="http://www.tetradyne.com/srcvwax.htm">SourceView</a> is a commercial editing
|
||||
component for Win32.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.winmain.com/">CodeMax</a> is another commercial component for Win32.
|
||||
</p>
|
||||
<h3>
|
||||
Documents
|
||||
</h3>
|
||||
<p>
|
||||
<a href="http://www.finseth.com/~fin/craft/">The Craft of Text Editing</a>
|
||||
describes how EMACS works, <i>Craig A. Finseth</i>
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://freespace.virgin.net/james.brown7/tuts/bigmem02.htm">Span Tables</a>
|
||||
are another data structure that can be used to represent documents in memory in a way
|
||||
that performs well when data is inserted and deleted, <i>James Brown</i>
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.cs.cmu.edu/~wjh/papers/byte.html">Data Structures in a Bit-Mapped Text
|
||||
Editor</a>, <i>Wilfred J. Hanson</i>, Byte January 1987
|
||||
</p>
|
||||
<p>
|
||||
Text Editors: Algorithms and Architectures, <i>Ray Valdés</i>, Dr. Dobbs Journal
|
||||
April 1993
|
||||
</p>
|
||||
<p>
|
||||
Macintosh User Interface Guidelines and TextEdit chapters of Inside Macintosh
|
||||
</p>
|
||||
<h3>
|
||||
Development Tools
|
||||
</h3>
|
||||
<p>
|
||||
Scintilla and SciTE were developed using the
|
||||
<a href="http://www.mingw.org/">Mingw version of GCC</a>.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://astyle.sourceforge.net/">AStyle</a> is a source code formatter for C++ and
|
||||
Java code. SciTE has an Indent command defined for .cxx files that uses AStyle.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://winmerge.sourceforge.net/">WinMerge</a> is an interactive diff / merge
|
||||
for Windows. I prefer code submissions in the form of source files rather than diffs and then run
|
||||
WinMerge over the files to work out how to merge.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.python.org">Python</a> is my favourite programming language. Scintilla
|
||||
was started after I tried to improve the editor built into <a
|
||||
href="http://www.python.org/windows/">PythonWin</a>, but was frustrated by the limitations of
|
||||
the Windows Richedit control which PythonWin used.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.cs.yorku.ca/~oz/">regex</a> is a public domain
|
||||
implementation of regular expression pattern matching used in Scintilla.
|
||||
</p>
|
||||
<!--
|
||||
<p>
|
||||
<a href="http://www.petes-place.com/">CodeMagic</a> is a free generic IDE for Win32.
|
||||
Strongly Perl focused but customisable for other languages. Has more user interface features
|
||||
than SciTE.
|
||||
</p>
|
||||
-->
|
||||
<p>
|
||||
<!--
|
||||
Debugging dance soundtrack from <a href="http://www.insurge.com.au">iNsuRge</a>
|
||||
and -->
|
||||
Inspirational coding soundscapes by <a href="http://www.davidbridie.com.au">David Bridie</a>.
|
||||
</p>
|
||||
<p>
|
||||
Get away from hacking without any of that tedious standing up bother: <a
|
||||
href="http://www.zip.com.au/~sneal/index.html">Virtually There</a> ;).
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -0,0 +1,178 @@
|
||||
<?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" />
|
||||
<title>
|
||||
Scintilla and SciTE To Do
|
||||
</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>
|
||||
Bugs and To Do List
|
||||
</h2>
|
||||
<h3>
|
||||
Feedback
|
||||
</h3>
|
||||
<p>
|
||||
Issues can be reported on the <a href="https://sourceforge.net/tracker/?group_id=2439&atid=102439">Bug Tracker</a>
|
||||
and features requested on the <a href="https://sourceforge.net/tracker/?group_id=2439&atid=352439">Feature Request Tracker</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Scintilla Bugs
|
||||
</h3>
|
||||
<p>
|
||||
At the end of italics style runs characters can be chopped off. An example
|
||||
is using Verdana 12 point italics for strings makes an ending double quote
|
||||
half visible and an ending single quote invisible. This is hard to solve
|
||||
completely, may be better to avoid these situations by, for example,
|
||||
choosing a font like Times New Roman for strings. There is a specific kluge
|
||||
for the end of line which adds some room for italics but this does not
|
||||
work elsewhere.
|
||||
</p>
|
||||
<p>
|
||||
Dragging over bold text in some fonts will ripple because of the difference in
|
||||
size between drawing all of a string at once and drawing it in parts.
|
||||
</p>
|
||||
<p>
|
||||
Automatic scrolling when text dragged near edge of window.
|
||||
</p>
|
||||
<h3>
|
||||
GTK+ Version Bugs
|
||||
</h3>
|
||||
<h3>
|
||||
Scintilla To Do
|
||||
</h3>
|
||||
<p>
|
||||
Folding for languages that don't have it yet and good folding for languages
|
||||
that inherited poor folding from another languages folding code.
|
||||
</p>
|
||||
<p>
|
||||
Simple pattern based styling.
|
||||
</p>
|
||||
<p>
|
||||
Different height lines based upon tallest text on the line rather than on the tallest style
|
||||
possible.
|
||||
</p>
|
||||
<p>
|
||||
Composition of lexing for mixed languages (such as ASP+ over COBOL) by
|
||||
combining lexers.
|
||||
</p>
|
||||
<p>
|
||||
Printing support on GTK+. Maybe Postscript output or use Gnome?
|
||||
</p>
|
||||
<p>
|
||||
Stream folding which could be used to fold up the contents of HTML elements.
|
||||
</p>
|
||||
<p>
|
||||
Persisting view state such as current folding into a stream or blob so it is easy
|
||||
to restore.
|
||||
</p>
|
||||
<p>
|
||||
Move line up and move line down keys or move selected lines up / down.
|
||||
</p>
|
||||
<p>
|
||||
Printing of highlight lines and folding margin.
|
||||
</p>
|
||||
<p>
|
||||
Flow diagrams inside editor similar to
|
||||
<a href="http://www.eng.auburn.edu/grasp/grasp_main.shtml">
|
||||
GRASP</a>.
|
||||
</p>
|
||||
<p>
|
||||
A VCL component wrapper around Scintilla so it can be used with Delphi or
|
||||
Borland C++ Builder.
|
||||
There is <a href="http://www.pnotepad.org/scintilla/">some work</a>
|
||||
on this available.
|
||||
</p>
|
||||
<p>
|
||||
Port to MacOS X.
|
||||
</p>
|
||||
<p>
|
||||
More lexers for other languages.
|
||||
</p>
|
||||
<p>
|
||||
Automatically calculated range for horizontal scrolling.
|
||||
</p>
|
||||
<p>
|
||||
Virtual space at the end of lines so the caret can be moved beyond the end
|
||||
of lines with the cursor keys. May also make rectangular operations easier
|
||||
to perform.
|
||||
</p>
|
||||
<h3>
|
||||
SciTE To Do
|
||||
</h3>
|
||||
<p>
|
||||
Good regular expression support through a plugin.
|
||||
</p>
|
||||
<p>
|
||||
Allow tools to transform the selection, performing an operation like
|
||||
indentation or sorting.
|
||||
</p>
|
||||
<p>
|
||||
Allow file name based selection on all properties rather than just a chosen few.
|
||||
</p>
|
||||
<p>
|
||||
Opening from and saving to FTP servers.
|
||||
</p>
|
||||
<p>
|
||||
Setting to fold away comments upon opening.
|
||||
</p>
|
||||
<p>
|
||||
User defined fold ranges.
|
||||
</p>
|
||||
<p>
|
||||
Silent mode that does not display any message boxes.
|
||||
</p>
|
||||
<h3>
|
||||
Features I am unlikely to do
|
||||
</h3>
|
||||
<p>
|
||||
These are features I don't like or don't think are important enough to work on.
|
||||
Implementations are welcome from others though.
|
||||
</p>
|
||||
<p>
|
||||
Automatically saving modified menu shortcuts on exit.
|
||||
</p>
|
||||
<p>
|
||||
Mouse wheel panning (press the mouse wheel and then move the mouse) on
|
||||
Windows.
|
||||
</p>
|
||||
<p>
|
||||
Adding options to the save dialog to save in a particular encoding or with a
|
||||
chosen line ending.
|
||||
</p>
|
||||
<h3>
|
||||
Directions
|
||||
</h3>
|
||||
<p>
|
||||
The main point of this development is Scintilla, and this is where most effort will
|
||||
go. SciTE will get new features, but only when they make my life easier - I am
|
||||
not intending to make it grow up to be a huge full-function IDE like Visual
|
||||
Cafe. The lines I've currently decided not to step over in SciTE are any sort of
|
||||
project facility and any configuration dialogs. SciTE for Windows now has a
|
||||
Director interface for communicating with a separate project manager
|
||||
application.
|
||||
</p>
|
||||
<p>
|
||||
If you are interested in contributing code, do not feel any need to make it cross
|
||||
platform.
|
||||
Just code it for your platform and I'll either reimplement for the other platform or
|
||||
ensure that there is no effect on the other platform.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,375 @@
|
||||
<?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" />
|
||||
<title>
|
||||
Scintilla Usage Notes
|
||||
</title>
|
||||
<style type="text/css">
|
||||
SPAN {
|
||||
font-family: Verdana, Arial, Helvetica;
|
||||
font-size: 9pt;
|
||||
}
|
||||
.S0 {
|
||||
color: #808080;
|
||||
font-family: Verdana, Arial, Helvetica;
|
||||
}
|
||||
.S1 {
|
||||
font-family: Comic Sans MS, Times New Roman, Times;
|
||||
color: #007F00;
|
||||
font-size: 8pt;
|
||||
}
|
||||
.S2 {
|
||||
font-family: Comic Sans MS, Times New Roman, Times;
|
||||
color: #007F00;
|
||||
font-size: 8pt;
|
||||
}
|
||||
.S3 {
|
||||
font-family: Verdana, Arial, Helvetica;
|
||||
color: #7F7F7F;
|
||||
}
|
||||
.S4 {
|
||||
font-family: Verdana, Arial, Helvetica;
|
||||
color: #007F7F;
|
||||
}
|
||||
.S5 {
|
||||
color: #00007F;
|
||||
font-weight: bold;
|
||||
font-family: Verdana, Arial, Helvetica;
|
||||
}
|
||||
.S6 {
|
||||
color: #7F007F;
|
||||
font-family: Courier New, Courier;
|
||||
}
|
||||
.S7 {
|
||||
color: #7F007F;
|
||||
font-family: Courier New, Courier;
|
||||
}
|
||||
.S8 {
|
||||
color: #007F7F;
|
||||
}
|
||||
.S9 {
|
||||
color: #7F7F00;
|
||||
}
|
||||
.S10 {
|
||||
font-weight: bold;
|
||||
}
|
||||
</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
|
||||
Usage Notes</font></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>
|
||||
Implementing Auto-Indent
|
||||
</h2>
|
||||
<p>
|
||||
The key idea is to use the SCN_CHARADDED notification to add indentation after a newline.
|
||||
</p>
|
||||
<p>
|
||||
The lParam on the notification is a pointer to a SCNotification structure whose ch member
|
||||
specifies the character added. If a newline was added, the previous line can be retrieved and
|
||||
the same indentation can be added to the new line.
|
||||
</p>
|
||||
<p>
|
||||
Here is the relevant portion of code from SciTE: (SciTE.cxx SciTEWindow::CharAdded)
|
||||
</p>
|
||||
<span class='S5'>if</span><span class='S0'> </span> <span class='S10'>(</span><span
|
||||
class='S11'>ch</span><span class='S0'> </span> <span class='S10'>==</span><span
|
||||
class='S0'> </span> <span class='S7'>'\r'</span><span class='S0'> </span> <span
|
||||
class='S10'>||</span><span class='S0'> </span> <span class='S11'>ch</span><span
|
||||
class='S0'> </span> <span class='S10'>==</span><span class='S0'> </span> <span
|
||||
class='S7'>'\n'</span><span class='S10'>)</span><span class='S0'> </span> <span
|
||||
class='S10'>{</span><span class='S0'><br />
|
||||
</span> <span class='S5'>char</span><span class='S0'> </span>
|
||||
<span class='S11'>linebuf</span><span class='S10'>[</span><span class='S4'>1000</span><span
|
||||
class='S10'>];</span><span class='S0'><br />
|
||||
</span> <span class='S5'>int</span><span class='S0'> </span>
|
||||
<span class='S11'>curLine</span><span class='S0'> </span> <span class='S10'>=</span><span
|
||||
class='S0'> </span> <span class='S11'>GetCurrentLineNumber</span><span
|
||||
class='S10'>();</span><span class='S0'><br />
|
||||
</span> <span class='S5'>int</span><span class='S0'> </span>
|
||||
<span class='S11'>lineLength</span><span class='S0'> </span> <span class='S10'>
|
||||
=</span><span class='S0'> </span> <span class='S11'>SendEditor</span><span
|
||||
class='S10'>(</span><span class='S11'>SCI_LINELENGTH</span><span class='S10'>,</span><span
|
||||
class='S0'> </span> <span class='S11'>curLine</span><span class='S10'>);</span><span
|
||||
class='S0'><br />
|
||||
</span> <span class='S2'>
|
||||
//Platform::DebugPrintf("[CR] %d len = %d\n", curLine, lineLength);</span><span
|
||||
class='S0'><br />
|
||||
</span> <span class='S5'>if</span><span class='S0'> </span> <span
|
||||
class='S10'>(</span><span class='S11'>curLine</span><span class='S0'> </span> <span
|
||||
class='S10'>></span><span class='S0'> </span> <span class='S4'>0</span><span
|
||||
class='S0'> </span> <span class='S10'>&&</span><span class='S0'> </span>
|
||||
<span class='S11'>lineLength</span><span class='S0'> </span> <span class='S10'>
|
||||
<=</span><span class='S0'> </span> <span class='S4'>2</span><span
|
||||
class='S10'>)</span><span class='S0'> </span> <span class='S10'>{</span><span
|
||||
class='S0'><br />
|
||||
</span> <span class='S5'>int</span><span class='S0'> </span>
|
||||
<span class='S11'>prevLineLength</span><span class='S0'> </span> <span class='S10'>
|
||||
=</span><span class='S0'> </span> <span class='S11'>SendEditor</span><span
|
||||
class='S10'>(</span><span class='S11'>SCI_LINELENGTH</span><span class='S10'>,</span><span
|
||||
class='S0'> </span> <span class='S11'>curLine</span><span class='S0'> </span> <span
|
||||
class='S10'>-</span><span class='S0'> </span> <span class='S4'>1</span><span
|
||||
class='S10'>);</span><span class='S0'><br />
|
||||
</span> <span class='S5'>if</span><span class='S0'> </span> <span
|
||||
class='S10'>(</span><span class='S11'>prevLineLength</span><span class='S0'> </span> <span
|
||||
class='S10'><</span><span class='S0'> </span> <span class='S5'>sizeof</span><span
|
||||
class='S10'>(</span><span class='S11'>linebuf</span><span class='S10'>))</span><span
|
||||
class='S0'> </span> <span class='S10'>{</span><span class='S0'><br />
|
||||
</span> <span class='S11'>WORD</span><span
|
||||
class='S0'> </span> <span class='S11'>buflen</span><span class='S0'> </span> <span
|
||||
class='S10'>=</span><span class='S0'> </span> <span class='S5'>sizeof</span><span
|
||||
class='S10'>(</span><span class='S11'>linebuf</span><span class='S10'>);</span><span
|
||||
class='S0'><br />
|
||||
</span> <span class='S11'>memcpy</span><span
|
||||
class='S10'>(</span><span class='S11'>linebuf</span><span class='S10'>,</span><span
|
||||
class='S0'> </span> <span class='S10'>&</span><span class='S11'>buflen</span><span
|
||||
class='S10'>,</span><span class='S0'> </span> <span class='S5'>sizeof</span><span
|
||||
class='S10'>(</span><span class='S11'>buflen</span><span class='S10'>));</span><span
|
||||
class='S0'><br />
|
||||
</span> <span class='S11'>
|
||||
SendEditor</span><span class='S10'>(</span><span class='S11'>EM_GETLINE</span><span
|
||||
class='S10'>,</span><span class='S0'> </span> <span class='S11'>curLine</span><span
|
||||
class='S0'> </span> <span class='S10'>-</span><span class='S0'> </span> <span
|
||||
class='S4'>1</span><span class='S10'>,</span><span class='S0'><br />
|
||||
</span>
|
||||
<span class='S5'>reinterpret_cast</span><span class='S10'><</span><span
|
||||
class='S11'>LPARAM</span><span class='S10'>>(</span><span class='S5'>static_cast</span><span
|
||||
class='S10'><</span><span class='S5'>char</span><span class='S0'> </span> <span
|
||||
class='S10'>*>(</span><span class='S11'>linebuf</span><span class='S10'>)));</span><span
|
||||
class='S0'><br />
|
||||
</span> <span class='S11'>linebuf</span><span
|
||||
class='S10'>[</span><span class='S11'>prevLineLength</span><span class='S10'>]</span><span
|
||||
class='S0'> </span> <span class='S10'>=</span><span class='S0'> </span> <span
|
||||
class='S7'>'\0'</span><span class='S10'>;</span><span class='S0'><br />
|
||||
</span> <span class='S5'>for</span><span
|
||||
class='S0'> </span> <span class='S10'>(</span><span class='S5'>int</span><span
|
||||
class='S0'> </span> <span class='S11'>pos</span><span class='S0'> </span> <span
|
||||
class='S10'>=</span><span class='S0'> </span> <span class='S4'>0</span><span
|
||||
class='S10'>;</span><span class='S0'> </span> <span class='S11'>linebuf</span><span
|
||||
class='S10'>[</span><span class='S11'>pos</span><span class='S10'>];</span><span
|
||||
class='S0'> </span> <span class='S11'>pos</span><span class='S10'>++)</span><span
|
||||
class='S0'> </span> <span class='S10'>{</span><span class='S0'><br />
|
||||
</span> <span
|
||||
class='S5'>if</span><span class='S0'> </span> <span class='S10'>(</span><span
|
||||
class='S11'>linebuf</span><span class='S10'>[</span><span class='S11'>pos</span><span
|
||||
class='S10'>]</span><span class='S0'> </span> <span class='S10'>!=</span><span
|
||||
class='S0'> </span> <span class='S7'>' '</span><span class='S0'> </span> <span
|
||||
class='S10'>&&</span><span class='S0'> </span> <span class='S11'>
|
||||
linebuf</span><span class='S10'>[</span><span class='S11'>pos</span><span
|
||||
class='S10'>]</span><span class='S0'> </span> <span class='S10'>!=</span><span
|
||||
class='S0'> </span> <span class='S7'>'\t'</span><span class='S10'>)</span><span
|
||||
class='S0'><br />
|
||||
</span>
|
||||
<span class='S11'>linebuf</span><span class='S10'>[</span><span class='S11'>pos</span><span
|
||||
class='S10'>]</span><span class='S0'> </span> <span class='S10'>=</span><span
|
||||
class='S0'> </span> <span class='S7'>'\0'</span><span class='S10'>;</span><span
|
||||
class='S0'><br />
|
||||
</span> <span class='S10'>}</span><span
|
||||
class='S0'><br />
|
||||
</span> <span class='S11'>
|
||||
SendEditor</span><span class='S10'>(</span><span class='S11'>EM_REPLACESEL</span><span
|
||||
class='S10'>,</span><span class='S0'> </span> <span class='S4'>0</span><span
|
||||
class='S10'>,</span><span class='S0'> </span> <span class='S5'>
|
||||
reinterpret_cast</span><span class='S10'><</span><span class='S11'>LPARAM</span><span
|
||||
class='S10'>>(</span><span class='S5'>static_cast</span><span class='S10'><</span><span
|
||||
class='S5'>char</span><span class='S0'> </span> <span class='S10'>*>(</span><span
|
||||
class='S11'>linebuf</span><span class='S10'>)));</span><span class='S0'><br />
|
||||
</span> <span class='S10'>}</span><span class='S0'><br />
|
||||
</span> <span class='S10'>}</span><br />
|
||||
|
||||
<p style="margin-bottom: 0in">
|
||||
Of course, fancier handling could be implemented. For example, if the previous line was the
|
||||
start of a control construct, the next line could be automatically indented one tab further.
|
||||
(Assuming that is your indenting style.)
|
||||
</p>
|
||||
<h2>
|
||||
Implementing Syntax Styling
|
||||
</h2>
|
||||
<p>
|
||||
Syntax styling is handled by the SCN_STYLENEEDED notification. Scintilla keeps track of the
|
||||
end of the styled text - this is retrieved with SCI_GETENDSTYLED. In response to the
|
||||
SCN_STYLENEEDED notification, you should apply styles to the text from ENDSTYLED to the
|
||||
position specified by the notification.
|
||||
</p>
|
||||
<p>
|
||||
Here is the relevant portion of code from SciTE: (SciTE.cxx)
|
||||
</p>
|
||||
<span class='S5'>void</span><span class='S0'> </span> <span class='S11'>
|
||||
SciTEWindow</span><span class='S10'>::</span><span class='S11'>Notify</span><span
|
||||
class='S10'>(</span><span class='S11'>SCNotification</span><span class='S0'> </span> <span
|
||||
class='S10'>*</span><span class='S11'>notification</span><span class='S10'>)</span><span
|
||||
class='S0'> </span> <span class='S10'>{</span><span class='S0'><br />
|
||||
</span> <span class='S5'>switch</span><span class='S0'> </span>
|
||||
<span class='S10'>(</span><span class='S11'>notification</span><span
|
||||
class='S10'>-></span><span class='S11'>nmhdr.code</span><span class='S10'>)</span><span
|
||||
class='S0'> </span> <span class='S10'>{</span><span class='S0'><br />
|
||||
</span> <span class='S5'>case</span><span class='S0'> </span>
|
||||
<span class='S11'>SCN_STYLENEEDED</span><span class='S10'>:</span><span
|
||||
class='S0'> </span> <span class='S10'>{</span><span class='S0'><br />
|
||||
</span> <span
|
||||
class='S5'>if</span><span class='S0'> </span> <span class='S10'>(</span><span
|
||||
class='S11'>notification</span><span class='S10'>-></span><span
|
||||
class='S11'>nmhdr.idFrom</span><span class='S0'> </span> <span class='S10'>==</span><span
|
||||
class='S0'> </span> <span class='S11'>IDM_SRCWIN</span><span class='S10'>)</span><span
|
||||
class='S0'> </span> <span class='S10'>{</span><span class='S0'><br />
|
||||
</span>
|
||||
<span class='S5'>int</span><span class='S0'> </span> <span class='S11'>
|
||||
endStyled</span><span class='S0'> </span> <span class='S10'>=</span><span
|
||||
class='S0'> </span> <span class='S11'>SendEditor</span><span class='S10'>(</span><span
|
||||
class='S11'>SCI_GETENDSTYLED</span><span class='S10'>);</span><span class='S0'><br />
|
||||
</span>
|
||||
<span class='S5'>int</span><span class='S0'> </span> <span class='S11'>
|
||||
lineEndStyled</span><span class='S0'> </span> <span class='S10'>=</span><span
|
||||
class='S0'> </span> <span class='S11'>SendEditor</span><span class='S10'>(</span><span
|
||||
class='S11'>EM_LINEFROMCHAR</span><span class='S10'>,</span><span class='S0'> </span>
|
||||
<span class='S11'>endStyled</span><span class='S10'>);</span><span class='S0'><br />
|
||||
</span>
|
||||
<span class='S11'>endStyled</span><span class='S0'> </span> <span class='S10'>
|
||||
=</span><span class='S0'> </span> <span class='S11'>SendEditor</span><span
|
||||
class='S10'>(</span><span class='S11'>EM_LINEINDEX</span><span class='S10'>,</span><span
|
||||
class='S0'> </span> <span class='S11'>lineEndStyled</span><span class='S10'>);</span><span
|
||||
class='S0'><br />
|
||||
</span>
|
||||
<span class='S11'>Colourise</span><span class='S10'>(</span><span
|
||||
class='S11'>endStyled</span><span class='S10'>,</span><span class='S0'> </span> <span
|
||||
class='S11'>notification</span><span class='S10'>-></span><span
|
||||
class='S11'>position</span><span class='S10'>);</span><br />
|
||||
|
||||
<p>
|
||||
Colourize(start, end) retrieves the specified range of text and then calls ColourizeDoc in
|
||||
keywords.cxx. It starts the process by calling:
|
||||
</p>
|
||||
<span class='S11'>SendMessage</span><span class='S10'>(</span><span
|
||||
class='S11'>hwnd</span><span class='S10'>,</span><span class='S0'> </span> <span
|
||||
class='S11'>SCI_STARTSTYLING</span><span class='S10'>,</span><span class='S0'> </span>
|
||||
<span class='S11'>startPos</span><span class='S10'>,</span><span class='S0'> </span> <span
|
||||
class='S4'>31</span><span class='S10'>);</span><br />
|
||||
|
||||
<p>
|
||||
and then for each token of the text, calling:
|
||||
</p>
|
||||
<span class='S11'>SendMessage</span><span class='S10'>(</span><span
|
||||
class='S11'>hwnd</span><span class='S10'>,</span><span class='S0'> </span> <span
|
||||
class='S11'>SCI_SETSTYLING</span><span class='S10'>,</span><span class='S0'> </span> <span
|
||||
class='S11'>length</span><span class='S10'>,</span><span class='S0'> </span> <span
|
||||
class='S11'>style</span><span class='S10'>);</span><br />
|
||||
|
||||
<p>
|
||||
where style is a number from 0 to 31 whose appearance has been defined using the
|
||||
SCI_STYLESET... messages.
|
||||
</p>
|
||||
<h2>
|
||||
Implementing Calltips
|
||||
</h2>
|
||||
<p>
|
||||
Again, the SCN_CHARADDED notification is used to catch when an opening parenthesis is added.
|
||||
The preceding word can then be retrieved from the current line:
|
||||
</p>
|
||||
<span class='S5'>char</span><span class='S0'> </span> <span
|
||||
class='S11'>linebuf</span><span class='S10'>[</span><span class='S4'>1000</span><span
|
||||
class='S10'>];</span><span class='S0'><br />
|
||||
</span> <span class='S5'>int</span><span class='S0'> </span> <span
|
||||
class='S11'>current</span><span class='S0'> </span> <span class='S10'>=</span><span
|
||||
class='S0'> </span> <span class='S11'>SendEditor</span><span class='S10'>(</span><span
|
||||
class='S11'>SCI_GETCURLINE</span><span class='S10'>,</span><span class='S0'> </span> <span
|
||||
class='S5'>sizeof</span><span class='S10'>(</span><span class='S11'>linebuf</span><span
|
||||
class='S10'>),</span><span class='S0'><br />
|
||||
</span> <span class='S5'>
|
||||
reinterpret_cast</span><span class='S10'><</span><span class='S11'>LPARAM</span><span
|
||||
class='S10'>>(</span><span class='S5'>static_cast</span><span class='S10'><</span><span
|
||||
class='S5'>char</span><span class='S0'> </span> <span class='S10'>*>(</span><span
|
||||
class='S11'>linebuf</span><span class='S10'>)));</span><span class='S0'><br />
|
||||
</span> <span class='S5'>int</span><span class='S0'> </span> <span
|
||||
class='S11'>pos</span><span class='S0'> </span> <span class='S10'>=</span><span
|
||||
class='S0'> </span> <span class='S11'>SendEditor</span><span class='S10'>(</span><span
|
||||
class='S11'>SCI_GETCURRENTPOS</span><span class='S10'>);</span><span class='S0'><br />
|
||||
<br />
|
||||
</span> <span class='S5'>int</span><span class='S0'> </span> <span
|
||||
class='S11'>startword</span><span class='S0'> </span> <span class='S10'>=</span><span
|
||||
class='S0'> </span> <span class='S11'>current</span><span class='S0'> </span> <span
|
||||
class='S10'>-</span><span class='S0'> </span> <span class='S4'>1</span><span
|
||||
class='S10'>;</span><span class='S0'><br />
|
||||
</span> <span class='S5'>while</span><span class='S0'> </span>
|
||||
<span class='S10'>(</span><span class='S11'>startword</span><span class='S0'> </span>
|
||||
<span class='S10'>></span><span class='S0'> </span> <span class='S4'>0</span><span
|
||||
class='S0'> </span> <span class='S10'>&&</span><span class='S0'> </span>
|
||||
<span class='S11'>isalpha</span><span class='S10'>(</span><span class='S11'>linebuf</span><span
|
||||
class='S10'>[</span><span class='S11'>startword</span><span class='S0'> </span> <span
|
||||
class='S10'>-</span><span class='S0'> </span> <span class='S4'>1</span><span
|
||||
class='S10'>]))</span><span class='S0'><br />
|
||||
</span> <span class='S11'>
|
||||
startword</span><span class='S10'>--;</span><span class='S0'><br />
|
||||
</span> <span class='S11'>linebuf</span><span class='S10'>[</span><span
|
||||
class='S11'>current</span><span class='S0'> </span> <span class='S10'>-</span><span
|
||||
class='S0'> </span> <span class='S4'>1</span><span class='S10'>]</span><span
|
||||
class='S0'> </span> <span class='S10'>=</span><span class='S0'> </span> <span
|
||||
class='S7'>'\0'</span><span class='S10'>;</span><span class='S0'><br />
|
||||
</span> <span class='S5'>char</span><span class='S10'>*</span><span
|
||||
class='S0'> </span> <span class='S11'>word</span><span class='S0'> </span> <span
|
||||
class='S10'>=</span><span class='S0'> </span> <span class='S11'>linebuf</span><span
|
||||
class='S0'> </span> <span class='S10'>+</span><span class='S0'> </span> <span
|
||||
class='S11'>startword</span><span class='S10'>;</span><br />
|
||||
|
||||
<p>
|
||||
Then if a calltip is available it can be displayed. The calltip appears immediately below
|
||||
the position specified. The calltip can be multiple lines separated by newlines (\n).
|
||||
</p>
|
||||
<span class='S11'>pos</span><span class='S0'> </span> <span
|
||||
class='S10'>=</span><span class='S0'> </span> <span class='S11'>SendMessage</span><span
|
||||
class='S10'>(</span><span class='S11'>hwnd</span><span class='S10'>,</span><span
|
||||
class='S0'> </span> <span class='S11'>SCI_GETCURRENTPOS</span><span
|
||||
class='S10'>,</span><span class='S0'> </span> <span class='S4'>0</span><span
|
||||
class='S10'>,</span><span class='S0'> </span> <span class='S4'>0</span><span
|
||||
class='S10'>);</span><span class='S0'><br />
|
||||
</span> <span class='S11'>SendMessageText</span><span
|
||||
class='S10'>(</span><span class='S11'>hwnd</span><span class='S10'>,</span><span
|
||||
class='S0'> </span> <span class='S11'>SCI_CALLTIPSHOW</span><span
|
||||
class='S10'>,</span><span class='S0'> </span> <span class='S11'>pos</span><span
|
||||
class='S0'> </span> <span class='S10'>-</span><span class='S0'> </span> <span
|
||||
class='S11'>wordLen</span><span class='S0'> </span> <span class='S10'>-</span><span
|
||||
class='S0'> </span> <span class='S4'>1</span><span class='S10'>,</span><span
|
||||
class='S0'> </span> <span class='S11'>calltip</span><span class='S10'>);</span><br />
|
||||
|
||||
<p>
|
||||
The calltip can be removed when a closing parenthesis is entered:
|
||||
</p>
|
||||
<span class='S5'>if</span><span class='S0'> </span> <span
|
||||
class='S10'>(</span><span class='S11'>SendMessage</span><span class='S10'>(</span><span
|
||||
class='S11'>hwnd</span><span class='S10'>,</span><span class='S0'> </span> <span
|
||||
class='S11'>SCI_CALLTIPACTIVE</span><span class='S10'>,</span><span class='S0'> </span>
|
||||
<span class='S4'>0</span><span class='S10'>,</span><span class='S0'> </span> <span
|
||||
class='S4'>0</span><span class='S10'>))</span><span class='S0'><br />
|
||||
</span> <span class='S11'>
|
||||
SendMessage</span><span class='S10'>(</span><span class='S11'>hwnd</span><span
|
||||
class='S10'>,</span><span class='S0'> </span> <span class='S11'>
|
||||
SCI_CALLTIPCANCEL</span><span class='S10'>,</span><span class='S0'> </span> <span
|
||||
class='S4'>0</span><span class='S10'>,</span><span class='S0'> </span> <span class='S4'>
|
||||
0</span><span class='S10'>);</span><br />
|
||||
|
||||
<p>
|
||||
Obviously, it is up the application to look after supplying the appropriate calltip text.
|
||||
</p>
|
||||
<p>
|
||||
SciTE goes one step further, counting the commas between arguments and highlighting the
|
||||
corresponding part of the calltip. This code is in ContinueCallTip.
|
||||
</p>
|
||||
<p>
|
||||
<i>Page contributed by Andrew McKinlay.</i>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -0,0 +1,142 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"><title>How to use the Scintilla Edit Control in windows?</title></head><body bgcolor="#ffffff">
|
||||
<p><h2>How to use the Scintilla Edit Control in windows?</h2>
|
||||
<p>
|
||||
This should be a little step by step explanation how to use Scintilla in the windows environment.
|
||||
</p>
|
||||
</p>
|
||||
<p><h2>How to create Scintilla Edit Control?</h2>
|
||||
<p>
|
||||
First of all, load the Scintilla DLL with something like:
|
||||
</p>
|
||||
<pre>
|
||||
|
||||
hmod = LoadLibrary("SciLexer.DLL");
|
||||
if (hmod==NULL)
|
||||
{
|
||||
MessageBox(hwndParent,
|
||||
"The Scintilla DLL could not be loaded.",
|
||||
"Error loading Scintilla",
|
||||
MB_OK | MB_ICONERROR);
|
||||
}
|
||||
</pre>
|
||||
<p>
|
||||
If the DLL was loaded successfully, then the DLL has registered (yes, by itself) a new
|
||||
window class. The new class called "Scintilla" is the new scintilla edit control.
|
||||
</p>
|
||||
<p>
|
||||
Now you can use this new control just like any other windows control.
|
||||
</p>
|
||||
<pre>
|
||||
|
||||
hwndScintilla = CreateWindowEx(0,
|
||||
"Scintilla","", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_CLIPCHILDREN,
|
||||
10,10,500,400,hwndParent,(HMENU)GuiID, hInstance,NULL);
|
||||
</pre>
|
||||
<p>
|
||||
Note the new window class name: "Scintilla". By reaching this point you actually included
|
||||
a Scintilla Edit Control to your windows program.
|
||||
</p>
|
||||
</p>
|
||||
<p><h2>How to control the Scintilla Edit Control?</h2>
|
||||
<p>
|
||||
You can control Scintilla by sending commands to the Edit Control.
|
||||
There a 2 ways of doing this. A simple and fast way.
|
||||
</p>
|
||||
<p><h3>The simple way to control Scintilla</h3>
|
||||
<p>
|
||||
The simple way is just like with any other windows control. You can send messages to the
|
||||
Scintilla Edit Control and receive notifications from the control. (Note that the notifications
|
||||
are sent to the parent window of the Scintilla Edit Control.)
|
||||
</p>
|
||||
<p>
|
||||
The Scintilla Edit Control knows a special message for each command.
|
||||
To send commands to the Scintilla Edit Control you can use the SendMessage function.
|
||||
</p>
|
||||
<pre>
|
||||
|
||||
SendMessage(hwndScintilla,sci_command,wparam,lparam);
|
||||
</pre>
|
||||
<p>
|
||||
like:
|
||||
</p>
|
||||
<pre>
|
||||
|
||||
SendMessage(hwndScintilla,SCI_CREATEDOCUMENT, 0, 0);
|
||||
</pre>
|
||||
<p>
|
||||
Some of the commands will return a value and unused parameters should be set to NULL.
|
||||
</p>
|
||||
</p>
|
||||
<p><h3>The fast way to control Scintilla</h3>
|
||||
<p>
|
||||
The fast way of controlling the Scintilla Edit Control is to call message handling function by yourself.
|
||||
You can retrieve a pointer to the message handling function of the Scintilla Edit Control and
|
||||
call it directly to execute a command. This way is much more faster than the SendMessage() way.
|
||||
</p>
|
||||
<p>
|
||||
1st you have to use the SCI_GETDIRECTFUNCTION and SCI_GETDIRECTPOINTER commands to
|
||||
retrieve the pointer to the function and a pointer which must be the first parameter when calling the retrieved
|
||||
function pointer.
|
||||
You have to do this with the SendMessage way :)
|
||||
</p>
|
||||
<p>
|
||||
The whole thing has to look like this:
|
||||
</p>
|
||||
<pre>
|
||||
|
||||
int (*fn)(void*,int,int,int);
|
||||
void * ptr;
|
||||
int canundo;
|
||||
|
||||
fn = (int (__cdecl *)(void *,int,int,int))SendMessage(
|
||||
hwndScintilla,SCI_GETDIRECTFUNCTION,0,0);
|
||||
ptr = (void *)SendMessage(hwndScintilla,SCI_GETDIRECTPOINTER,0,0);
|
||||
|
||||
canundo = fn(ptr,SCI_CANUNDO,0,0);
|
||||
</pre>
|
||||
<p>
|
||||
with "fn" as the function pointer to the message handling function of the Scintilla Control
|
||||
and "ptr" as the pointer that must be used as 1st parameter.
|
||||
The next parameters are the Scintilla Command with its two (optional) parameters.
|
||||
</p>
|
||||
|
||||
</p>
|
||||
<p><h3>How will I receive notifications?</h3>
|
||||
<p>
|
||||
Whenever an event occurs where Scintilla wants to inform you about something, the Scintilla Edit Control
|
||||
will send notification to the parent window. This is done by a WM_NOTITY message.
|
||||
When receiving that message, you have to look in the xxx struct for the actual message.
|
||||
</p>
|
||||
<p>
|
||||
So in Scintillas parent window message handling function you have to include some code like this:
|
||||
</p>
|
||||
<pre>
|
||||
NMHDR *lpnmhdr;
|
||||
|
||||
[...]
|
||||
|
||||
case WM_NOTIFY:
|
||||
lpnmhdr = (LPNMHDR) lParam;
|
||||
|
||||
if(lpnmhdr->hwndFrom==hwndScintilla)
|
||||
{
|
||||
switch(lpnmhdr->code)
|
||||
{
|
||||
case SCN_CHARADDED:
|
||||
/* Hey, Scintilla just told me that a new */
|
||||
/* character was added to the Edit Control.*/
|
||||
/* Now i do something cool with that char. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
</pre>
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<i>Page contributed by Holger Schmidt.</i>
|
||||
</p>
|
||||
</body></html>
|
||||
|
@ -0,0 +1,198 @@
|
||||
<?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="keywords" content="Scintilla, SciTE, Editing Component, Text Editor" />
|
||||
<meta name="Description"
|
||||
content="www.scintilla.org is the home of the Scintilla editing component and SciTE text editor application." />
|
||||
<meta name="Date.Modified" content="20060821" />
|
||||
<style type="text/css">
|
||||
.versionlist {
|
||||
color: #FFCC99;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function IsRemote() {
|
||||
var loc = '' + window.location;
|
||||
return loc.indexOf('http:') != -1;
|
||||
}
|
||||
</script>
|
||||
<title>
|
||||
Scintilla and SciTE
|
||||
</title>
|
||||
</head>
|
||||
<body bgcolor="#FFFFFF" text="#000000">
|
||||
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
<td width="256">
|
||||
<img src="SciWord.jpg" height="78" width="256" alt="Scintilla" />
|
||||
</td>
|
||||
<td width="40%" align="left">
|
||||
<font color="#FFCC99" size="4"> A free source code editing component for Win32 and
|
||||
GTK+</font>
|
||||
</td>
|
||||
<td width="40%" align="right">
|
||||
<font color="#FFCC99" size="3"> Release version 1.71<br />
|
||||
Site last modified August 21 2006</font>
|
||||
</td>
|
||||
<td width="20%">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
<td width="100%">
|
||||
<img src="SciBreak.jpg" height="150" width="1024" alt="Sci Break" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="6" border="0">
|
||||
<tr>
|
||||
<td width="100%">
|
||||
<span class="versionlist">Version 1.71 defaults mouse drag to be move on GTK+
|
||||
and GTK+ also has some internationalisation fixes.</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%">
|
||||
<span class="versionlist">Version 1.70 allows, on GTK+, approximate character set conversions
|
||||
for pasting and uses internationalised input at all times.</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%">
|
||||
<span class="versionlist">Version 1.69 supports the Spice language and can draw
|
||||
the selection and whole line markers translucently.</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%">
|
||||
<span class="versionlist">Version 1.68 can draw the caret line
|
||||
and box indicators translucently and has an accurate TCL lexer.</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%">
|
||||
<span class="versionlist">Version 1.67 enhances some lexers and fixes bugs.</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%">
|
||||
<span class="versionlist">Version 1.66 has a new Ruby lexer and fixes bugs on GTK+
|
||||
with Pango 1.8.</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<font size="4">
|
||||
<script type="text/javascript" language="JavaScript"><!--
|
||||
if (IsRemote()) {
|
||||
document.write('<a href="http://scintilla.sourceforge.net/SciTEImage.html">Screenshot</a> ');
|
||||
document.write('<a href="http://scintilla.sourceforge.net/ScintillaDownload.html">Download</a> ');
|
||||
}
|
||||
//--></script>
|
||||
<a href="http://scintilla.sourceforge.net/ScintillaDoc.html">Documentation</a>
|
||||
<a href="http://scintilla.sourceforge.net/ScintillaToDo.html">Bugs</a>
|
||||
<script type="text/javascript" language="JavaScript"><!--
|
||||
if (IsRemote()) {
|
||||
document.write('<a href="http://scintilla.sourceforge.net/SciTE.html">SciTE</a> ');
|
||||
}
|
||||
//--></script>
|
||||
<a href="http://scintilla.sourceforge.net/ScintillaHistory.html">
|
||||
History</a> <a href="http://scintilla.sourceforge.net/ScintillaRelated.html">Related</a> </font>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
<a href="http://scintilla.sourceforge.net/ScintillaDoc.html">Scintilla</a> is a free source code editing component.
|
||||
It comes with complete source code and a <a href="http://scintilla.sourceforge.net/License.txt">license</a> that
|
||||
permits use in any free project or commercial product.
|
||||
</p>
|
||||
<p>
|
||||
As well as features found in standard text editing components, Scintilla includes features
|
||||
especially useful when editing and debugging source code.
|
||||
These include support for syntax styling, error indicators, code completion and call tips.
|
||||
The selection margin can contain markers like those used in debuggers to indicate
|
||||
breakpoints and the current line. Styling choices are more open than with many editors,
|
||||
allowing the use of proportional fonts, bold and italics, multiple foreground and background
|
||||
colours and multiple fonts.
|
||||
</p>
|
||||
<p>
|
||||
The <a href="http://scintilla.sourceforge.net/SinkWorld.html">SinkWorld project</a>
|
||||
investigates possible future directions for Scintilla to make it more flexible, robust, perform
|
||||
better and run on the .NET and Java virtual machines.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://scintilla.sourceforge.net/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
|
||||
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.
|
||||
</p>
|
||||
<p>
|
||||
Development of Scintilla started as an effort to improve the text editor in PythonWin. After
|
||||
being frustrated by problems in the Richedit control used by PythonWin, it looked like the
|
||||
best way forward was to write a new edit control. The biggest problem with Richedit and other
|
||||
similar controls is that they treat styling changes as important persistent changes to the
|
||||
document so they are saved into the undo stack and set the document's dirty flag. For source
|
||||
code, styling should not be persisted as it can be mechanically recreated.
|
||||
</p>
|
||||
<p>
|
||||
Scintilla and SciTE are currently available for Intel Win32 and Linux compatible operating
|
||||
systems with GTK+. They have been run on Windows 95, NT 4.0, Windows 2000, and on Red Hat
|
||||
Linux 8 and 9 with GTK+ 1.2 and 2.0. <a href="http://scintilla.sourceforge.net/SciTEImage.html">Here is a screenshot of
|
||||
SciTE.</a><br />
|
||||
</p>
|
||||
<p>
|
||||
You can <a href="http://scintilla.sourceforge.net/ScintillaDownload.html">download Scintilla.</a>
|
||||
</p>
|
||||
<p>
|
||||
The source code can be downloaded via CVS at the Source Forge
|
||||
<a href="https://sourceforge.net/project/?group_id=2439">Scintilla project page</a>.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://scintilla.sourceforge.net/ScintillaRelated.html">Related sites.</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://scintilla.sourceforge.net/ScintillaToDo.html">Bugs and To Do list.</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://scintilla.sourceforge.net/ScintillaHistory.html">History and contribution credits.</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://scintilla.sourceforge.net/Icons.html">Icons that can be used with Scintilla.</a>
|
||||
</p>
|
||||
<p>
|
||||
Questions and comments about Scintilla should be directed to the
|
||||
<a href="http://mailman.lyra.org/mailman/listinfo/scintilla-interest">scintilla-interest</a>
|
||||
mailing list,
|
||||
which is for discussion of Scintilla and related projects, their bugs and future features.
|
||||
This is a low traffic list, averaging less than 50 messages per week.
|
||||
To avoid spam, only list members can write to the list.
|
||||
Announcements of new versions of Scintilla go to both the scintilla-interest list and
|
||||
<a href="http://mailman.lyra.org/mailman/listinfo/scintilla-announce">scintilla-announce</a>.
|
||||
Messages sent to my personal email address that could have been sent to the list
|
||||
may receive no response.
|
||||
<br />
|
||||
</p>
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
document.write('There is a <a href="https://sourceforge.net/project/?group_id=2439">Scintilla project page<\/a>');
|
||||
document.write(' hosted on ');
|
||||
if (IsRemote()) {
|
||||
document.write('<a href="http://sourceforge.net">');
|
||||
document.write('<img src="http://sourceforge.net/sflogo.php?group_id=2439&type=1" width="88" height="31" border="0" /><\/a> ');
|
||||
} else {
|
||||
document.write('<a href="http://sourceforge.net">SourceForge<\/a>');
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user