diff options
author | nyamatongwe <unknown> | 2000-03-08 01:36:00 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2000-03-08 01:36:00 +0000 |
commit | 8eba2a95b6aa25489c28eabfcd54e0389de78899 (patch) | |
tree | 12898a1d1b9db690270b093a0182239d3aa85de6 | |
download | scintilla-mirror-8eba2a95b6aa25489c28eabfcd54e0389de78899.tar.gz |
Initial revision
-rw-r--r-- | License.txt | 20 | ||||
-rw-r--r-- | README | 33 | ||||
-rw-r--r-- | bin/empty.txt | 1 | ||||
-rw-r--r-- | doc/Design.html | 247 | ||||
-rw-r--r-- | doc/SciRest.jpg | bin | 0 -> 66 bytes | |||
-rw-r--r-- | doc/SciTEIco.png | 1 | ||||
-rw-r--r-- | doc/SciWord.jpg | bin | 0 -> 949 bytes | |||
-rw-r--r-- | doc/ScintillaDoc.html | 966 | ||||
-rw-r--r-- | doc/ScintillaDownload.html | 83 | ||||
-rw-r--r-- | doc/ScintillaHistory.html | 627 | ||||
-rw-r--r-- | doc/ScintillaRelated.html | 113 | ||||
-rw-r--r-- | doc/ScintillaToDo.html | 124 | ||||
-rw-r--r-- | doc/ScintillaUsage.html | 375 | ||||
-rw-r--r-- | doc/index.html | 147 | ||||
-rw-r--r-- | gtk/PlatGTK.cxx | 751 | ||||
-rw-r--r-- | gtk/makefile | 69 | ||||
-rw-r--r-- | tgzsrc | 5 | ||||
-rwxr-xr-x | zipsrc.bat | 4 |
18 files changed, 3566 insertions, 0 deletions
diff --git a/License.txt b/License.txt new file mode 100644 index 000000000..4c7deb821 --- /dev/null +++ b/License.txt @@ -0,0 +1,20 @@ +License for Scintilla and SciTE + +Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org> + +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation. + +NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE +OR PERFORMANCE OF THIS SOFTWARE.
\ No newline at end of file @@ -0,0 +1,33 @@ +README for building of Scintilla and SciTE + + +*** GTK+/Linux version *** + +You must first have GTK+ 1.2x and GCC (2.8 or better) installed. +GTK+ 1.0x will not work and when it did it was very slow. +Other C++ compilers may work but may require tweaking the make file. + +To build SciTE for GTK+/Linux, use the Makefile_gtk like this: + + make -f Makefile_gtk + +The current make file only supports static linking between SciTE and Scintilla. + +The SciTEGTK.properties file is better than the SciTEGlobal.properties for use +on Linux/GTK+ as it specifies fonts that are likely to be installed. +SciTE reads its SciTEGlobal.properties file from the user's home directory. + + +*** Windows version *** + +A C++ compiler is required. Mingw32 GCC 2.9.5 is the compiler used +for most development although Visual C++ is also supported. + +To compile with GCC, use make on the "makefile" file. + + make + +To compile with VC++, use nmake on the "makefile_vc" file. + + nmake /f makefile_vc + diff --git a/bin/empty.txt b/bin/empty.txt new file mode 100644 index 000000000..66183855a --- /dev/null +++ b/bin/empty.txt @@ -0,0 +1 @@ +This empty files ensures that the directory is created.
\ No newline at end of file diff --git a/doc/Design.html b/doc/Design.html new file mode 100644 index 000000000..d6fd6ee06 --- /dev/null +++ b/doc/Design.html @@ -0,0 +1,247 @@ +<?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, templates, run time type information or use of the standard C++ + library. + </p> + <p> + The currently supported platforms, Windows and GTK+/Linux 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. + </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> + diff --git a/doc/SciRest.jpg b/doc/SciRest.jpg Binary files differnew file mode 100644 index 000000000..2ddd0425d --- /dev/null +++ b/doc/SciRest.jpg diff --git a/doc/SciTEIco.png b/doc/SciTEIco.png new file mode 100644 index 000000000..f1ad7558e --- /dev/null +++ b/doc/SciTEIco.png @@ -0,0 +1 @@ +‰PNG diff --git a/doc/SciWord.jpg b/doc/SciWord.jpg Binary files differnew file mode 100644 index 000000000..e43a9bfce --- /dev/null +++ b/doc/SciWord.jpg diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html new file mode 100644 index 000000000..95f95a7e3 --- /dev/null +++ b/doc/ScintillaDoc.html @@ -0,0 +1,966 @@ +<?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</font></a> + </td> + </tr> + </table> + <h2> + Scintilla Documentation + </h2> + <p> + There is <a href="Design.html">an overview of the internal design of Scintilla</a>. + </p> + <p> + <a href="ScintillaUsage.html">Some notes on using Scintilla</a>. + </p> + <p> + For now, the best way to work out how to develop using Scintilla is to see how SciTE uses + it. SciTE exercises most of Scintilla's facilities. + </p> + <p> + The Windows version of Scintilla is a Windows Control. As such, its primary programming + interface is through Windows messages. It responds to many of the messages defined for the + standard Edit and Richedit controls as well as a suite of its own for controlling syntax + styling, markers, auto-completion and call tips. + </p> + The GTK+ version also uses messages in a similar way to the Windows version. This is different + to normal GTK+ practice but made it easier to implement rapidly. + <p> + The messages are (with wParam and lParam use) + </p> + <h3> + Text retrieval and modification. + </h3> +<pre> +WM_GETTEXT(int length, char *text) +WM_SETTEXT(<unused>, char *text) +EM_GETLINE(int line, char *text) +EM_REPLACESEL(<unused>, char *text) +EM_SETREADONLY +EM_GETTEXTRANGE(<unused>, TEXTRANGE *tr) +SCI_ADDTEXT(char *s, int length) +SCI_ADDSTYLEDTEXT(cell *s,int length) +SCI_INSERTTEXT(int pos, char *text) +SCI_CLEARALL +SCI_GETCHARAT(int position) +SCI_GETSTYLEAT(int position) +SCI_GETSTYLEDTEXT(<unused>, TEXTRANGE *tr) +SCI_SETSTYLEBITS(int bits) +SCI_GETSTYLEBITS +</pre> + <p> + Each character in a Scintilla document is followed by an associated byte of styling + information. The combination of a character byte and a style byte is called a cell. Style + bytes are interpreted as a style index in the low 5 bits and as 3 individual bits of + indicators. This allows 32 fundamental styles which is enough for most languages and three + independent indicators so that, for example, syntax errors, deprecated names and bad + indentation could all be displayed at once. Indicators may be displayed as simple underlines, + squiggly underlines or a line of small 'T' shapes. Additional indicators such as strike-out + or blurred could be defined in the future. The number of bits used for styles can be altered + with SCI_SETSTYLEBITS up to a maximum of 6 bits. + The remaining bits can be used for indicators. + </p> + <p> + Positions within the Scintilla document refer to a character or the gap before that + character. The caret exists between character positions and can be located from before the + first character to after the last character. There are places where the caret can not go + where two character bytes make up one character. This occurs when a DBCS character from a + language like Japanese is included in the document or when line ends are marked with the CP/M + standard of a carriage return followed by a line feed. The INVALID_POSITION constant (-1) + represent an invalid position within the document. + </p> + <p> + All lines of text in Scintilla are the same height, and this height is calculated from the + largest font in any current style. This restriction is for performance as if lines differed + in height then calculations involving positioning of text would require that text to be + styled first. + </p> + <h3> + Standard commands + </h3> +<pre> +WM_CUT +WM_COPY +WM_PASTE +WM_CLEAR +</pre> + <h3> + Undo and Redo + </h3> +<pre> +WM_UNDO +EM_CANUNDO +EM_EMPTYUNDOBUFFER +SCI_REDO +SCI_CANREDO +SCI_SETUNDOCOLLECTION(SC_UNDOCOLLECT_NONE | SC_UNDOCOLLECT_AUTOSTART | SC_UNDOCOLLECT_MANUALSTART) +SCI_BEGINUNDOACTION +SCI_ENDUNDOACTION +SCI_APPENDUNDOSTARTACTION +</pre> + <p> + Scintilla has multiple level undo and redo. It will continue to collect undoable actions + until memory runs out. Sequences of typing or deleting are compressed into single actions to + make it easier to undo and redo at a sensible level of detail. Sequences of actions can be + combined into actions that are undone as a unit. These sequences occur between + SCI_BEGINUNDOACTION and SCI_ENDUNDOACTION messages. These sequences can be nested and only + the top level sequences are undone as units.<br /> + If undo collection is put into manual mode, then the SCI_APPENDUNDOSTARTACTION message + finishes any current sequence and starts a new sequence. This message and the corresponding + SC_UNDOCOLLECT_MANUALSTART are deprecated and only included for backward compatibility. + </p> + <h3> + Selection and information + </h3> +<pre> +WM_GETTEXTLENGTH +EM_GETFIRSTVISIBLELINE +EM_GETLINECOUNT +EM_GETMODIFY +EM_SETMODIFY(bool ismodified) +EM_GETRECT(RECT *rect) +EM_GETSEL(int *start, int *end) +EM_EXGETSEL(<unused>, CHARRANGE *cr) +EM_SETSEL(int start, int end) +EM_EXSETSEL(<unused>, CHARRANGE *cr) +EM_GETSELTEXT(<unused>, char *text) +EM_LINEFROMCHAR(int position) +EM_EXLINEFROMCHAR(int position) +EM_LINEINDEX(int line) +EM_LINELENGTH(int position) +EM_SCROLL(int line) +EM_LINESCROLL(int column, int line) +EM_SCROLLCARET() +EM_CANPASTE +EM_CHARFROMPOS(<unused>, POINT *location) +EM_POSFROMCHAR(int position, POINT *location) +EM_SELECTIONTYPE +EM_HIDESELECTION(bool hide) +SCI_GETLENGTH +SCI_GETCURRENTPOS +SCI_GETANCHOR +SCI_SELECTALL +SCI_CHANGEPOSITION(int delta, bool extendselection) +SCI_PAGEMOVE(int cmdkey, bool extendselection) +SCI_GOTOLINE(int line) +SCI_GOTOPOS(int position) +SCI_SETANCHOR(int position) +SCI_GETCURLINE(int textlen, char *text) +SCI_LINELENGTH(int line) +SCI_SETCARETPOLICY(int policy) +</pre> + <p> + Scintilla maintains a selection which stretches between two points, the anchor and the + current position. + </p> + <p> + EM_SETMODIFY is no longer supported as whether the document is modified is determined by + whether the undo position is at the save point. + </p> + <p> + SCI_GETCURLINE retrieves the text of the line containing the caret and returns the position + within the line of the caret. + </p> + <h3> + Searching + </h3> +<pre> +EM_FINDTEXT(int flags, FINDTEXTEX *ft) +EM_FINDTEXTEX(int flags, FINDTEXTEX *ft) +</pre> + <p> + Scintilla can find where a string is present in its document. + </p> +<pre> +SCI_SEARCHANCHOR +SCI_SEARCHNEXT(int flags, char *text) +SCI_SEARCHPREV(int flags, char *text) +</pre> + <p> + Relocatable search support. This allows + multiple incremental interactive searches to be macro recorded + while still setting the selection to found text so the find/select + operation is self-contained. + </p> + <h3> + Visible white space + </h3> +<pre> +SCI_GETVIEWWS +SCI_SETVIEWWS(bool visisble) +</pre> + <p> + White space can be made visible which may useful for languages in which whitespace is + significant, such as Python. Space characters appear as small centred dots and tab characters + as light arrows pointing to the right. + </p> + <h3> + Line endings + </h3> +<pre> +SCI_GETEOLMODE +SCI_SETEOLMODE(SC_EOL_CRLF or SC_EOL_CR or SC_EOL_LF) +SCI_GETVIEWEOL +SCI_SETVIEWEOL(bool visible) +SCI_CONVERTEOLS(SC_EOL_CRLF or SC_EOL_CR or SC_EOL_LF) +</pre> + <p> + Scintilla can interpret any of the three major line end conventions, Macintosh (\r), Unix + (\n) and CP/M / DOS / Windows (\r\n). When the user presses the Enter key, one of these line + end strings is inserted into the buffer. The default is \r\n, but this can be changed with + the SCI_SETEOLMODE message taking a an argument of SC_EOL_CRLF, SC_EOL_CR, or SC_EOL_LF. The + SCI_GETEOLMODE message retrieves the current state. + </p> + <p> + The characters that make up line ends can be made visible with the view EOL option. This + looks similar to (CR), (LF), or (CR)(LF). + </p> + <p> + All of the line ends in the document may be changed by calling SCI_CONVERTEOLS with the + desired line ending. + </p> + <h3> + Styling + </h3> +<pre> +SCI_GETENDSTYLED +SCI_STARTSTYLING(int position, int mask) +SCI_SETSTYLING(int length, int style) +SCI_SETSTYLINGEX(int length, stylesequence *s) +</pre> + <p> + Scintilla keeps a record of the last character that is likely to be styled correctly. This + is moved forwards when characters after it are styled and moved backwards if changes are made + to the text of the document before it. Before drawing text, this position is checked to see + if any styling is needed and a notification message sent to the container if so. The + container can send SCI_GETENDSTYLED to work out where it needs to start styling. + </p> + <p> + To perform the actual styling, SCI_STARTSTYLING is sent with the position to start at and a + mask indicating which bits of the style bytes can be set. The mask allows styling to occur + over several passes, with, for example, basic styling done on an initial pass to ensure that + the text of the code is seen quickly and correctly, and then a second slower pass, detecting + syntax errors and using indicators to show where these are. After SCI_STARTSTYLING, multiple + SCI_SETSTYLING messages are sent for each lexical entity to be styled. + </p> + <h3> + Style Definition + </h3> +<pre> +SCI_STYLECLEARALL +SCI_STYLERESETDEFAULT +SCI_STYLESETFORE(int stylenumber, int colour) +SCI_STYLESETBACK(int stylenumber, int colour) +SCI_STYLESETBOLD(int stylenumber, bool bold) +SCI_STYLESETITALIC(int stylenumber, bool italic) +SCI_STYLESETSIZE(int stylenumber, int sizeinpoints) +SCI_STYLESETFONT(int stylenumber, char *fontname) +SCI_STYLESETEOLFILLED(int stylenumber, bool eolfilled) +</pre> + <p> + While the style setting messages mentioned above, change the style numbers associated with + text, these messages define how those style numbers are interpreted visually. The + STYLE_DEFAULT style defines the attributes that all styles will receive when + SCI_STYLECLEARALL is called. SCI_STYLERESETDEFAULT resets STYLE_DEFAULT to its state when + Scintilla was initialised. + </p> + <p> + The EOLFILLED style allows to colourise from the end of the line to the right side of the + window. + </p> + <p> + As well as the 32 fundamental lexer styles, there are also some predefined numbered styles + starting at 32, STYLE_DEFAULT, STYLE_LINENUMBER, STYLE_BRACELIGHT, STYLE_BRACEBAD, and + STYLE_CONTROLCHAR. These can be defined with the SCI_STYLESET* messages. + </p> +<pre> +SCI_SETFORE(int colour) +SCI_SETBACK(int colour) +SCI_SETBOLD(bool bold) +SCI_SETITALIC(bool italic) +SCI_SETSIZE(int sizeinpoints) +SCI_SETFONT(char *fontname) +</pre> + <p> + These messages are responsible for global default styling and are used when no explicit + setting is defined for a style.<br /> + These messages are deprecated in favour of using the SCI_STYLESET* messages for + STYLE_DEFAULT. They will be removed in a future release. + </p> +<pre> +SCI_SETSELFORE(bool useSelectionForeColour, int colour) +SCI_SETSELBACK(bool useSelectionBackColour, int colour) +SCI_SETCARETFORE(int colour) +SCI_GETCARETPERIOD +SCI_SETCARETPERIOD(int milliseconds) +</pre> + <p> + The selection is shown by changing the foreground and / or background colours. If one of + these is not set then that attribute is not changed for the selection. The default is to show + the selection by changing the background to light grey and leaving the foreground the same as + when it was not selected. + </p> + <p> + The colour of the caret can be set with SCI_SETCARETFORE. The rate at which the caret blinks + can be set with SCI_SETCARETPERIOD which determines the time in milliseconds that the caret + is visible or invisible before changing state. Setting the period to 0 stops the caret + blinking. + </p> + <h3> + Margins + </h3> +<pre> +EM_GETMARGINS +EM_SETMARGINS(EC_LEFTMARGIN or EC_RIGHTMARGIN or EC_USEFONTINFO, int val) +</pre> + <p> + Gets or sets the width of the blank margin on both sides of the text. This defaults to one + pixel on each side. val contains a left margin size in its low word and a right margin size + in its high word. This is also the way that EM_GETMARGINS returns the current setting. + EC_LEFTMARGIN and EC_RIGHTMARGIN are bit flags that can be used individually or combined to + set both margins at once. EC_USEFONTINFO ignores val and sets both margins to be half the + average character width in the current default font. + </p> +<pre> +SCI_SETMARGINTYPEN(int margin, SC_MARGIN_SYMBOL | SC_MARGIN_NUMBER) +SCI_GETMARGINTYPEN(int margin) +SCI_SETMARGINWIDTHN(int margin, int pixelwidth) +SCI_GETMARGINWIDTHN(int margin) +SCI_SETMARGINMASKN(int margin, int mask) +SCI_GETMARGINMASKN(int margin) +SCI_SETMARGINSENSITIVEN(int margin, bool sensitive) +SCI_GETMARGINSENSITIVEN(int margin) +</pre> + <p> + There may be up to three margins to the left of the text display. Each margin may contain + marker symbols and some may be set to display line numbers + (with SCI_SETMARGINTYPEN). The markers displayed in each margin are set with + SCI_SETMARGINMASKN. Any markers not associated with a visible margin will + be displayed as changes in background colour in the text. + A width in pixels can be set for each margin. Margins + with a zero width are ignored completely. Each margin may be made sensitive to mouse + clicks. A click in a sensitive margin will result in a SCN_MARGINCLICK notification being + sent to the container. Margins that are not sensitive act as selection margins which make it + easy to select ranges of lines. + </p> + <p> + Earlier versions of Scintilla hard coded particular margin types and provided + SCI_SETMARGINWIDTH and SCI_SETLINENUMBERWIDTH which are + now deprecated. + </p> + <h3> + Other settings + </h3> +<pre> +SCI_SETUSEPALETTE(bool allowPaletteUse) +</pre> + <p> + On 8 bit displays, which can only display a maximum of 256 colours, the graphics environment + mediates between the colour needs of applications through the use of palettes. On GTK+, + Scintilla always uses a palette. On Windows, there are some problems with visual flashing + when switching between applications with palettes and it is also necessary for the + application containing the Scintilla control to forward some messages to Scintilla for its + palette code to work. + </p> + <p> + Because of these issues, the application must tell Scintilla to use a palette. If Scintilla + is not using a palette, then it will only be able to display in those colours already + available, which are often the 20 Windows system colours. + </p> + <p> + To see an example of how to enable palette support in Scintilla, search the text of SciTE + for WM_PALETTECHANGED, WM_QUERYNEWPALETTE and SCI_SETUSEPALETTE. + </p> +<pre> +SCI_SETBUFFEREDDRAW(bool isbuffered) +</pre> + <p> + Turns on or off buffered drawing. Buffered drawing draws each line into a bitmap rather than + directly to the screen and then copies the bitmap to the screen. This avoids flickering + although it does take longer. The default is for drawing to be buffered. + </p> +<pre> +SCI_SETTABWIDTH(int widthinchars) +</pre> + <p> + Sets the size of a tab as a multiple of the size of a space character in the style of the + first style definition + </p> +<pre> +SCI_SETCODEPAGE(int codepage) +</pre> + <p> + Scintilla has some very simple Japanese DBCS (and probably Chinese and Korean) support. Use + this message with argument set to the code page number to set Scintilla to use code page + information to ensure double byte characters are treated as one character rather than two. + This also stops the caret from moving between the two bytes in a double byte character. Call + with argument set to zero to disable DBCS support. + </p> +<pre> +SCI_SETWORDCHARS(<unused>, char *chars) +</pre> + <p> + Scintilla has several functions that operate on words which are defined to be contiguous + sequences of characters from a particular set of characters. This message defines which + characters are members of that set. If chars is null then the default set, alphanumeric and + '_', is used. + </p> +<pre> +SCI_GRABFOCUS +</pre> + <p> + On GTK+, focus handling is more complicated than on Windows, so Scintilla can be told with + this message to grab the focus. + </p> + <h3> + Brace highlighting + </h3> +<pre> +SCI_BRACEHIGHLIGHT(int pos1, int pos2) +SCI_BRACEBADLIGHT(int pos1) +SCI_BRACEMATCH(int position, int maxReStyle) +</pre> + <p> + Up to two characters can be highlighted in a 'brace highlighting style' which is defined as + style number 34. If there is no matching brace then the 'brace badlighting style', style + number 35, can be used to show the brace that is unmatched. Using a position of + INVALID_POSITION removes the highlight. + </p> + <p> + The SCI_BRACEMATCH message finds a corresponding matching brace given the position of one + brace. The brace characters handled are '(', ')', '[', ']', '{', '}', '<', and '>'. A + match only occurs if the style of the matching brace is the same as the starting brace or the + matching brace is beyond the end of styling. Nested braces are handled correctly. The + maxReStyle parameter must currently be 0. + </p> + <h3> + Markers + </h3> +<pre> +SCI_MARKERDEFINE(int markernumber, int markersymbols) +SCI_MARKERSETFORE(int markernumber, int colour) +SCI_MARKERSETBACK(int markernumber, int colour) +SCI_MARKERADD(int line, int markernumber) +SCI_MARKERDELETE(int line, int markernumber) +SCI_MARKERDELETEALL(int markernumber) +SCI_MARKERGET(int line) +SCI_MARKERNEXT(int lineStart, int markermask) +SCI_MARKERPREVIOUS(int lineStart, int markermask) +SCI_MARKERLINEFROMHANDLE(int handle) +SCI_MARKERDELETEHANDLE(int handle) +</pre> + <p> + Markers appear in the selection margin to the left of the text. They are small geometric + symbols often used in debuggers to indicate breakpoints and the current line. If the + selection margin is set to zero width then the background colour of the whole line is changed + instead. There may be upto 32 marker symbols defined and each line has a set of these markers + associated with it. The markers are drawn in the order of their numbers. Markers try to move + with their text by tracking where the start of their line moves. When a line is deleted, its + markers are combined, by an or operation, with the markers of the previous line. The + SCI_MARKERDELETEALL removes markers of the given number from all lines, and treats a + parameter of -1 as meaning delete all markers from all lines.<br /> + SCI_MARKERADD returns a marker handle number which may be used to find out where a marker + has moved to with the SCI_MARKERLINEFROMHANDLE message. SCI_MARKERDELETEHANDLE can be used to + delete a marker based upon its handle. + </p> + <p> + SCI_MARKERGET retrieves the set of markers associated with a line. SCI_MARKERNEXT and + SCI_MARKERPREVIOUS can be used to efficiently search for lines that contain markers. They + return the next / previous line with a set of markers that includes some of the bits set in + the markermask parameter.<br /> + The markermask is equal to a OR of (1 << markernumber) for each marker of the desired + / retrieved set. + </p> + <p> + The marker symbols currently available are SC_MARK_CIRCLE, SC_MARK_ROUNDRECT, SC_MARK_ARROW, + SC_MARK_SMALLRECT, SC_MARK_SHORTARROW, SC_MARK_EMPTY, SC_MARK_ARROWDOWN, + SC_MARK_MINUS, SC_MARK_PLUS. The SC_MARK_EMPTY symbol is invisible, + allowing client code to track the movement of lines. + </p> + <h3> + Indicators + </h3> +<pre> +SCI_INDICSETSTYLE(int indicatornumber, int indicatorstyle) +SCI_INDICGETSTYLE(int indicatornumber) +SCI_INDICSETFORE(int indicatornumber, int colour) +SCI_INDICGETFORE(int indicatornumber) +</pre> + <p> + These messages allow setting the visual appearance of the three (0, 1, and 2) available + indicators. + </p> + <p> + The indicator styles currently available are INDIC_PLAIN, INDIC_SQUIGGLE, and INDIC_TT. + </p> + <p> + The indicators are set using SCI_STARTSTYLING with a INDICS_MASK mask and SCI_SETSTYLING + with the values INDIC0_MASK, INDIC1_MASK and INDIC2_MASK. + </p> + <h3> + Autocompletion + </h3> +<pre> +SCI_AUTOCSHOW(<unused>,char *list) +SCI_AUTOCCANCEL +SCI_AUTOCACTIVE +SCI_AUTOCPOSSTART +SCI_AUTOCCOMPLETE +SCI_AUTOCSTOPS(<unused>,char *chars) +</pre> + <p> + Auto completion displays a list box based upon the users typing showing likely identifiers. + The SCI_AUTOCSHOW message causes this list to be displayed, with its argument being a list of + words separated by space characters. SCI_AUTOCPOSSTART returns the value of the current + position when SCI_AUTOCSHOW started display of the list. + </p> + <p> + The current selection can be triggered with the SCI_AUTOCCOMPLETE message. This has the same + effect as the tab key. When in autocompletion mode, the list should disappear when the user + types a character that can not be part of the autocompletion, such as '.', '(' or '[' when + typing an identifier. A set of characters which will cancel autocompletion can be specified + with the SCI_AUTOCSTOPS. + </p> + <h3> + Calltips + </h3> +<pre> +SCI_CALLTIPSHOW(<unused>, char *definition) +SCI_CALLTIPCANCEL +SCI_CALLTIPACTIVE +SCI_CALLTIPPOSSTART +SCI_CALLTIPSETHLT(int highlightstart, int highlightend) +SCI_CALLTIPSETBACK(int colour) +</pre> + <p> + Call tips are small windows displaying the arguments to a function and are displayed after + the user has typed the name of the function. As the user types values for each argument, the + name of the argument currently being entered is highlighted. + </p> + <p> + SCI_CALLTIPSHOW starts the process by displaying the calltip window, with the definition + argument containing the text to display. SCI_CALLTIPPOSSTART returns the value of the current + position when SCI_CALLTIPSHOW started display of the list. SCI_CALLTIPSETHLT sets the region + of the calltip text displayed in a highlighted style. The background colour of calltips can + be set with SCI_CALLTIPSETBACK with the default being white. + </p> + <h3> + Keyboard Commands + </h3> +<pre> +SCI_LINEDOWN +SCI_LINEDOWNEXTEND +SCI_LINEUP +SCI_LINEUPEXTEND +SCI_CHARLEFT +SCI_CHARLEFTEXTEND +SCI_CHARRIGHT +SCI_CHARRIGHTEXTEND +SCI_WORDLEFT +SCI_WORDLEFTEXTEND +SCI_WORDRIGHT +SCI_WORDRIGHTEXTEND +SCI_HOME +SCI_HOMEEXTEND +SCI_LINEEND +SCI_LINEENDEXTEND +SCI_DOCUMENTSTART +SCI_DOCUMENTSTARTEXTEND +SCI_DOCUMENTEND +SCI_DOCUMENTENDEXTEND +SCI_PAGEUP +SCI_PAGEUPEXTEND +SCI_PAGEDOWN +SCI_PAGEDOWNEXTEND +SCI_EDITTOGGLEOVERTYPE +SCI_CANCEL +SCI_DELETEBACK +SCI_TAB +SCI_BACKTAB +SCI_NEWLINE +SCI_FORMFEED +SCI_VCHOME +SCI_VCHOMEEXTEND +SCI_ZOOMIN +SCI_ZOOMOUT +SCI_DELWORDLEFT +SCI_DELWORDRIGHT +</pre> + <p> + To allow the container application to perform any of the actions available to the user with + keyboard, all the keyboard actions are messages. They do not take any parameters. + </p> + <p> + These commands are also used when redefining the key bindings with the SCI_ASSIGNCMDKEY + message. + </p> + <h3> + Key Bindings + </h3> +<pre> +SCI_ASSIGNCMDKEY((short key,short modifiers), int message) +SCI_CLEARCMDKEY((short key,short modifiers)) +SCI_CLEARALLCMDKEYS +</pre> + <p> + There is a default binding of keys to commands in Scintilla which can be overridden with + these messages. To fit the parameters into a message, the first argument contains the key + code in the low word and the key modifiers (possibly shift and control) in the high word. The + key code is from the VK_* enumeration, and the modifiers are a combination of zero or more of + SHIFT_PRESSED and LEFT_CTRL_PRESSED. + </p> + <h3> + Macro Recording + </h3> +<pre> +SCI_STARTRECORD +SCI_STOPRECORD +</pre> + <p> + Starts and stops macro recording mode. + </p> + <h3> + Printing + </h3> +<pre> +EM_FORMATRANGE +</pre> + <p> + On Windows EM_FORMATRANGE can be used to draw the text onto a display context which can + include a printer display context. + </p> + <h3> + Multiple Views + </h3> +<pre> +SCI_GETDOCPOINTER +SCI_SETDOCPOINTER(<unused>,document *pdoc) +</pre> + <p> + This is to allow simple split views of documents. Each Scintilla owns one default document + and has a pointer to a used document. Initially the used document is the default one. The + SCI_GETDOCPOINTER call returns a pointer to the default document. SCI_SETDOCPOINTER sets the + used document. SCI_SETDOCPOINTER(0) restores the use of the default document and should + always be called before closing the Scintilla that owns the current document (to avoid + calling methods on a deleted object). + </p> + <h3> + Folding + </h3> +<pre> +SCI_VISIBLEFROMDOCLINE(int docLine) +SCI_DOCLINEFROMVISIBLE(int displayLine) +SCI_SETFOLDLEVEL(int line, int level) +SCI_GETFOLDLEVEL(int level) +SCI_GETLASTCHILD(int line) +SCI_GETFOLDPARENT(int line) +SCI_SHOWLINES(int lineStart, int lineEnd) +SCI_HIDELINES(int lineStart, int lineEnd) +SCI_GETLINEVISIBLE(int line) +SCI_SETFOLDEXPANDED(int line) +SCI_GETFOLDEXPANDED(int line) +SCI_TOGGLEFOLD(int line) +SCI_ENSUREVISIBLE(int line) +</pre> + <p> + The fundamental operation in folding is making lines invisible or visible. + Line visibility is a property of the view rather than the document so each + view may be displaying a different set of lines. SCI_SHOWLINES and + SCI_HIDELINES show or hide a range of lines. SCI_GETLINEVISIBLE + determines whether a line is visible. When some lines are hidden, then a + particular line in the document may be displayed at a different position to its + document position. SCI_VISIBLEFROMDOCLINE and + SCI_DOCLINEFROMVISIBLE map from document line to display line and + back. + </p> + <p> + Generally the fold points of a document are based on the hierarchical structure + of the contents of the document. In Python, the hierarchy is determined by + indentation and in C++ by brace characters. This hierarchy can be represented + within a Scintilla document object by attaching a numeric level to each line. + The initial level of a file is SC_FOLDLEVELBASE to allow unsigned arithmetic + on levels. + There + are also two bit flags associated with each line. SC_FOLDLEVELWHITEFLAG + indicates that the line is blank and allows to be treated slightly different then its + level may indicate. For example, blank lines should generally not be fold points. + SC_FOLDLEVELHEADERFLAG indicates that the line is a header or fold point. + </p> + <p> + The hierarchy can be navigated just through SCI_GETFOLDLEVEL, but it is + often useful to find the parent of a line (SCI_GETFOLDPARENT) or the line + that is the last child of a line (SCI_GETLASTCHILD). + </p> + <p> + Each fold point may be either expanded, displaying all its child lines, or + contracted, hding all the child lines. This is per view state and can be + manipulated with SCI_SETFOLDEXPANDED and + SCI_GETFOLDEXPANDED. Using SCI_SETFOLDEXPANDED does not + show or hide any lines but only changes a state flag and the margin markers + that show the contractrion state. SCI_TOGGLEFOLD performs the expansion + or contraction of a fold point in the manner normally expected. + </p> + <p> + A hidden line may be hidden because more than one of its parent lines is + contracted. SCI_ENSUREVISIBLE travels up the fold hierarchy, expanding any + contracted folds until it reaches the top level. The line will then be visible. + </p> + <h3> + Long Lines + </h3> +<pre> +SCI_GETEDGECOLUMN +SCI_SETEDGECOLUMN(int column) +SCI_GETEDGEMODE +SCI_SETEDGEMODE(int mode) +SCI_GETEDGECOLOUR +SCI_SETEDGECOLOUR(int colour) +</pre> + <p> + This mechanism marks lines that are longer than a specified length in one of two ways. A + vertical line can be displayed at the specified column number (EDGE_LINE) or characters after + that column can be displayed with a specified background colour (EDGE_BACKGROUND). The + vertical line works well for monospaced fonts but not for proportional fonts which should use + EDGE_BACKGROUND. The defaullt is to not have any form of long line marking (EDGE_NONE). + </p> + <h3> + Lexer + </h3> +<pre> +SCI_SETLEXER(int lexer) +SCI_GETLEXER +SCI_COLOURISE(int start, int end) +SCI_SETPROPERTY(char *key, char *value) +SCI_SETKEYWORDS(int keywordset, char *keywordlist) +</pre> + <p> + If the SciLexer version of Scintilla is used, then lexing support for some programming languages + is included. A particular lexer may be chosen from the SCLEX* enumeration and it is invoked + automatically to dtyle the coument as required. + If the lexer is set to SCLEX_CONTAINER then the container is notified to perform styling + as is the case with the standard Scintilla.DLL version. Styling may be requested for a range + of the document by using SCI_COLOURISE. + </p> + <p> + Settings can be communicated to the lexers using SCI_SETPROPERTY. Currently the "fold" + property is defined for the SCLEX_PYTHON, SCLEX_CPP, and SCLEX_SQL lexers to + set the fold stucture if set to "1". SCLEX_PYTHON understands "tab.timmy.whinge.level" + as a setting that determines how to indicate bad indentation. Many languages style a set of keywords + distinctly from other words. Some languages, such as HTML may contain embedded languages, + VBScript and Javascript are common for HTML. SCI_SETKEYWORDS specifies the keywords + separated by spaces. For HTML, key word set is for HTML, 1 is for Javascript and 2 is for VBScript. + </p> + <h3> + Notifications + </h3> + <p> + Notifications are sent (fired) from the Scintilla control to its container when an event has + occurred that may interest the container. Notifications are sent using the WM_NOTIFY message + with a structure containing information about the event. + </p> +<pre> +SCN_STYLENEEDED(int endstyleneeded) +</pre> + <p> + Before displaying a page or printing, this message is sent to the container. It is a good + opportunity for the container to ensure that syntax styling information for the visible text. + </p> +<pre> +SCN_UPDATEUI +SCN_CHECKBRACE +</pre> + <p> + Either the text or styling of the document has changed or the selection + range has changed. Now would be a good time to update any container UI + elements that depend on document or view state. Was previously called + SCN_CHECKBRACE because a common use is to check whether the caret + is next to a brace and set highlights on this brace and its + corresponding matching brace. + </p> +<pre> +SCN_CHARADDED(int charadded) +</pre> + <p> + Fired when the user types an ordinary text character (as opposed to a command character) + which is entered into the text. Can be used by the container to decide to display a call tip + or auto completion list. + </p> +<pre> +SCN_SAVEPOINTREACHED(int issavepoint) +SCI_SETSAVEPOINT +</pre> + <p> + Sent to the container when the savepoint is entered or left, allowing the container to to + display a dirty indicator and change its menues. The first parameter is 1 when entering the + save point, 0 when leaving. + </p> + <p> + The container tells Scintilla where the save point is by sending the SCI_SETSAVEPOINT + message. + </p> +<pre> +SCN_MODIFYATTEMPTRO +</pre> + <p> + When in read-only mode, this notification is sent to the container should the user try to + edit the document. This can be used to check the document out of a version control system. + </p> +<pre> +SCN_DOUBLECLICK +</pre> + <p> + Mouse button was double clicked in editor. + </p> +<pre> +SCN_KEY +</pre> + <p> + Reports all keys pressed. Used on GTK+ because of some problems with keyboard focus. Not + sent by Windows version. + </p> +<pre> +SCN_MODIFIED +EN_CHANGE +SCI_SETMODEVENTMASK(int eventmask) +</pre> + <p> + SCN_MODIFIED is fired when the document has been changed including changes to both the text + and styling. The notification structure contains information about what changed, how the + change occurred and whether this changed the number of lines in the document. + </p> + <p> + EN_CHANGE is fired when the text of the document has been changed for any reason. This + notification is sent using the WM_COMMAND message as this is the behaviour of the standard + edit control. + </p> + <p> + Both these notifications can be masked by the SCI_SETMODEVENTMASK function which sets which + notification types are sent to the container. For example, a container may decide to see only + notifications about changes to text and not styling changes by calling + SCI_SETMODEVENTMASK(SC_MOD_INSERTTEXT|SC_MOD_DELETETEXT). + </p> +<pre> +SCN_MACRORECORD +</pre> + <p> + Tells the container that an operation is being performed so that the container may choose + to record the fact if it is in a macro recording mode. + </p> +<pre> +SCN_MARGINCLICK +</pre> + <p> + Tells the container that the mouse was clicked inside a margin marked sensitive. + Can be used to perform folding or to place breakpoints. + </p> +<pre> +SCN_NEEDSHOWN +</pre> + <p> + Scintilla has determined that a range of lines that is currently invisible should be made visible. + An example of where this may be needed is if the end of line of a contracted fold point + is deleted. This message is sent to the container in case it wants to make the line + visible in some unusual way such as making the whole document visible. Most containers + will just ensure each line in the range is visible by calling SCI_ENSUREVISIBLE. + </p> + <h3> + Edit messages not supported by Scintilla + </h3> +<pre> +EM_GETWORDBREAKPROC EM_GETWORDBREAKPROCEX +EM_SETWORDBREAKPROC EM_SETWORDBREAKPROCEX +EM_GETWORDWRAPMODE EM_SETWORDWRAPMODE +EM_LIMITTEXT EM_EXLIMITTEXT +EM_SETRECT EM_SETRECTNP +EM_FMTLINES +EM_GETHANDLE EM_SETHANDLE +EM_GETPASSWORDCHAR EM_SETPASSWORDCHAR +EM_SETTABSTOPS +EM_FINDWORDBREAK +EM_GETCHARFORMAT EM_SETCHARFORMAT +EM_GETOLEINTERFACE EM_SETOLEINTERFACE +EM_SETOLECALLBACK +EM_GETPARAFORMAT EM_SETPARAFORMAT +EM_PASTESPECIAL +EM_REQUESTRESIZE +EM_GETBKGNDCOLOR EM_SETBKGNDCOLOR +EM_STREAMIN EM_STREAMOUT +EM_GETIMECOLOR EM_SETIMECOLOR +EM_GETIMEOPTIONS EM_SETIMEOPTIONS +EM_GETOPTIONS EM_SETOPTIONS +EM_GETPUNCTUATION EM_SETPUNCTUATION +EM_GETTHUMB +</pre> + <p> + Scintilla tries to be a superset of the standard windows Edit and Richedit controls wherever + that makes sense. As it is not intended for use in a word processor, some edit messages can + not be sensibly handled. Unsupported messages have no effect. + </p> +<pre> +EM_GETEVENTMASK +EM_SETEVENTMASK +EM_DISPLAYBAND +EM_SETTARGETDEVICE +</pre> + <p> + To support printing better and control the notifications fired, these messages should be + supported but are not yet. + </p> + <h3> + Building Scintilla on Windows + </h3> + <p> + Scintilla and SciTE have been developed using Mingw32 GCC 2.9.5 and most testing has + occurred on executables produced by this compiler. It may also be compiled with Visual C++ + which leads to smaller executables. It will no longer build with the older release of Mingw32 + EGCS 1.1.2 which used a different set of Windows headers to GCC 2.9.5. + </p> + <p> + To compile with GCC, use make on the "makefile" file.<br /> + </p> + <p> + To compile with VC++, use nmake on the "makefile_vc" file. + </p> + <p> + To compile with Borland C++ or C++ Builder, use make on the "makefile_bor" file. + </p> + <p> + Scintilla can also be linked into an application statically. To do this, the symbol + STATIC_BUILD should be defined and the function Scintilla_RegisterClasses called to + initialise Scintilla. The Sc1.exe target in the makefile demonstrates building a statically + linked version of SciTE. + </p> + <h3> + Building Scintilla with GTK+ on Linux + </h3> + <p> + On Linux, Scintilla and SciTE have been built with GCC and linked with GTK+ 1.20. GTK+ 1.0x + will not work (and when it did it was very slow). The current make file only supports static + linking between SciTE and Scintilla. The Makefile_gtk file is used to build SciTE, it can be + invoked as:<br /> + make -f Makefile_gtk<br /> + The SciTEGTK.properties file is better than the SciTEGlobal.properties for use on Linux/GTK+ + as it specifies fonts that are likely to be installed. Under Linux, SciTE reads its + SciTEGlobal.properties file from the user's home directory. + </p> + </body> +</html> + diff --git a/doc/ScintillaDownload.html b/doc/ScintillaDownload.html new file mode 100644 index 000000000..b67997c3b --- /dev/null +++ b/doc/ScintillaDownload.html @@ -0,0 +1,83 @@ +<?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 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">Download + Scintilla and SciTE</font></a> + </td> + </tr> + </table> + <table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0"> + <tr> + <td> + <font size="4"> <a href="SciTE122.zip">Windows</a> <a href="SciTE.tgz"> + GTK+/Linux</a> </font> + </td> + </tr> + </table> + <h2> + Download. + </h2> + <p> + The <a href="License.txt">license</a> for using Scintilla is similar to that of Python + containing very few restrictions. + </p> + <h3> + Release 1.22 + </h3> + <h4> + Windows + </h4> + <p> + You can <a href="SciTE122.zip">download a ZIP file (410K)</a> containing the C++ source code + and executables for Scintilla and SciTE. While a release version, it is likely that there are + still bugs in the code that could lead to loss of data. Please make sure you save often and + back up your source code.<br /> + After downloading the file, unzip it, and run SciTE.EXE. The files required to run SciTE are + SciTE.EXE, Scintilla.DLL, and SciTEGlobal.properties and these are best located in one + directory on the path. + </p> + <p> + A <a href="Sc1.exe">single file executable called Sc1 (230K)</a> does not need any DLL or + properties files as these are linked into the executable. You may still create properties + files if you wish. + </p> + <h4> + Linux and Linux compatible + </h4> + <p> + There is a <a href="SciTE.tgz">GTK+/Linux</a> version (250K). In the Linux tradition, this + download only contains source code and documentation and it is exactly the same source code + as in the Windows version. To build it, you will have to have a c++ compiler (I use gcc + 2.95.2, but older gcc or egcs should do just as well) and GTK+ 1.2.x installed (tested on + 1.2.6).<br /> + The Makefile_gtk file is used to build SciTE, it can be invoked as:<br /> + make -f Makefile_gtk<br /> + The SciTEGTK.properties file is better than the SciTEGlobal.properties for use on Linux/GTK+ + as it specifies fonts that are likely to be installed. Under Linux, SciTE reads its + SciTEGlobal.properties file from the user's home directory. The download file is available + under the name <a href="SciTETGZ.zip"> SciTETGZ.zip</a> in case your browser does not want to + download a .tgz file. Despite the .zip extension, this is still a tarred gzipped file. + </p> + <p> + Previous versions can be downloaded from the <a href="ScintillaHistory.html">history + page</a>. + </p> + </body> +</html> + diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html new file mode 100644 index 000000000..9d8200d29 --- /dev/null +++ b/doc/ScintillaHistory.html @@ -0,0 +1,627 @@ +<?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 + and SciTE</font></a> + </td> + </tr> + </table> + <h2> + History of Scintilla and SciTE + </h2> + <h3> + Contributors + </h3> + <p> + Thanks to all the people that have contributed patches, bug reports and suggestions. + </p> + <p> + Source code and documentation have been contributed by + </p> + <ul> + <li> + Atsuo Ishimoto + </li> + <li> + Mark Hammond + </li> + <li> + Francois Le Coguiec + </li> + <li> + Dale Nagata + </li> + <li> + Ralf Reinhardt + </li> + <li> + Philippe Lhoste + </li> + <li> + Andrew McKinlay + </li> + <li> + Stephan R. A. Deibel + </li> + <li> + Hans Eckardt + </li> + <li> + Vassili Bourdo + </li> + <li> + Maksim Lin + </li> + <li> + Robin Dunn + </li> + <li> + John Ehresman + </li> + <li> + Steffen Goeldner + </li> + <li> + Deepak S. + </li> + </ul> + <h3> + <a href="SciTE122.zip">Release 1.22</a> + </h3> + <ul> + <li> + Released on 27 February 2000. + </li> + <li> + wxWindows platform defined. + Implementation for wxWindows will be available separately + from main Scintilla distribution. + </li> + <li> + Line folding in Scintilla. + </li> + <li> + SciTE performs syntax directed folding for C/C++/Java/Javascript and for Python. + </li> + <li> + Optional macro recording support. + </li> + <li> + User properties file (SciTEUser.properties) allows for customisation by the user + that is not overwritten with each installation of SciTE. + </li> + <li> + Python lexer detects and highlights inconsistent indentation. + </li> + <li> + Margin API made more orthogonal.SCI_SETMARGINWIDTH and SCI_SETLINENUMBERWIDTH + are deprecated in favour of this new API. + </li> + <li> + Margins may be made sensitive to forward mouse click events to container. + </li> + <li> + SQL lexer and styles included. + </li> + <li> + Perl lexer handles regular expressions better. + </li> + <li> + Caret policy determines how closely caret is tracked by visible area. + </li> + <li> + New marker shapes: arrow pointing down, plus and minus. + </li> + <li> + Optionally display full path in title rather than just file name. + </li> + <li> + Container is notified when Scintilla gains or loses focus. + </li> + <li> + SciTE handles focus in a more standard way and applies the main + edit commands to the focused pane. + </li> + <li> + Container is notified when Scintilla determines that a line needs to be made visible. + </li> + <li> + Document watchers receive notification when document about to be deleted. + </li> + <li> + Document interface allows access to list of watchers. + </li> + <li> + Line end determined correctly for lines ending with only a '\n'. + </li> + <li> + Search variant that searches form current selection and sets selection. + </li> + <li> + SciTE understands format of diagnostic messages from WScript. + </li> + <li> + SciTE remembers top line of window for each file in MRU list so switching to a recent file + is more likeley to show the same text as when the file was previously visible. + </li> + <li> + Document reference count now initialised correctly. + </li> + <li> + Setting a null document pointer creates an empty document. + </li> + <li> + WM_GETTEXT can no longer overrun buffer. + </li> + <li> + Polygon drawing bug fixed on GTK+. + </li> + <li> + Java and Javascript lexers merged into C++ lexer. + </li> + <li> + C++ lexer indicates unterminated strings by colouring the end of the line + rather than changing the rest of the file to string style. This is less + obtrusive and helps the folding. + </li> + </ul> + <h3> + <a href="SciTE121.zip">Release 1.21</a> + </h3> + <ul> + <li> + Released on 2 February 2000. + </li> + <li> + Blank margins on left and right side of text. + </li> + <li> + SCN_CHECKBRACE renamed SCN_UPDATEUI and made more efficient. + </li> + <li> + SciTE source code refactored into platform independent and platform specific classes. + </li> + <li> + XML and Perl subset lexers in SciTE. + </li> + <li> + Large improvement to lexing speed. + </li> + <li> + A new subsystem, 2, allows use of ShellExec on Windows. + </li> + <li> + Borland compatible makefile. + </li> + <li> + Status bar showing caret position in GTK+ version of SciTE. + </li> + <li> + Bug fixes to selection drawing when part of selection outside window, mouse release over + scroll bars, and scroll positioning after deletion. + </li> + </ul> + <h3> + <a href="SciTE120.zip">Release 1.2</a> + </h3> + <ul> + <li> + Released on 21 January 2000. + </li> + <li> + Multiple views of one document. + </li> + <li> + Rectangular selection, cut, copy, paste, drag and drop. + </li> + <li> + Long line indication. + </li> + <li> + Reverse searching + </li> + <li> + Line end conversion. + </li> + <li> + Generic autocompletion and calltips in SciTE. + </li> + <li> + Call tip background colour can be set. + </li> + <li> + SCI_MARKERPREV for moving to a previous marker. + </li> + <li> + Caret kept more within window where possible. + </li> + </ul> + <h3> + <a href="SciTE115.zip">Release 1.15</a> + </h3> + <ul> + <li> + Released on 15 December 1999. + </li> + <li> + Brace highlighting and badlighting (for mismatched braces). + </li> + <li> + Visible line ends. + </li> + <li> + Multiple line call tips. + </li> + <li> + Printing now works from SciTE on Windows. + </li> + <li> + SciTE has a global "*" lexer style that is used as the basis for all the lexers' styles. + </li> + <li> + Fixes some warnings on GTK+ 1.2.6. + </li> + <li> + Better handling of modal dialogs on GTK+. + </li> + <li> + Resize handle drawn on pane splitter in SciTE on GTK+ so it looks more like a regular GTK+ + *paned widget. + </li> + <li> + SciTE does not place window origin offscreen if no properties file found on GTK+. + </li> + <li> + File open filter remembered in SciTE on Windows. + </li> + <li> + New mechanism using style numbers 32 to 36 standardises the setting of styles for brace + highlighting, brace badlighting, line numbers, control characters and the default style. + </li> + <li> + Old messages SCI_SETFORE .. SCI_SETFONT have been replaced by the default style 32. The old + messages are deprecated and will disappear in a future version. + </li> + </ul> + <h3> + <a href="SciTE114.zip">Release 1.14</a> + </h3> + <ul> + <li> + Released on 20 November 1999. + </li> + <li> + Fixes a scrolling bug reported on GTK+. + </li> + </ul> + <h3> + <a href="SciTE113.zip">Release 1.13</a> + </h3> + <ul> + <li> + Released on 18 November 1999. + </li> + <li> + Fixes compilation problems with the mingw32 GCC 2.95.2 on Windows. + </li> + <li> + Control characters are now visible. + </li> + <li> + Performance has improved, particularly for scrolling. + </li> + <li> + Windows RichEdit emulation is more accurate. This may break client code that uses these + messages: EM_GETLINE, EM_GETLINECOUNT, EM_EXGETSEL, EM_EXSETSEL, EM_EXLINEFROMCHAR, + EM_LINELENGTH, EM_LINEINDEX, EM_CHARFROMPOS, EM_POSFROMCHAR, and EM_GETTEXTRANGE. + </li> + <li> + Menus rearranged and accelerator keys set for all static items. + </li> + <li> + Placement of space indicators in view whitespace mode is more accurate with some fonts. + </li> + </ul> + <h3> + <a href="SciTE112.zip">Release 1.12</a> + </h3> + <ul> + <li> + Released on 9 November 1999. + </li> + <li> + Packaging error in 1.11 meant that the compilation error was not fixed in that release. + Linux/GTK+ should compile with GCC 2.95 this time. + </li> + </ul> + <h3> + <a href="SciTE111.zip">Release 1.11</a> + </h3> + <ul> + <li> + Released on 7 November 1999. + </li> + <li> + Fixed a compilation bug in ScintillaGTK.cxx. + </li> + <li> + Added a README file to explain how to build. + </li> + <li> + GTK+/Linux downloads now include documentation. + </li> + <li> + Binary only Sc1.EXE one file download for Windows. + </li> + </ul> + <h3> + <a href="SciTE110.zip">Release 1.1</a> + </h3> + <ul> + <li> + Released on 6 November 1999. + </li> + <li> + Major restructuring for better modularity and platform independence. + </li> + <li> + Inter-application drag and drop. + </li> + <li> + Printing support in Scintilla on Windows. + </li> + <li> + Styles can select colouring to end of line. This can be used when a file contains more than + one language to differentiate between the areas in each language. An example is the HTML + + JavaScript styling in SciTE. + </li> + <li> + Actions can be grouped in the undo stack, so they will be undone together. This grouping is + hierarchical so higher level actions such as replace all can be undone in one go. Call to + discover whether there are any actions to redo. + </li> + <li> + The set of characters that define words can be changed. + </li> + <li> + Markers now have identifiers and can be found and deleted by their identifier. The empty + marker type can be used to make a marker that is invisible and which is only used to trace + where a particular line moves to. + </li> + <li> + Double click notification. + </li> + <li> + HTML styling in SciTE also styles embedded JavaScript. + </li> + <li> + Additional tool commands can be added to SciTE. + </li> + <li> + SciTE option to allow reloading if changed upon application activation and saving on + application deactivation. Not yet working on GTK+ version. + </li> + <li> + Entry fields in search dialogs remember last 10 user entries. Not working in all cases in + Windows version. + </li> + <li> + SciTE can save a styled copy of the current file in HTML format. As SciTE does not yet + support printing, this can be used to print a file by then using a browser to print the + HTML file. + </li> + </ul> + <h3> + <a href="SciTE102.zip">Release 1.02</a> + </h3> + <ul> + <li> + Released on 1 October 1999. + </li> + <li> + GTK+ version compiles with GCC 2.95. + </li> + <li> + Properly deleting objects when window destroyed under GTK+. + </li> + <li> + If the selection is not empty backspace deletes the selection. + </li> + <li> + Some X style middle mouse button handling for copying the primary selection to and from + Scintilla. Does not work in all cases. + </li> + <li> + HTML styling in SciTE. + </li> + <li> + Stopped dirty flag being set in SciTE when results pane modified. + </li> + </ul> + <h3> + <a href="SciTE101.zip">Release 1.01</a> + </h3> + <ul> + <li> + Released on 28 September 1999. + </li> + <li> + Better DBCS support on Windows including IME. + </li> + <li> + Wheel mouse support for scrolling and zooming on Windows. Zooming with Ctrl+KeypadPlus and + Ctrl+KeypadMinus. + </li> + <li> + Performance improvements especially on GTK+. + </li> + <li> + Caret blinking and settable colour on both GTK+ and Windows. + </li> + <li> + Drag and drop within a Scintilla window. On Windows, files can be dragged into SciTE. + </li> + </ul> + <h3> + <a href="SciTE100.zip">Release 1.0</a> + </h3> + <ul> + <li> + Released on 17 May 1999. + </li> + <li> + Changed name of "Tide" to "SciTE" to avoid clash with a TCL based IDE. "SciTE" is a + SCIntilla based Text Editor and is Latin meaning something like "understanding in a neat + way" and is also an Old English version of the word "shit". + </li> + <li> + There is a SCI_AUTOCSTOPS message for defining a string of characters that will stop + autocompletion mode. Autocompletion mode is cancelled when any cursor movement occurs apart + from backspace. + </li> + <li> + GTK+ version now splits horizontally as well as vertically and all dialogs cancel when the + escape key is pressed. + </li> + </ul> + <h3> + <a href="Tide92.zip">Beta release 0.93</a> + </h3> + <ul> + <li> + Released on 12 May 1999. + </li> + <li> + A bit more robust than 0.92 and supports SCI_MARKERNEXT message. + </li> + </ul> + <h3> + <a href="Tide92.zip">Beta release 0.92</a> + </h3> + <ul> + <li> + Released on 11 May 1999. + </li> + <li> + GTK+ version now contains all features of Windows version with some very small differences. + Executing programs works much better now. + </li> + <li> + New palette code to allow more colours to be displayed in 256 colour screen modes. A line + number column can be displayed to the left of the selection margin. + </li> + <li> + The code that maps from line numbers to text positions and back has been completely + rewritten to be faster, and to allow markers to move with the text. + </li> + </ul> + <h3> + <a href="Tide91.zip">Beta release 0.91</a> + </h3> + <ul> + <li> + Released on 30 April 1999, containing fixes to text measuring to make Scintilla work better + with bitmap fonts. Also some small fixes to make compiling work with Visual C++. + </li> + </ul> + <h3> + <a href="Tide90.zip">Beta release 0.90</a> + </h3> + <ul> + <li> + Released on 29 April 1999, containing working GTK+/Linux version. + </li> + <li> + The Java, C++ and Python lexers recognise operators as distinct from default allowing them + to be highlighted. + </li> + </ul> + <h3> + <a href="Tide82.zip">Beta release 0.82</a> + </h3> + <ul> + <li> + Released on 1 April 1999, to fix a problem with handling the Enter key in PythonWin. Also + fixes some problems with cmd key mapping. + </li> + </ul> + <h3> + <a href="Tide82.zip">Beta release 0.81</a> + </h3> + <ul> + <li> + Released on 30th March 1999, containing bug fixes and a few more features. + </li> + <li> + Static linking supported and Tidy.EXE, a statically linked version of Tide.EXE. Changes to + compiler flags in the makefiles to optimise for size. + </li> + <li> + Scintilla supports a 'savepoint' in the undo stack which can be set by the container when + the document is saved. Notifications are sent to the container when the savepoint is + entered or left, allowing the container to to display a dirty indicator and change its + menues. + </li> + <li> + When Scintilla is set to read-only mode, a notification is sent to the container should the + user try to edit the document. This can be used to check the document out of a version + control system. + </li> + <li> + There is an API for setting the appearence of indicators. + </li> + <li> + The keyboard mapping can be redefined or removed so it can be implemented completely by the + container. All of the keyboard commands are now commands which can be sent by the + container. + </li> + <li> + A home command like Visual C++ with one hit going to the start of the text on the line and + the next going to the left margin is available. I do not personally like this but my + fingers have become trained to it by much repetition. + </li> + <li> + SCI_MARKERDELETEALL has an argument in wParam which is the number of the type marker to + delete with -1 performing the old action of removing all marker types. + </li> + <li> + Tide now understands both the file name and line numbers in error messages in most cases. + </li> + <li> + Tide remembers the current lines of files in the recently used list. + </li> + <li> + Tide has a Find in Files command. + </li> + </ul> + <h3> + Beta release 0.80 + </h3> + <ul> + <li> + This was the first public release on 14th March 1999, containing a mostly working Win32 + Scintilla DLL and Tide EXE. + </li> + </ul> + <h3> + Beta releases of SciTE were called Tide + </h3> + </body> +</html> + diff --git a/doc/ScintillaRelated.html b/doc/ScintillaRelated.html new file mode 100644 index 000000000..3a6bfec09 --- /dev/null +++ b/doc/ScintillaRelated.html @@ -0,0 +1,113 @@ +<?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 + and SciTE</font></a> + </td> + </tr> + </table> + <h2> + Related Sites + </h2> + <h3> + Projects using Scintilla + </h3> + <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> + <p> + <a href="http://www.archaeopteryx.com/opensource/pyscintilla.html"> A Python binding of the + GTK+ version of Scintilla</a>, that can be used with pygtk. + </p> + <h3> + Editing Components + </h3> + <p> + <a href="http://www.gjt.org/~sp/jedit.html">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.pn.org/">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://eccentrica.org/gabr/mw/mwedit.htm">mwEdit</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> + <h3> + Paper Documents + </h3> + <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 Mingw32 version of GCC. <a + href="http://www.xraylith.wisc.edu/~khan/software/gnu-win32/"> Mumit Khan's GNU Win32 + site</a> is a good starting point for GCC and Mingw32 information and downloads. + </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://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.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> + Coding frenzy musical inspiration provided by the <a + href="http://www.users.wineasy.se/FlowerKings/index.htm">Flower Kings</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">Virtual Tours</a> ;). + </p> + </body> +</html> + diff --git a/doc/ScintillaToDo.html b/doc/ScintillaToDo.html new file mode 100644 index 000000000..67f714ba6 --- /dev/null +++ b/doc/ScintillaToDo.html @@ -0,0 +1,124 @@ +<?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 + and SciTE</font></a> + </td> + </tr> + </table> + <h2> + Bugs and To Do List + </h2> + <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. + </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> + <h3> + SciTE Bugs + </h3> + <p> + There has been a report of SciTE exiting as soon as the mouse is moved over it when launched + Start | Run. I have seen this once but can not find a way to reproduce it. + </p> + <p> + One person has seen excessive waits (20 seconds) when using the file open dialog and + changing to the top directory. + </p> + <h3> + Windows Version Bugs + </h3> + <p> + No memory for input fields in find and replace dialogs. + </p> + <h3> + GTK+ Version Bugs + </h3> + <p> + No DBCS support. + </p> + <h3> + Scintilla To Do + </h3> + <p> + Simple pattern based styling. + </p> + <p> + Line wrapping. + </p> + <p> + Different height lines based upon tallest text on the line rather than on the tallest style + possible. + </p> + <p> + COM control version on Windows + </p> + <p> + Make GTK+ version be more consistent with other GTK+ widgets. + </p> + <p> + Printing support on GTK+. Maybe Postscript output or use Gnome? + </p> + <p> + Unicode (UCS 2). + </p> + <p> + Stream folding which could be used to fold up the contents of HTML elements. + </p> + <h3> + SciTE To Do + </h3> + <p> + More lexers: IDL, and Delphi. Make the subset Perl lexer understand more Perl. + </p> + <p> + Regular expressions in find functions. + </p> + <p> + Smart indenting, based on the file syntax. + </p> + <p> + Printing on GTK+. + </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. + </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> + diff --git a/doc/ScintillaUsage.html b/doc/ScintillaUsage.html new file mode 100644 index 000000000..e0ffb0bfc --- /dev/null +++ b/doc/ScintillaUsage.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> + diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 000000000..d0d59c0b8 --- /dev/null +++ b/doc/index.html @@ -0,0 +1,147 @@ +<?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="20000227" /> + <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.22<br /> + Site last modified February 27 2000</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="SciRest.jpg" height="150" width="1200" alt="Sci Rest" /> + </td> + </tr> + </table> + <table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="6" border="0"> + <tr> + <td width="100%"> + <font color="#FFCC99" size="4"> Version 1.2 is a major release featuring multiple views + of one document and rectangular selection.</font> + </td> + </tr> + <tr> + <td width="100%"> + <font color="#FFCC99" size="3"> Version 1.21 fixes bugs, enhances performance, and adds + margins to Scintilla and an XML lexer to SciTE.</font> + </td> + </tr> + <tr> + <td width="100%"> + <font color="#FFCC99" size="3"> Version 1.22 adds line folding, macro recording and + a large number of smaller features.</font> + </td> + </tr> + </table> + <table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0"> + <tr> + <td> + <font size="4"> <a href="SciTEImage.html">Screenshot</a> <a + href="ScintillaDownload.html">Download</a> <a href="ScintillaDoc.html"> + Documentation</a> <a href="ScintillaToDo.html">Bugs</a> <a + href="SciTEDoc.html">SciTE</a> <a href="ScintillaHistory.html"> + History</a> <a href="ScintillaRelated.html">Related</a> </font> + </td> + </tr> + </table> + <p> + <a href="ScintillaDoc.html">Scintilla</a> is a free source code editing component. 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.<br /> + It comes with complete source code and may be used in any free project or commercial + product. + </p> + <p> + <a href="SciTEDoc.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 4.2, 6.1 and Solaris with GTK+ 1.2.0. <a href="SciTEImage.html">Here is a screenshot of + SciTE.</a><br /> + </p> + <p> + You can <a href="ScintillaDownload.html">download Scintilla and SciTE.</a> + </p> + <p> + <a href="ScintillaRelated.html">Related sites.</a> + </p> + <p> + <a href="ScintillaToDo.html">Bugs and To Do list.</a> + </p> + <p> + <a href="ScintillaHistory.html">History and contribution credits.</a> + </p> + <p> + The <a href="Future.html">Future Features of Scintilla</a> are canvassed. Please tell me + what you want and don't want. + </p> + <p> + You can write to me, <a href="mailto:neilh@scintilla.org">Neil Hodgson</a>, at + neilh@scintilla.org.<br /> + There is a + <a href="https://sourceforge.net/mail/?group_id=2439">scintilla-interest</a> + mailing list, + for discussion of Scintilla and SciTE and related projects, their bugs and future features. + It is unlikely that there will be a lot of + traffic in scintilla-interest, averaging less than 20 messages per week. <br /> + </p> +<script type="text/javascript" language="JavaScript"> +<!-- +//document.write(window.location); +document.write('There is a <a href="https://sourceforge.net/project/?group_id=2439">Scintilla project page<\/a>'); +document.write(' hosted on '); +var loc = '' + window.location +if (loc.indexOf('http:') != -1) { + 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> + diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx new file mode 100644 index 000000000..e074aed17 --- /dev/null +++ b/gtk/PlatGTK.cxx @@ -0,0 +1,751 @@ +// Scintilla source code edit control +// PlatGTK.cxx - implementation of platform facilities on GTK+/Linux +// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org> +// The License.txt file describes the conditions under which this software may be distributed. + +#include <string.h> +#include <stdio.h> + +#include <gtk/gtk.h> + +#include "Platform.h" + +#include "Scintilla.h" + +#define LOWORD(x) (x & 0xffff) +#define HIWORD(x) (x >> 16) + +Point Point::FromLong(long lpoint) { + return Point(LOWORD(lpoint), HIWORD(lpoint)); +} + +static GdkColor ColourfromRGB(unsigned int red, unsigned int green, unsigned int blue) { + GdkColor co; + co.red = red * (65535 / 255); + co.green = green * (65535 / 255); + co.blue = blue * (65535 / 255); + // the pixel value indicates the index in the colourmap of the colour. + // it is simply a combination of the RGB values we set earlier + co.pixel = (gulong)(red * 65536 + green * 256 + blue); + return co; +} + +Colour::Colour(long lcol) { + unsigned int red = lcol & 0xff; + unsigned int green = (lcol >> 8) & 0xff; + unsigned int blue = lcol >> 16; + co = ColourfromRGB(red, green, blue); +} + +Colour::Colour(unsigned int red, unsigned int green, unsigned int blue) { + co = ColourfromRGB(red, green, blue); +} + +bool Colour::operator==(const Colour &other) const { + return + co.red == other.co.red && + co.green == other.co.green && + co.blue == other.co.blue; +} + +unsigned int Colour::GetRed() { + return co.red; +} + +unsigned int Colour::GetGreen() { + return co.green; +} + +unsigned int Colour::GetBlue() { + return co.blue; +} + +long Colour::AsLong() const { + unsigned int red = co.red * 255 / 65535; + unsigned int green = co.green * 255 / 65535; + unsigned int blue = co.blue * 255 / 65535; + return (red + green*256 + blue*65536); +} + +Palette::Palette() { + used = 0; + allowRealization = false; + allocatedPalette = 0; + allocatedLen = 0; +} + +Palette::~Palette() { + Release(); +} + +void Palette::Release() { + used = 0; + delete []allocatedPalette; + allocatedPalette = 0; + allocatedLen = 0; +} + +// This method either adds a colour to the list of wanted colours (want==true) +// or retrieves the allocated colour back to the ColourPair. +// This is one method to make it easier to keep the code for wanting and retrieving in sync. +void Palette::WantFind(ColourPair &cp, bool want) { + if (want) { + for (int i=0; i < used; i++) { + if (entries[i].desired == cp.desired) + return; + } + + if (used < numEntries) { + entries[used].desired = cp.desired; + entries[used].allocated = cp.desired; + used++; + } + } else { + for (int i=0; i < used; i++) { + if (entries[i].desired == cp.desired) { + cp.allocated = entries[i].allocated; + return; + } + } + cp.allocated = cp.desired; + } +} + +void Palette::Allocate(Window &w) { + if (allocatedPalette) { + gdk_colormap_free_colors(gtk_widget_get_colormap(w.GetID()), + allocatedPalette, allocatedLen); + delete []allocatedPalette; + allocatedPalette = 0; + allocatedLen = 0; + } + allocatedPalette = new GdkColor[used]; + gboolean *successPalette = new gboolean[used]; + if (allocatedPalette) { + allocatedLen = used; + int iPal = 0; + for (iPal = 0; iPal < used; iPal++) { + allocatedPalette[iPal] = entries[iPal].desired.co; + } + gdk_colormap_alloc_colors(gtk_widget_get_colormap(w.GetID()), + allocatedPalette, allocatedLen, FALSE, TRUE, + successPalette); + for (iPal = 0; iPal < used; iPal++) { + entries[iPal].allocated.co = allocatedPalette[iPal]; + } + } + delete []successPalette; +} + +Font::Font() : id(0) {} + + +Font::~Font() {} + + +void Font::Create(const char *faceName, int size, bool bold, bool italic) { + Release(); + char fontspec[300]; + fontspec[0] = '\0'; + strcat(fontspec, "-*-"); + strcat(fontspec, faceName); + if (bold) + strcat(fontspec, "-bold"); + else + strcat(fontspec, "-medium"); + if (italic) + strcat(fontspec, "-i"); + else + strcat(fontspec, "-r"); + strcat(fontspec, "-*-*-*"); + char sizePts[100]; + sprintf(sizePts, "-%0d", size * 10); + strcat(fontspec, sizePts); + strcat(fontspec, "-*-*-*-*-*-*"); + id = gdk_font_load(fontspec); + if (!id) { + // Font not available so substitute a reasonable code font + // iso8859 appears to only allow western characters. + id = gdk_font_load("*-*-*-*-*-*-*-*-*-*-*-*-iso8859-*"); + } +} + +void Font::Release() { + if (id) + gdk_font_unref(id); + id = 0; +} + +Surface::Surface() : drawable(0), gc(0), ppixmap(0), +x(0), y(0), inited(false), createdGC(false) {} + + +Surface::~Surface() { + Release(); +} + +void Surface::Release() { + drawable = 0; + if (createdGC) { + createdGC = false; + gdk_gc_unref(gc); + } + gc = 0; + if (ppixmap) + gdk_pixmap_unref(ppixmap); + ppixmap = 0; + x = 0; + y = 0; + inited = false; + createdGC = false; +} + +bool Surface::Initialised() { + return inited; +} + +void Surface::Init() { + Release(); + inited = true; +} + +void Surface::Init(GdkDrawable *drawable_) { + Release(); + drawable = drawable_; + gc = gdk_gc_new(drawable_); + createdGC = true; + inited = true; +} + +void Surface::InitPixMap(int width, int height, Surface *surface_) { + Release(); + if (height > 0 && width > 0) + ppixmap = gdk_pixmap_new(surface_->drawable, width, height, -1); + drawable = ppixmap; + gc = gdk_gc_new(surface_->drawable); + createdGC = true; + inited = true; +} + +void Surface::PenColour(Colour fore) { + if (gc) + gdk_gc_set_foreground(gc, &fore.co); +} + +int Surface::LogPixelsY() { + return 72; +} + +void Surface::MoveTo(int x_, int y_) { + x = x_; + y = y_; +} + +void Surface::LineTo(int x_, int y_) { + gdk_draw_line(drawable, gc, + x, y, + x_, y_); + x = x_; + y = y_; +} + +void Surface::Polygon(Point *pts, int npts, Colour fore, + Colour back) { + // Nasty casts works because Point is exactly same as GdkPoint + // Oh no it doesn't... + GdkPoint gpts[20]; + if (npts < (sizeof(gpts)/sizeof(gpts[0]))) { + for (int i=0;i<npts;i++) { + gpts[i].x = pts[i].x; + gpts[i].y = pts[i].y; + } + PenColour(back); + //gdk_draw_polygon(drawable, gc, 1, + // reinterpret_cast<GdkPoint *>(pts), npts); + gdk_draw_polygon(drawable, gc, 1, gpts, npts); + PenColour(fore); + gdk_draw_polygon(drawable, gc, 0, gpts, npts); + } +} + +void Surface::RectangleDraw(PRectangle rc, Colour fore, Colour back) { + if (gc && drawable) { + PenColour(back); + gdk_draw_rectangle(drawable, gc, 1, + rc.left, rc.top, + rc.right - rc.left + 1, rc.bottom - rc.top + 1); + PenColour(fore); + gdk_draw_rectangle(drawable, gc, 0, + rc.left, rc.top, + rc.right - rc.left + 1, rc.bottom - rc.top + 1); + } +} + +void Surface::FillRectangle(PRectangle rc, Colour back) { + // GTK+ rectangles include their lower and right edges + rc.bottom--; + rc.right--; + PenColour(back); + if (drawable) { + gdk_draw_rectangle(drawable, gc, 1, + rc.left, rc.top, + rc.right - rc.left + 1, rc.bottom - rc.top + 1); + } +} + +void Surface::FillRectangle(PRectangle rc, Surface &surfacePattern) { + if (surfacePattern.drawable) { + // Tile pattern over rectangle + // Currently assumes 8x8 pattern + int widthPat = 8; + int heightPat = 8; + for (int xTile = rc.left; xTile < rc.right; xTile += widthPat) { + int widthx = (xTile + widthPat > rc.right) ? rc.right - xTile : widthPat; + for (int yTile = rc.top; yTile < rc.bottom; yTile += heightPat) { + int heighty = (yTile + heightPat > rc.bottom) ? rc.bottom - yTile : heightPat; + gdk_draw_pixmap(drawable, + gc, + surfacePattern.drawable, + 0, 0, + xTile, yTile, + widthx, heighty); + } + } + } else { + // Something is wrong so try to show anyway + // Shows up black because colour not allocated + FillRectangle(rc, Colour(0xff, 0, 0)); + } +} + +void Surface::RoundedRectangle(PRectangle rc, Colour fore, Colour back) { + if (((rc.right - rc.left) > 4) && ((rc.bottom - rc.top) > 4)) { + // Approximate a round rect with some cut off corners + Point pts[] = { + Point(rc.left + 2, rc.top), + Point(rc.right - 2, rc.top), + Point(rc.right, rc.top + 2), + Point(rc.right, rc.bottom - 2), + Point(rc.right - 2, rc.bottom), + Point(rc.left + 2, rc.bottom), + Point(rc.left, rc.bottom - 2), + Point(rc.left, rc.top + 2), + }; + Polygon(pts, sizeof(pts) / sizeof(pts[0]), fore, back); + } else { + RectangleDraw(rc, fore, back); + } +} + +void Surface::Ellipse(PRectangle rc, Colour fore, Colour back) { + PenColour(back); + gdk_draw_arc(drawable, gc, 1, + rc.left, rc.top, + rc.right - rc.left, rc.bottom - rc.top, + 0, 32767); + PenColour(fore); + gdk_draw_arc(drawable, gc, 0, + rc.left, rc.top, + rc.right - rc.left, rc.bottom - rc.top, + 0, 32767); +} + +void Surface::Copy(PRectangle rc, Point from, Surface &surfaceSource) { + if (surfaceSource.drawable) { + gdk_draw_pixmap(drawable, + gc, + surfaceSource.drawable, + from.x, from.y, + rc.left, rc.top, + rc.right - rc.left, rc.bottom - rc.top); + } +} + +void Surface::DrawText(PRectangle rc, Font &font_, int ybase, const char *s, int len, + Colour fore, Colour back) { + FillRectangle(rc, back); + PenColour(fore); + if (gc && drawable) + gdk_draw_text(drawable, font_.id, gc, rc.left, ybase, s, len); +} + +// On GTK+, exactly same as DrawText +void Surface::DrawTextClipped(PRectangle rc, Font &font_, int ybase, const char *s, int len, + Colour fore, Colour back) { + FillRectangle(rc, back); + PenColour(fore); + if (gc && drawable) + gdk_draw_text(drawable, font_.id, gc, rc.left, ybase, s, len); +} + +void Surface::MeasureWidths(Font &font_, const char *s, int len, int *positions) { + int totalWidth = 0; + for (int i=0;i<len;i++) { + int width = gdk_char_width(font_.id, s[i]); + totalWidth += width; + positions[i] = totalWidth; + } +} + +int Surface::WidthText(Font &font_, const char *s, int len) { + if (font_.id) + return gdk_text_width(font_.id, s, len); + else + return 1; +} + +int Surface::WidthChar(Font &font_, char ch) { + return gdk_char_width(font_.id, ch); +} + +// Three possible strategies for determining ascent and descent of font: +// 1) Call gdk_string_extents with string containing all letters, numbers and punctuation. +// 2) Use the ascent and descent fields of GdkFont. +// 3) Call gdk_string_extents with string as 1 but also including accented capitals. +// Smallest values given by 1 and largest by 3 with 2 in between. +// Techniques 1 and 2 sometimes chop off extreme portions of ascenders and +// descenders but are mostly OK except for accented characters like Å which are +// rarely used in code. + +// This string contains a good range of characters to test for size. +const char largeSizeString[]= "ÂÃÅÄ `~!@#$%^&*()-_=+\\|[]{};:\"\'<,>.?/1234567890" + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; +const char sizeString[]= "`~!@#$%^&*()-_=+\\|[]{};:\"\'<,>.?/1234567890" + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + +int Surface::Ascent(Font &font_) { +#ifdef FAST_WAY + return font_.id->ascent; +#else + gint lbearing; + gint rbearing; + gint width; + gint ascent; + gint descent; + + gdk_string_extents(font_.id, sizeString, + &lbearing, &rbearing, &width, &ascent, &descent); + return ascent; +#endif +} + +int Surface::Descent(Font &font_) { +#ifdef FAST_WAY + return font_.id->descent; +#else + gint lbearing; + gint rbearing; + gint width; + gint ascent; + gint descent; + + gdk_string_extents(font_.id, sizeString, + &lbearing, &rbearing, &width, &ascent, &descent); + return descent; +#endif +} + +int Surface::InternalLeading(Font &) { + return 0; +} + +int Surface::ExternalLeading(Font &) { + return 0; +} + +int Surface::Height(Font &font_) { + return Ascent(font_) + Descent(font_); +} + +int Surface::AverageCharWidth(Font &font_) { + return gdk_char_width(font_.id, 'n'); +} + +int Surface::SetPalette(Palette *, bool) { + // Handled in palette allocation for GTK so this does nothing + return 0; +} + +void Surface::SetClip(PRectangle rc) { + GdkRectangle area = {rc.left, rc.top, + rc.right - rc.left, rc.bottom - rc.top}; + gdk_gc_set_clip_rectangle(gc, &area); +} + +Window::~Window() { +} + +void Window::Destroy() { + if (id) + gtk_widget_destroy(GTK_WIDGET(id)); + id = 0; +} + +bool Window::HasFocus() { + return GTK_WIDGET_HAS_FOCUS(id); +} + +PRectangle Window::GetPosition() { + // Before any size allocated pretend its 100 wide so not scrolled + PRectangle rc(0, 0, 100, 100); + if (id) { + rc.left = id->allocation.x; + rc.top = id->allocation.y; + if (id->allocation.width > 20) { + rc.right = rc.left + id->allocation.width; + rc.bottom = rc.top + id->allocation.height; + } + } + return rc; +} + +void Window::SetPosition(PRectangle rc) { + //gtk_widget_set_uposition(id, rc.left, rc.top); + GtkAllocation alloc; + alloc.x = rc.left; + alloc.y = rc.top; + alloc.width = rc.Width(); + alloc.height = rc.Height(); + gtk_widget_size_allocate(id, &alloc); +} + +void Window::SetPositionRelative(PRectangle rc, Window relativeTo) { + int ox = 0; + int oy = 0; + gdk_window_get_origin(relativeTo.id->window, &ox, &oy); + + gtk_widget_set_uposition(id, rc.left + ox, rc.top + oy); + GtkAllocation alloc; + alloc.x = rc.left + ox; + alloc.y = rc.top + oy; + alloc.width = rc.right - rc.left; + alloc.height = rc.bottom - rc.top; + gtk_widget_size_allocate(id, &alloc); +} + +PRectangle Window::GetClientPosition() { + // On GTK+, the client position is the window position + return GetPosition(); +} + +void Window::Show(bool show) { + if (show) + gtk_widget_show(id); +} + +void Window::InvalidateAll() { + if (id) { + gtk_widget_queue_draw(id); + } +} + +void Window::InvalidateRectangle(PRectangle rc) { + if (id) { + gtk_widget_queue_draw_area(id, + rc.left, rc.top, + rc.right - rc.left, rc.bottom - rc.top); + } +} + +void Window::SetFont(Font &) { + // TODO +} + +void Window::SetCursor(Cursor curs) { + switch (curs) { + case cursorText: + gdk_window_set_cursor(id->window, gdk_cursor_new(GDK_XTERM)); + break; + case cursorArrow: + gdk_window_set_cursor(id->window, gdk_cursor_new(GDK_ARROW)); + break; + case cursorUp: + gdk_window_set_cursor(id->window, gdk_cursor_new(GDK_CENTER_PTR)); + break; + case cursorWait: + gdk_window_set_cursor(id->window, gdk_cursor_new(GDK_WATCH)); + break; + case cursorReverseArrow: + gdk_window_set_cursor(id->window, gdk_cursor_new(GDK_TOP_LEFT_ARROW)); + break; + default: + gdk_window_set_cursor(id->window, gdk_cursor_new(GDK_ARROW)); + break; + } +} + +void Window::SetTitle(const char *s) { + gtk_window_set_title(GTK_WINDOW(id), s); +} + +ListBox::ListBox() : list(0), current(0) {} + +ListBox::~ListBox() {} + +static void SelectionAC(GtkWidget *, gint row, gint, + GdkEventButton *, gpointer p) { + int *pi = reinterpret_cast<int *>(p); + *pi = row; +} + +void ListBox::Create(Window &, int) { + id = gtk_window_new(GTK_WINDOW_POPUP); + scroller = gtk_scrolled_window_new(NULL, NULL); + gtk_container_set_border_width(GTK_CONTAINER(scroller), 1); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroller), + GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + + list = gtk_clist_new(1); + gtk_clist_set_column_auto_resize(GTK_CLIST(list), 0, TRUE); + gtk_container_add(GTK_CONTAINER(scroller), list); + + gtk_container_add(GTK_CONTAINER(GetID()), scroller); + + gtk_widget_show(list); + gtk_widget_show(scroller); + + gtk_clist_set_selection_mode(GTK_CLIST(list), GTK_SELECTION_BROWSE); + gtk_signal_connect(GTK_OBJECT(list), "select_row", + GTK_SIGNAL_FUNC(SelectionAC), ¤t); + gtk_clist_set_shadow_type(GTK_CLIST(list), GTK_SHADOW_OUT); + + gtk_widget_realize(id); +} + +void ListBox::Clear() { + gtk_clist_clear(GTK_CLIST(list)); +} + +void ListBox::Append(char *s) { + char *szs[] = { s, 0}; + gtk_clist_append(GTK_CLIST(list), szs); +} + +int ListBox::Length() { + return GTK_CLIST(list)->rows; +} + +void ListBox::Select(int n) { + gtk_clist_select_row(GTK_CLIST(list), n, 0); + gtk_clist_moveto(GTK_CLIST(list), n, 0, 0.5, 0.5); +} + +int ListBox::GetSelection() { + return current; +} + +int ListBox::Find(const char *prefix) { + int count = Length(); + for (int i = 0; i < count; i++) { + char *s = 0; + gtk_clist_get_text(GTK_CLIST(list), i, 0, &s); + if (s && (0 == strncmp(prefix, s, strlen(prefix)))) { + return i; + } + } + return - 1; +} + +void ListBox::GetValue(int n, char *value, int len) { + char *text = 0; + gtk_clist_get_text(GTK_CLIST(list), n, 0, &text); + if (text && len > 0) { + strncpy(value, text, len); + value[len - 1] = '\0'; + } else { + value[0] = '\0'; + } +} + +void ListBox::Sort() { + gtk_clist_sort(GTK_CLIST(list)); +} + +Menu::Menu() : id(0) {} + + +void Menu::CreatePopUp() { + Destroy(); + id = gtk_item_factory_new(GTK_TYPE_MENU, "<main>", NULL); +} + +void Menu::Destroy() { + if (id) + gtk_object_unref(GTK_OBJECT(id)); + id = 0; +} + +void Menu::Show(Point pt, Window &) { + gtk_item_factory_popup(id, pt.x - 4, pt.y, 3, 0); +} + +Colour Platform::Chrome() { + return Colour(0xe0, 0xe0, 0xe0); +} + +Colour Platform::ChromeHighlight() { + return Colour(0xff, 0xff, 0xff); +} + +const char *Platform::DefaultFont() { + return "lucidatypewriter"; +} + +int Platform::DefaultFontSize() { + return 12; +} + +unsigned int Platform::DoubleClickTime() { + return 500; // Half a second +} + +void Platform::DebugDisplay(const char *s) { + printf("%s", s); +} + +bool Platform::IsKeyDown(int) { + // TODO: discover state of keys in GTK+/X + return false; +} + +long Platform::SendScintilla( + WindowID w, unsigned int msg, unsigned long wParam, long lParam) { + return scintilla_send_message(SCINTILLA(w), msg, wParam, lParam); +} + +// These are utility functions not really tied to a platform + +int Platform::Minimum(int a, int b) { + if (a < b) + return a; + else + return b; +} + +int Platform::Maximum(int a, int b) { + if (a > b) + return a; + else + return b; +} + +//#define TRACE + +void Platform::DebugPrintf(const char *format, ...) { +#ifdef TRACE + char buffer[2000]; + va_list pArguments; + va_start(pArguments, format); + vsprintf(buffer, format, pArguments); + va_end(pArguments); + Platform::DebugDisplay(buffer); +#endif +} + +int Platform::Clamp(int val, int minVal, int maxVal) { + if (val > maxVal) + val = maxVal; + if (val < minVal) + val = minVal; + return val; +} diff --git a/gtk/makefile b/gtk/makefile new file mode 100644 index 000000000..9b34c08d7 --- /dev/null +++ b/gtk/makefile @@ -0,0 +1,69 @@ +# Make file for Scintilla on Linux or compatible OS +# Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org> +# The License.txt file describes the conditions under which this software may be distributed. +# This makefile assumes GCC 2.95.2 is used and changes will +# be needed to use other compilers. + +.SUFFIXES: .cxx .o .h .a +CC = g++ +AR = ar + +COMPLIB=../bin/scintilla.a + +vpath %.h ../src ../include +vpath %.cxx ../src + +#CXXFLAGS= -g -DGTK -DSCI_LEXER -Wwrite-strings +INCLUDEDIRS=-I ../include -I ../src +CXXFLAGS= -DGTK -DSCI_LEXER + +.cxx.o: + $(CC) `gtk-config --cflags` $(INCLUDEDIRS) $(CXXFLAGS) -c $< -o $@ + +all: $(COMPLIB) + +$(COMPLIB): Accessor.o KeyWords.o Document.o CallTip.o \ + ScintillaBase.o ContractionState.o Editor.o PropSet.o PlatGTK.o \ + KeyMap.o LineMarker.o ScintillaGTK.o CellBuffer.o ViewStyle.o \ + Style.o Indicator.o AutoComplete.o + $(AR) rc $@ $^ + +Accessor.o: Accessor.cxx Platform.h PropSet.h Accessor.h Scintilla.h \ + WinDefs.h +AutoComplete.o: AutoComplete.cxx Platform.h AutoComplete.h +CallTip.o: CallTip.cxx Platform.h CallTip.h +CellBuffer.o: CellBuffer.cxx Platform.h Scintilla.h WinDefs.h \ + CellBuffer.h +ContractionState.o: ContractionState.cxx Platform.h ContractionState.h +Document.o: Document.cxx Platform.h Scintilla.h WinDefs.h CellBuffer.h \ + Document.h +Editor.o: Editor.cxx Platform.h Scintilla.h WinDefs.h \ + ContractionState.h CellBuffer.h KeyMap.h Indicator.h LineMarker.h \ + Style.h ViewStyle.h Document.h Editor.h +Indicator.o: Indicator.cxx Platform.h Scintilla.h WinDefs.h \ + Indicator.h +KeyMap.o: KeyMap.cxx Platform.h Scintilla.h WinDefs.h KeyMap.h +KeyWords.o: KeyWords.cxx Platform.h PropSet.h Accessor.h KeyWords.h \ + Scintilla.h WinDefs.h SciLexer.h +LineMarker.o: LineMarker.cxx Platform.h Scintilla.h WinDefs.h \ + LineMarker.h +PlatGTK.o: PlatGTK.cxx Platform.h Scintilla.h WinDefs.h +PropSet.o: PropSet.cxx Platform.h PropSet.h +SciTEBase.o: SciTEBase.cxx Platform.h WinDefs.h SciTE.h PropSet.h \ + Accessor.h KeyWords.h Scintilla.h SciLexer.h SciTEBase.h +SciTEGTK.o: SciTEGTK.cxx Platform.h WinDefs.h SciTE.h PropSet.h \ + Accessor.h KeyWords.h Scintilla.h SciTEBase.h +ScintillaBase.o: ScintillaBase.cxx Platform.h Scintilla.h WinDefs.h \ + SciLexer.h PropSet.h Accessor.h KeyWords.h ContractionState.h \ + CellBuffer.h CallTip.h KeyMap.h Indicator.h LineMarker.h Style.h \ + ViewStyle.h AutoComplete.h Document.h Editor.h ScintillaBase.h +ScintillaGTK.o: ScintillaGTK.cxx Platform.h Scintilla.h WinDefs.h \ + SciLexer.h PropSet.h Accessor.h KeyWords.h ContractionState.h \ + CellBuffer.h CallTip.h KeyMap.h Indicator.h LineMarker.h Style.h \ + AutoComplete.h ViewStyle.h Document.h Editor.h ScintillaBase.h +Style.o: Style.cxx Platform.h Style.h +ViewStyle.o: ViewStyle.cxx Platform.h Scintilla.h WinDefs.h \ + Indicator.h LineMarker.h Style.h ViewStyle.h + +clean: + rm -f *.o SciTE @@ -0,0 +1,5 @@ +cd .. +rm -f scintilla.zip +tar --create scintilla/* \ + --exclude=*.o --exclude=*.obj --exclude=*.dll --exclude=*.exe --exclude=*.a \ + | gzip -c >scintilla.tgz diff --git a/zipsrc.bat b/zipsrc.bat new file mode 100755 index 000000000..a89649789 --- /dev/null +++ b/zipsrc.bat @@ -0,0 +1,4 @@ +cd .. +del/q scintilla.zip +zip scintilla.zip scintilla\*.* scintilla\*\*.* -x *.o -x *.obj -x *.dll +cd scintilla |