[UPDATE] Update Scintilla from v1.78 to v2.01.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@525 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2009-08-23 02:24:48 +00:00
parent 43a49d0b54
commit c84437b0d1
83 changed files with 6056 additions and 5411 deletions

View File

@ -209,6 +209,7 @@ FunctionEnd
!insertmacro MUI_LANGUAGE "Basque" !insertmacro MUI_LANGUAGE "Basque"
!insertmacro MUI_LANGUAGE "Luxembourgish" !insertmacro MUI_LANGUAGE "Luxembourgish"
!insertmacro MUI_LANGUAGE "Afrikaans" !insertmacro MUI_LANGUAGE "Afrikaans"
!insertmacro MUI_LANGUAGE "Uzbek"
;!insertmacro MUI_LANGUAGE "Latvian" ;!insertmacro MUI_LANGUAGE "Latvian"
;!insertmacro MUI_LANGUAGE "Macedonian" ;!insertmacro MUI_LANGUAGE "Macedonian"
@ -219,7 +220,6 @@ FunctionEnd
;!insertmacro MUI_LANGUAGE "Bosnian" ;!insertmacro MUI_LANGUAGE "Bosnian"
;!insertmacro MUI_LANGUAGE "Kurdish" ;!insertmacro MUI_LANGUAGE "Kurdish"
;!insertmacro MUI_LANGUAGE "Irish" ;!insertmacro MUI_LANGUAGE "Irish"
;!insertmacro MUI_LANGUAGE "Uzbek"
!insertmacro MUI_RESERVEFILE_LANGDLL !insertmacro MUI_RESERVEFILE_LANGDLL
@ -302,6 +302,7 @@ LangString langFileName ${LANG_GALICIAN} "galician.xml"
LangString langFileName ${LANG_BASQUE} "basque.xml" LangString langFileName ${LANG_BASQUE} "basque.xml"
LangString langFileName ${LANG_LUXEMBOURGISH} "luxembourgish.xml" LangString langFileName ${LANG_LUXEMBOURGISH} "luxembourgish.xml"
LangString langFileName ${LANG_AFRIKAANS} "afrikaans.xml" LangString langFileName ${LANG_AFRIKAANS} "afrikaans.xml"
LangString langFileName ${LANG_UZBEK} "uzbek.xml"
;-------------------------------- ;--------------------------------

View File

@ -7129,6 +7129,13 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
_mainEditView.execute(SCI_SETZOOM, svp1._zoom); _mainEditView.execute(SCI_SETZOOM, svp1._zoom);
_subEditView.execute(SCI_SETZOOM, svp2._zoom); _subEditView.execute(SCI_SETZOOM, svp2._zoom);
_mainEditView.execute(SCI_SETMULTIPLESELECTION, true);
_subEditView.execute(SCI_SETMULTIPLESELECTION, true);
_mainEditView.execute(SCI_SETADDITIONALSELECTIONTYPING, true);
_subEditView.execute(SCI_SETADDITIONALSELECTIONTYPING, true);
_mainEditView.execute(SCI_SETVIRTUALSPACEOPTIONS, SCVS_RECTANGULARSELECTION);
_subEditView.execute(SCI_SETVIRTUALSPACEOPTIONS, SCVS_RECTANGULARSELECTION);
TabBarPlus::doDragNDrop(true); TabBarPlus::doDragNDrop(true);
if (_toReduceTabBar) if (_toReduceTabBar)

View File

@ -261,6 +261,7 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
{ {
switch (Message) switch (Message)
{ {
/*
case WM_CHAR : case WM_CHAR :
{ {
if (execute(SCI_SELECTIONISRECTANGLE) && !(::GetKeyState(VK_LCONTROL) & 0x80000000)) if (execute(SCI_SELECTIONISRECTANGLE) && !(::GetKeyState(VK_LCONTROL) & 0x80000000))
@ -290,6 +291,7 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
} }
break; break;
} }
*/
case WM_MOUSEHWHEEL : case WM_MOUSEHWHEEL :
{ {

View File

@ -66,9 +66,6 @@ BOOL CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
ColumnModeInfo colInfos = (*_ppEditView)->getColumnModeSelectInfo(); ColumnModeInfo colInfos = (*_ppEditView)->getColumnModeSelectInfo();
(*_ppEditView)->columnReplace(colInfos, str); (*_ppEditView)->columnReplace(colInfos, str);
(*_ppEditView)->execute(SCI_SETCURRENTPOS,colInfos[colInfos.size()-1].second); (*_ppEditView)->execute(SCI_SETCURRENTPOS,colInfos[colInfos.size()-1].second);
//(*_ppEditView)->execute(SCI_SETSEL, colInfos[0].first, colInfos[colInfos.size()-1].second);
//(*_ppEditView)->execute(SCI_SETSELECTIONMODE, 1);
} }
else else
{ {

View File

@ -18,9 +18,9 @@
#ifndef RESOURCE_H #ifndef RESOURCE_H
#define RESOURCE_H #define RESOURCE_H
#define NOTEPAD_PLUS_VERSION TEXT("Notepad++ v5.4.5") #define NOTEPAD_PLUS_VERSION TEXT("Notepad++ v5.5")
#define VERSION_VALUE TEXT("5.45\0") // should be X.Y : ie. if VERSION_DIGITALVALUE == 4, 7, 1, 0 , then X = 4, Y = 71 #define VERSION_VALUE TEXT("5.5\0") // should be X.Y : ie. if VERSION_DIGITALVALUE == 4, 7, 1, 0 , then X = 4, Y = 71
#define VERSION_DIGITALVALUE 5, 4, 5, 0 #define VERSION_DIGITALVALUE 5, 5, 0, 0
#ifdef UNICODE #ifdef UNICODE
#define UNICODE_ANSI_MODE TEXT("(UNICODE)") #define UNICODE_ANSI_MODE TEXT("(UNICODE)")

View File

@ -9,7 +9,7 @@
<meta name="generator" content="SciTE" /> <meta name="generator" content="SciTE" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Scintilla and SciTE</title> <title>Scintilla Documentation</title>
<style type="text/css"> <style type="text/css">
<!-- <!--
@ -38,7 +38,7 @@
<h1>Scintilla Documentation</h1> <h1>Scintilla Documentation</h1>
<p>Last edited 28/April/2009 NH</p> <p>Last edited 7/August/2009 NH</p>
<p>There is <a class="jump" href="Design.html">an overview of the internal design of <p>There is <a class="jump" href="Design.html">an overview of the internal design of
Scintilla</a>.<br /> Scintilla</a>.<br />
@ -174,100 +174,106 @@
<tr> <tr>
<td>o <a class="toc" href="#SelectionAndInformation">Selection and information</a></td> <td>o <a class="toc" href="#SelectionAndInformation">Selection and information</a></td>
<td>o <a class="toc" href="#MultipleSelectionAndVirtualSpace">Multiple Selection and Virtual Space</a></td>
<td>o <a class="toc" href="#ScrollingAndAutomaticScrolling">Scrolling and automatic <td>o <a class="toc" href="#ScrollingAndAutomaticScrolling">Scrolling and automatic
scrolling</a></td> scrolling</a></td>
<td>o <a class="toc" href="#WhiteSpace">White space</a></td>
</tr> </tr>
<tr> <tr>
<td>o <a class="toc" href="#WhiteSpace">White space</a></td>
<td>o <a class="toc" href="#Cursor">Cursor</a></td> <td>o <a class="toc" href="#Cursor">Cursor</a></td>
<td>o <a class="toc" href="#MouseCapture">Mouse capture</a></td> <td>o <a class="toc" href="#MouseCapture">Mouse capture</a></td>
<td>o <a class="toc" href="#LineEndings">Line endings</a></td>
</tr> </tr>
<tr> <tr>
<td>o <a class="toc" href="#LineEndings">Line endings</a></td>
<td>o <a class="toc" href="#Styling">Styling</a></td> <td>o <a class="toc" href="#Styling">Styling</a></td>
<td>o <a class="toc" href="#StyleDefinition">Style definition</a></td> <td>o <a class="toc" href="#StyleDefinition">Style definition</a></td>
<td>o <a class="toc" href="#CaretAndSelectionStyles">Caret, selection, and hotspot styles</a></td>
</tr> </tr>
<tr> <tr>
<td>o <a class="toc" href="#CaretAndSelectionStyles">Caret, selection, and hotspot styles</a></td>
<td>o <a class="toc" href="#Margins">Margins</a></td> <td>o <a class="toc" href="#Margins">Margins</a></td>
<td>o <a class="toc" href="#Annotations">Annotations</a></td> <td>o <a class="toc" href="#Annotations">Annotations</a></td>
<td>o <a class="toc" href="#OtherSettings">Other settings</a></td>
</tr> </tr>
<tr> <tr>
<td>o <a class="toc" href="#OtherSettings">Other settings</a></td>
<td>o <a class="toc" href="#BraceHighlighting">Brace highlighting</a></td> <td>o <a class="toc" href="#BraceHighlighting">Brace highlighting</a></td>
<td>o <a class="toc" href="#TabsAndIndentationGuides">Tabs and Indentation <td>o <a class="toc" href="#TabsAndIndentationGuides">Tabs and Indentation
Guides</a></td> Guides</a></td>
<td>o <a class="toc" href="#Markers">Markers</a></td>
</tr> </tr>
<tr> <tr>
<td>o <a class="toc" href="#Markers">Markers</a></td>
<td>o <a class="toc" href="#Indicators">Indicators</a></td> <td>o <a class="toc" href="#Indicators">Indicators</a></td>
<td>o <a class="toc" href="#Autocompletion">Autocompletion</a></td> <td>o <a class="toc" href="#Autocompletion">Autocompletion</a></td>
<td>o <a class="toc" href="#UserLists">User lists</a></td>
</tr> </tr>
<tr> <tr>
<td>o <a class="toc" href="#UserLists">User lists</a></td>
<td>o <a class="toc" href="#CallTips">Call tips</a></td> <td>o <a class="toc" href="#CallTips">Call tips</a></td>
<td>o <a class="toc" href="#KeyboardCommands">Keyboard commands</a></td> <td>o <a class="toc" href="#KeyboardCommands">Keyboard commands</a></td>
<td>o <a class="toc" href="#KeyBindings">Key bindings</a></td>
</tr> </tr>
<tr> <tr>
<td>o <a class="toc" href="#KeyBindings">Key bindings</a></td>
<td>o <a class="toc" href="#PopupEditMenu">Popup edit menu</a></td> <td>o <a class="toc" href="#PopupEditMenu">Popup edit menu</a></td>
<td>o <a class="toc" href="#MacroRecording">Macro recording</a></td> <td>o <a class="toc" href="#MacroRecording">Macro recording</a></td>
<td>o <a class="toc" href="#Printing">Printing</a></td>
</tr> </tr>
<tr> <tr>
<td>o <a class="toc" href="#Printing">Printing</a></td>
<td>o <a class="toc" href="#DirectAccess">Direct access</a></td> <td>o <a class="toc" href="#DirectAccess">Direct access</a></td>
<td>o <a class="toc" href="#MultipleViews">Multiple views</a></td> <td>o <a class="toc" href="#MultipleViews">Multiple views</a></td>
<td>o <a class="toc" href="#Folding">Folding</a></td>
</tr> </tr>
<tr> <tr>
<td>o <a class="toc" href="#Folding">Folding</a></td>
<td>o <a class="toc" href="#LineWrapping">Line wrapping</a></td> <td>o <a class="toc" href="#LineWrapping">Line wrapping</a></td>
<td>o <a class="toc" href="#Zooming">Zooming</a></td> <td>o <a class="toc" href="#Zooming">Zooming</a></td>
<td>o <a class="toc" href="#LongLines">Long lines</a></td>
</tr> </tr>
<tr> <tr>
<td>o <a class="toc" href="#LongLines">Long lines</a></td>
<td>o <a class="toc" href="#Lexer">Lexer</a></td> <td>o <a class="toc" href="#Lexer">Lexer</a></td>
<td>o <a class="toc" href="#Notifications">Notifications</a></td> <td>o <a class="toc" href="#Notifications">Notifications</a></td>
<td>o <a class="toc" href="#GTK">GTK+</a></td>
</tr> </tr>
<tr> <tr>
<td>o <a class="toc" href="#GTK">GTK+</a></td>
<td>o <a class="toc" href="#DeprecatedMessages">Deprecated messages</a></td> <td>o <a class="toc" href="#DeprecatedMessages">Deprecated messages</a></td>
<td>o <a class="toc" href="#EditMessagesNeverSupportedByScintilla">Edit messages never <td>o <a class="toc" href="#EditMessagesNeverSupportedByScintilla">Edit messages never
supported by Scintilla</a></td> supported by Scintilla</a></td>
</tr>
<tr>
<td>o <a class="toc" href="#BuildingScintilla">Building Scintilla</a></td> <td>o <a class="toc" href="#BuildingScintilla">Building Scintilla</a></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -878,8 +884,34 @@ struct TextToFind {
<p><b id="SCI_SETSTATUS">SCI_SETSTATUS(int status)</b><br /> <p><b id="SCI_SETSTATUS">SCI_SETSTATUS(int status)</b><br />
<b id="SCI_GETSTATUS">SCI_GETSTATUS</b><br /> <b id="SCI_GETSTATUS">SCI_GETSTATUS</b><br />
If an error occurs, Scintilla may set an internal error number that can be retrieved with If an error occurs, Scintilla may set an internal error number that can be retrieved with
<code>SCI_GETSTATUS</code>. Not currently used but will be in the future. To clear the error <code>SCI_GETSTATUS</code>.
status call <code>SCI_SETSTATUS(0)</code>.</p> To clear the error status call <code>SCI_SETSTATUS(0)</code>.
The currently defined statuses are:
<table cellpadding="1" cellspacing="2" border="0" summary="Status values">
<tbody valign="top">
<tr>
<th align="left">SC_STATUS_OK</th>
<td>0</td>
<td>No failures</td>
</tr>
<tr>
<th align="left">SC_STATUS_FAILURE</th>
<td>1</td>
<td>Generic failure</td>
</tr>
<tr>
<th align="left">SC_STATUS_BADALLOC</th>
<td>2</td>
<td>Memory is exhausted</td>
</tr>
</tbody>
</table>
</p>
<h2 id="UndoAndRedo">Undo and Redo</h2> <h2 id="UndoAndRedo">Undo and Redo</h2>
@ -1006,6 +1038,9 @@ struct TextToFind {
<a class="message" href="#SCI_FINDCOLUMN">SCI_FINDCOLUMN(int line, int column)</a><br /> <a class="message" href="#SCI_FINDCOLUMN">SCI_FINDCOLUMN(int line, int column)</a><br />
<a class="message" href="#SCI_POSITIONFROMPOINT">SCI_POSITIONFROMPOINT(int x, int y)</a><br /> <a class="message" href="#SCI_POSITIONFROMPOINT">SCI_POSITIONFROMPOINT(int x, int y)</a><br />
<a class="message" href="#SCI_POSITIONFROMPOINTCLOSE">SCI_POSITIONFROMPOINTCLOSE(int x, int <a class="message" href="#SCI_POSITIONFROMPOINTCLOSE">SCI_POSITIONFROMPOINTCLOSE(int x, int
y)</a><br />
<a class="message" href="#SCI_CHARPOSITIONFROMPOINT">SCI_CHARPOSITIONFROMPOINT(int x, int y)</a><br />
<a class="message" href="#SCI_CHARPOSITIONFROMPOINTCLOSE">SCI_CHARPOSITIONFROMPOINTCLOSE(int x, int
y)</a><br /> y)</a><br />
<a class="message" href="#SCI_POINTXFROMPOSITION">SCI_POINTXFROMPOSITION(&lt;unused&gt;, int <a class="message" href="#SCI_POINTXFROMPOSITION">SCI_POINTXFROMPOSITION(&lt;unused&gt;, int
position)</a><br /> position)</a><br />
@ -1172,16 +1207,18 @@ struct TextToFind {
href="#SCI_POSITIONFROMLINE"><code>SCI_POSITIONFROMLINE(line)</code></a>.</p> href="#SCI_POSITIONFROMLINE"><code>SCI_POSITIONFROMLINE(line)</code></a>.</p>
<b id="SCI_GETSELTEXT">SCI_GETSELTEXT(&lt;unused&gt;, char *text)</b><br /> <b id="SCI_GETSELTEXT">SCI_GETSELTEXT(&lt;unused&gt;, char *text)</b><br />
This copies the currently selected text and a terminating 0 byte to the <code>text</code> This copies the currently selected text and a terminating 0 byte to the <code>text</code>
buffer. The buffer must be at least buffer. The buffer size should be determined by calling with a NULL pointer for the <code>text</code> argument
<code>SCI_GETSELECTIONEND()-SCI_GETSELECTIONSTART()+1</code> bytes long. <br /> <code>SCI_GETSELTEXT(0,0)</code>.
If the text argument is 0 then the length that should be allocated This allows for rectangular and discontiguous selections as well as simple selections.
to store the entire selection is returned.<br /> See <a class="toc" href="#MultipleSelectionAndVirtualSpace">Multiple Selection</a> for information on
how multiple and rectangular selections and virtual space are copied.</p>
<p>See also: <code><a class="message" href="#SCI_GETCURLINE">SCI_GETCURLINE</a>, <a <p>See also: <code><a class="message" href="#SCI_GETCURLINE">SCI_GETCURLINE</a>,
class="message" href="#SCI_GETLINE">SCI_GETLINE</a>, <a class="message" <a class="message" href="#SCI_GETLINE">SCI_GETLINE</a>,
href="#SCI_GETTEXT">SCI_GETTEXT</a>, <a class="message" <a class="message" href="#SCI_GETTEXT">SCI_GETTEXT</a>,
href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT</a>, <a class="message" <a class="message" href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT</a>,
href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE</a></code></p> <a class="message" href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE</a>
</code></p>
<p><b id="SCI_GETCURLINE">SCI_GETCURLINE(int textLen, char *text)</b><br /> <p><b id="SCI_GETCURLINE">SCI_GETCURLINE(int textLen, char *text)</b><br />
This retrieves the text of the line containing the caret and returns the position within the This retrieves the text of the line containing the caret and returns the position within the
@ -1205,12 +1242,15 @@ struct TextToFind {
<b id="SCI_GETSELECTIONMODE">SCI_GETSELECTIONMODE</b><br /> <b id="SCI_GETSELECTIONMODE">SCI_GETSELECTIONMODE</b><br />
The two functions set and get the selection mode, which can be The two functions set and get the selection mode, which can be
stream (<code>SC_SEL_STREAM</code>=0) or stream (<code>SC_SEL_STREAM</code>=0) or
rectangular (<code>SC_SEL_RECTANGLE</code>=1) rectangular (<code>SC_SEL_RECTANGLE</code>=1) or
or by lines (<code>SC_SEL_LINES</code>=2). by lines (<code>SC_SEL_LINES</code>=2)
or thin rectangular (<code>SC_SEL_THIN</code>=3).
When set in these modes, regular caret moves will extend or reduce the selection, When set in these modes, regular caret moves will extend or reduce the selection,
until the mode is cancelled by a call with same value or with <code>SCI_CANCEL</code>. until the mode is cancelled by a call with same value or with <code>SCI_CANCEL</code>.
The get function returns the current mode even if the selection was made by mouse The get function returns the current mode even if the selection was made by mouse
or with regular extended moves.</p> or with regular extended moves.
<code>SC_SEL_THIN</code> is the mode after a rectangular selection has been typed into and ensures
that no characters are selected.</p>
<p><b id="SCI_GETLINESELSTARTPOSITION">SCI_GETLINESELSTARTPOSITION(int line)</b><br /> <p><b id="SCI_GETLINESELSTARTPOSITION">SCI_GETLINESELSTARTPOSITION(int line)</b><br />
<b id="SCI_GETLINESELENDPOSITION">SCI_GETLINESELENDPOSITION(int line)</b><br /> <b id="SCI_GETLINESELENDPOSITION">SCI_GETLINESELENDPOSITION(int line)</b><br />
@ -1343,6 +1383,13 @@ struct TextToFind {
<code>SCI_POSITIONFROMPOINTCLOSE</code> is similar but returns -1 if the point is outside the <code>SCI_POSITIONFROMPOINTCLOSE</code> is similar but returns -1 if the point is outside the
window or not close to any characters.</p> window or not close to any characters.</p>
<p><b id="SCI_CHARPOSITIONFROMPOINT">SCI_CHARPOSITIONFROMPOINT(int x, int y)</b><br />
<b id="SCI_CHARPOSITIONFROMPOINTCLOSE">SCI_CHARPOSITIONFROMPOINTCLOSE(int x, int y)</b><br />
<code>SCI_CHARPOSITIONFROMPOINT</code> finds the closest character to a point and
<code>SCI_CHARPOSITIONFROMPOINTCLOSE</code> is similar but returns -1 if the point is outside the
window or not close to any characters. This is similar to the previous methods but finds characters rather than
inter-character positions.</p>
<p><b id="SCI_POINTXFROMPOSITION">SCI_POINTXFROMPOSITION(&lt;unused&gt;, int pos)</b><br /> <p><b id="SCI_POINTXFROMPOSITION">SCI_POINTXFROMPOSITION(&lt;unused&gt;, int pos)</b><br />
<b id="SCI_POINTYFROMPOSITION">SCI_POINTYFROMPOSITION(&lt;unused&gt;, int pos)</b><br /> <b id="SCI_POINTYFROMPOSITION">SCI_POINTYFROMPOSITION(&lt;unused&gt;, int pos)</b><br />
These messages return the x and y display pixel location of text at position <code>pos</code> These messages return the x and y display pixel location of text at position <code>pos</code>
@ -1359,6 +1406,203 @@ struct TextToFind {
user and this value is then used when moving vertically such as by using the up and down keys. user and this value is then used when moving vertically such as by using the up and down keys.
This message sets the current x position of the caret as the remembered value.</p> This message sets the current x position of the caret as the remembered value.</p>
<h2 id="MultipleSelectionAndVirtualSpace">Multiple Selection and Virtual Space</h2>
<code>
<a class="message" href="#SCI_SETMULTIPLESELECTION">SCI_SETMULTIPLESELECTION(bool multipleSelection)</a><br />
<a class="message" href="#SCI_GETMULTIPLESELECTION">SCI_GETMULTIPLESELECTION</a><br />
<a class="message" href="#SCI_SETADDITIONALSELECTIONTYPING">SCI_SETADDITIONALSELECTIONTYPING(bool additionalSelectionTyping)</a><br />
<a class="message" href="#SCI_GETADDITIONALSELECTIONTYPING">SCI_GETADDITIONALSELECTIONTYPING</a><br />
<a class="message" href="#SCI_SETVIRTUALSPACEOPTIONS">SCI_SETVIRTUALSPACEOPTIONS(int virtualSpaceOptions)</a><br />
<a class="message" href="#SCI_GETVIRTUALSPACEOPTIONS">SCI_GETVIRTUALSPACEOPTIONS</a><br />
<a class="message" href="#SCI_SETRECTANGULARSELECTIONMODIFIER">SCI_SETRECTANGULARSELECTIONMODIFIER(int modifier)</a><br />
<a class="message" href="#SCI_GETRECTANGULARSELECTIONMODIFIER">SCI_GETRECTANGULARSELECTIONMODIFIER</a><br />
<br />
<a class="message" href="#SCI_GETSELECTIONS">SCI_GETSELECTIONS</a><br />
<a class="message" href="#SCI_CLEARSELECTIONS">SCI_CLEARSELECTIONS</a><br />
<a class="message" href="#SCI_SETSELECTION">SCI_SETSELECTION(int caret, int anchor)</a><br />
<a class="message" href="#SCI_ADDSELECTION">SCI_ADDSELECTION(int caret, int anchor)</a><br />
<a class="message" href="#SCI_SETMAINSELECTION">SCI_SETMAINSELECTION(int selection)</a><br />
<a class="message" href="#SCI_GETMAINSELECTION">SCI_GETMAINSELECTION</a><br />
<br />
<a class="message" href="#SCI_SETSELECTIONNCARET">SCI_SETSELECTIONNCARET(int selection, int pos)</a><br />
<a class="message" href="#SCI_GETSELECTIONNCARET">SCI_GETSELECTIONNCARET(int selection)</a><br />
<a class="message" href="#SCI_SETSELECTIONNCARETVIRTUALSPACE">SCI_SETSELECTIONNCARETVIRTUALSPACE(int selection, int space)</a><br />
<a class="message" href="#SCI_GETSELECTIONNCARETVIRTUALSPACE">SCI_GETSELECTIONNCARETVIRTUALSPACE(int selection)</a><br />
<a class="message" href="#SCI_SETSELECTIONNANCHOR">SCI_SETSELECTIONNANCHOR(int selection, int posAnchor)</a><br />
<a class="message" href="#SCI_GETSELECTIONNANCHOR">SCI_GETSELECTIONNANCHOR(int selection)</a><br />
<a class="message" href="#SCI_SETSELECTIONNANCHORVIRTUALSPACE">SCI_SETSELECTIONNANCHORVIRTUALSPACE(int selection, int space)</a><br />
<a class="message" href="#SCI_GETSELECTIONNANCHORVIRTUALSPACE">SCI_GETSELECTIONNANCHORVIRTUALSPACE(int selection)</a><br />
<a class="message" href="#SCI_SETSELECTIONNSTART">SCI_SETSELECTIONNSTART(int selection, int pos)</a><br />
<a class="message" href="#SCI_GETSELECTIONNSTART">SCI_GETSELECTIONNSTART(int selection)</a><br />
<a class="message" href="#SCI_SETSELECTIONNEND">SCI_SETSELECTIONNEND(int selection, int pos)</a><br />
<a class="message" href="#SCI_GETSELECTIONNEND">SCI_GETSELECTIONNEND(int selection)</a><br />
<br />
<a class="message" href="#SCI_SETRECTANGULARSELECTIONCARET">SCI_SETRECTANGULARSELECTIONCARET(int pos)</a><br />
<a class="message" href="#SCI_GETRECTANGULARSELECTIONCARET">SCI_GETRECTANGULARSELECTIONCARET</a><br />
<a class="message" href="#SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE">SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE(int space)</a><br />
<a class="message" href="#SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE">SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE</a><br />
<a class="message" href="#SCI_SETRECTANGULARSELECTIONANCHOR">SCI_SETRECTANGULARSELECTIONANCHOR(int posAnchor)</a><br />
<a class="message" href="#SCI_GETRECTANGULARSELECTIONANCHOR">SCI_GETRECTANGULARSELECTIONANCHOR</a><br />
<a class="message" href="#SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE">SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE(int space)</a><br />
<a class="message" href="#SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE">SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE</a><br />
<br />
<a class="message" href="#SCI_SETADDITIONALSELALPHA">SCI_SETADDITIONALSELALPHA(int alpha)</a><br />
<a class="message" href="#SCI_GETADDITIONALSELALPHA">SCI_GETADDITIONALSELALPHA</a><br />
<a class="message" href="#SCI_SETADDITIONALSELFORE">SCI_SETADDITIONALSELFORE(int <a class="jump" href="#colour">colour<a>)</a><br />
<a class="message" href="#SCI_SETADDITIONALSELBACK">SCI_SETADDITIONALSELBACK(int <a class="jump" href="#colour">colour<a>)</a><br />
<a class="message" href="#SCI_SETADDITIONALCARETFORE">SCI_SETADDITIONALCARETFORE(int <a class="jump" href="#colour">colour<a>)</a><br />
<a class="message" href="#SCI_GETADDITIONALCARETFORE">SCI_GETADDITIONALCARETFORE</a><br />
<a class="message" href="#SCI_SETADDITIONALCARETSBLINK">SCI_SETADDITIONALCARETSBLINK(bool additionalCaretsBlink)</a><br />
<a class="message" href="#SCI_GETADDITIONALCARETSBLINK">SCI_GETADDITIONALCARETSBLINK</a><br />
<br />
<a class="message" href="#SCI_SWAPMAINANCHORCARET">SCI_SWAPMAINANCHORCARET</a><br />
<a class="message" href="#SCI_ROTATESELECTION">SCI_ROTATESELECTION</a><br />
<p>
There may be multiple selections active at one time.
More selections are made by holding down the Ctrl key while dragging with the mouse.
The most recent selection is the main selection and determines which part of the document is shown automatically.
Any selection apart from the main selection is called an additional selection.
The calls in the previous section operate on the main selection.
There is always at least one selection.
</p>
<p>
Rectangular selections are handled as multiple selections although the original rectangular range is remembered so that
subsequent operations may be handled differently for rectangular selections. For example, pasting a rectangular selection
places each piece in a vertical column.
</p>
<p>
Virtual space is space beyond the end of each line. The caret may be moved into virtual space but no real space will be
added to the document until there is some text typed or some other text insertion command is used.
</p>
<p>When discontiguous selections are copied to the clipboard, each selection is added to the clipboard text
in order with no delimiting characters.
For rectangular selections the document's line end is added after each line's text. Rectangular selections
are always copied from top line to bottom, not in the in order of selection.Virtual space is not copied.</p>
<p>
<b id="SCI_SETMULTIPLESELECTION">SCI_SETMULTIPLESELECTION(bool multipleSelection)</b><br />
<b id="SCI_GETMULTIPLESELECTION">SCI_GETMULTIPLESELECTION</b><br />
Enable or disable multiple selection.</p>
<p>
<b id="SCI_SETADDITIONALSELECTIONTYPING">SCI_SETADDITIONALSELECTIONTYPING(bool additionalSelectionTyping)</b><br />
<b id="SCI_GETADDITIONALSELECTIONTYPING">SCI_GETADDITIONALSELECTIONTYPING</b><br />
Whether typing, backspace, or delete works with multiple selections simultaneously.</p>
<p>
<b id="SCI_SETVIRTUALSPACEOPTIONS">SCI_SETVIRTUALSPACEOPTIONS(int virtualSpace)</b><br />
<b id="SCI_GETVIRTUALSPACEOPTIONS">SCI_GETVIRTUALSPACEOPTIONS</b><br />
Virtual space can be enabled or disabled for rectangular selections or in other circumstances or in both.
There are two bit flags <code>SCVS_RECTANGULARSELECTION</code>=1 and
<code>SCVS_USERACCESSIBLE</code>=2 which can be set independently.
<code>SCVS_NONE</code>=0, the default, disables all use of virtual space.</p>
<p>
<b id="SCI_SETRECTANGULARSELECTIONMODIFIER">SCI_SETRECTANGULARSELECTIONMODIFIER(int modifier)</b><br />
<b id="SCI_GETRECTANGULARSELECTIONMODIFIER">SCI_GETRECTANGULARSELECTIONMODIFIER</b><br />
On GTK+, the key used to indicate that a rectangular selection should be created when combined with a mouse drag can be set.
The three possible values are <code>SCMOD_CTRL</code>=2 (default), <code>SCMOD_ALT</code>=4 or <code>SCMOD_SUPER</code>=8.
Since <code>SCMOD_ALT</code> is often already used by a window manager, the window manager may need configuring to allow this choice.
<code>SCMOD_SUPER</code> is often a system dependent modifier key such as the Left Windows key on a Windows keyboard or the
Command key on a Mac.</p>
<p>
<b id="SCI_GETSELECTIONS">SCI_GETSELECTIONS</b><br />
Return the number of selections currently active.</p>
<p>
<b id="SCI_CLEARSELECTIONS">SCI_CLEARSELECTIONS</b><br />
Set a single empty selection at 0 as the only selection.</p>
<p>
<b id="SCI_SETSELECTION">SCI_SETSELECTION(int caret, int anchor)</b><br />
Set a single selection from <code>anchor</code> to <code>caret</code> as the only selection.</p>
<p>
<b id="SCI_ADDSELECTION">SCI_ADDSELECTION(int caret, int anchor)</b><br />
Add a new selection from <code>anchor</code> to <code>caret</code> as the main selection retaining all other
selections as additional selections.
Since there is always at least one selection, to set a list of selections, the first selection should be
added with <code>SCI_SETSELECTION</code> and later selections added with <code>SCI_ADDSELECTION</code></p>
<p>
<b id="SCI_SETMAINSELECTION">SCI_SETMAINSELECTION(int selection)</b><br />
<b id="SCI_GETMAINSELECTION">SCI_GETMAINSELECTION</b><br />
One of the selections is the main selection which is used to determine what range of text is automatically visible.
The main selection may be displayed in different colours or with a differently styled caret.
Only an already existing selection can be made main.</p>
<p>
<b id="SCI_SETSELECTIONNCARET">SCI_SETSELECTIONNCARET(int selection, int pos)</b><br />
<b id="SCI_GETSELECTIONNCARET">SCI_GETSELECTIONNCARET(int selection)</b><br />
<b id="SCI_SETSELECTIONNCARETVIRTUALSPACE">SCI_SETSELECTIONNCARETVIRTUALSPACE(int selection, int space)</b><br />
<b id="SCI_GETSELECTIONNCARETVIRTUALSPACE">SCI_GETSELECTIONNCARETVIRTUALSPACE(int selection)</b><br />
<b id="SCI_SETSELECTIONNANCHOR">SCI_SETSELECTIONNANCHOR(int selection, int posAnchor)</b><br />
<b id="SCI_GETSELECTIONNANCHOR">SCI_GETSELECTIONNANCHOR(int selection)</b><br />
<b id="SCI_SETSELECTIONNANCHORVIRTUALSPACE">SCI_SETSELECTIONNANCHORVIRTUALSPACE(int selection, int space)</b><br />
<b id="SCI_GETSELECTIONNANCHORVIRTUALSPACE">SCI_GETSELECTIONNANCHORVIRTUALSPACE(int selection)</b><br />
Set or query the position and amount of virtual space for the caret and anchor of each already existing selection.</p>
<p>
<b id="SCI_SETSELECTIONNSTART">SCI_SETSELECTIONNSTART(int selection, int pos)</b><br />
<b id="SCI_GETSELECTIONNSTART">SCI_GETSELECTIONNSTART(int selection)</b><br />
<b id="SCI_SETSELECTIONNEND">SCI_SETSELECTIONNEND(int selection, int pos)</b><br />
<b id="SCI_GETSELECTIONNEND">SCI_GETSELECTIONNEND(int selection)</b><br />
Set or query the start and end position of each already existing selection.
Mostly of use to query each range for its text.</p>
<p>
<b id="SCI_SETRECTANGULARSELECTIONCARET">SCI_SETRECTANGULARSELECTIONCARET(int pos)</b><br />
<b id="SCI_GETRECTANGULARSELECTIONCARET">SCI_GETRECTANGULARSELECTIONCARET</b><br />
<b id="SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE">SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE(int space)</b><br />
<b id="SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE">SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE</b><br />
<b id="SCI_SETRECTANGULARSELECTIONANCHOR">SCI_SETRECTANGULARSELECTIONANCHOR(int posAnchor)</b><br />
<b id="SCI_GETRECTANGULARSELECTIONANCHOR">SCI_GETRECTANGULARSELECTIONANCHOR</b><br />
<b id="SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE">SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE(int space)</b><br />
<b id="SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE">SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE</b><br />
Set or query the position and amount of virtual space for the caret and anchor of the rectangular selection.
After setting the rectangular selection, this is broken down into multiple selections, one for each line.</p>
<p>
<b id="SCI_SETADDITIONALSELALPHA">SCI_SETADDITIONALSELALPHA(int alpha)</b><br />
<b id="SCI_GETADDITIONALSELALPHA">SCI_GETADDITIONALSELALPHA</b><br />
<b id="SCI_SETADDITIONALSELFORE">SCI_SETADDITIONALSELFORE(int <a class="jump" href="#colour">colour</a>)</b><br />
<b id="SCI_SETADDITIONALSELBACK">SCI_SETADDITIONALSELBACK(int <a class="jump" href="#colour">colour</a>)</b><br />
Modify the appearence of additional selections so that they can be differentiated from the main selection which has its appearence set with
<a class="message" href="#SCI_SETSELALPHA"><code>SCI_SETSELALPHA</code></a>,
<a class="message" href="#SCI_GETSELALPHA"><code>SCI_GETSELALPHA</code></a>,
<a class="message" href="#SCI_SETSELFORE"><code>SCI_SETSELFORE</code></a>, and
<a class="message" href="#SCI_SETSELBACK"><code>SCI_SETSELBACK</code></a>.</p>
<p>
<b id="SCI_SETADDITIONALCARETFORE">SCI_SETADDITIONALCARETFORE(int <a class="jump" href="#colour">colour</a>)</b><br />
<b id="SCI_GETADDITIONALCARETFORE">SCI_GETADDITIONALCARETFORE</b><br />
<b id="SCI_SETADDITIONALCARETSBLINK">SCI_SETADDITIONALCARETSBLINK(bool additionalCaretsBlink)</b><br />
<b id="SCI_GETADDITIONALCARETSBLINK">SCI_GETADDITIONALCARETSBLINK</b><br />
Modify the appearence of additional carets so that they can be differentiated from the main caret which has its appearence set with
<a class="message" href="#SCI_SETCARETFORE"><code>SCI_SETCARETFORE</code></a>,
<a class="message" href="#SCI_GETCARETFORE"><code>SCI_GETCARETFORE</code></a>,
<a class="message" href="#SCI_SETCARETPERIOD"><code>SCI_SETCARETPERIOD</code></a>, and
<a class="message" href="#SCI_GETCARETPERIOD"><code>SCI_GETCARETPERIOD</code></a>.</p>
<p>
<b id="SCI_SWAPMAINANCHORCARET">SCI_SWAPMAINANCHORCARET</b><br />
<b id="SCI_ROTATESELECTION">SCI_ROTATESELECTION</b><br />
These commands may be assigned to keys to make it possible to manipulate multiple selections.
<code>SCI_SWAPMAINANCHORCARET</code> moves the caret to the opposite end of the main selection.
<code>SCI_ROTATESELECTION</code> makes the next selection be the main selection.
</p>
<h2 id="ScrollingAndAutomaticScrolling">Scrolling and automatic scrolling</h2> <h2 id="ScrollingAndAutomaticScrolling">Scrolling and automatic scrolling</h2>
<code><a class="message" href="#SCI_LINESCROLL">SCI_LINESCROLL(int column, int line)</a><br /> <code><a class="message" href="#SCI_LINESCROLL">SCI_LINESCROLL(int column, int line)</a><br />
<a class="message" href="#SCI_SCROLLCARET">SCI_SCROLLCARET</a><br /> <a class="message" href="#SCI_SCROLLCARET">SCI_SCROLLCARET</a><br />
@ -1714,7 +1958,7 @@ struct TextToFind {
<p><b id="SCI_SETVIEWWS">SCI_SETVIEWWS(int wsMode)</b><br /> <p><b id="SCI_SETVIEWWS">SCI_SETVIEWWS(int wsMode)</b><br />
<b id="SCI_GETVIEWWS">SCI_GETVIEWWS</b><br /> <b id="SCI_GETVIEWWS">SCI_GETVIEWWS</b><br />
White space can be made visible which may useful for languages in which white space is White space can be made visible which may be useful for languages in which white space is
significant, such as Python. Space characters appear as small centred dots and tab characters significant, such as Python. Space characters appear as small centred dots and tab characters
as light arrows pointing to the right. There are also ways to control the display of <a as light arrows pointing to the right. There are also ways to control the display of <a
class="jump" href="#LineEndings">end of line characters</a>. The two messages set and get the class="jump" href="#LineEndings">end of line characters</a>. The two messages set and get the
@ -2067,7 +2311,7 @@ struct TextToFind {
<a class="message" href="#SCI_STYLEGETFORE">SCI_STYLEGETFORE(int styleNumber)</a><br /> <a class="message" href="#SCI_STYLEGETFORE">SCI_STYLEGETFORE(int styleNumber)</a><br />
<a class="message" href="#SCI_STYLESETBACK">SCI_STYLESETBACK(int styleNumber, int <a class="message" href="#SCI_STYLESETBACK">SCI_STYLESETBACK(int styleNumber, int
colour)</a><br /> colour)</a><br />
<a class="message" href="#SCI_STYLEGETBACK">SCI_STYLESETBACK(int styleNumber)</a><br /> <a class="message" href="#SCI_STYLEGETBACK">SCI_STYLEGETBACK(int styleNumber)</a><br />
<a class="message" href="#SCI_STYLESETEOLFILLED">SCI_STYLESETEOLFILLED(int styleNumber, bool <a class="message" href="#SCI_STYLESETEOLFILLED">SCI_STYLESETEOLFILLED(int styleNumber, bool
eolFilled)</a><br /> eolFilled)</a><br />
<a class="message" href="#SCI_STYLEGETEOLFILLED">SCI_STYLEGETEOLFILLED(int styleNumber)</a><br /> <a class="message" href="#SCI_STYLEGETEOLFILLED">SCI_STYLEGETEOLFILLED(int styleNumber)</a><br />
@ -2588,7 +2832,7 @@ struct TextToFind {
<td>2</td> <td>2</td>
<td>Annotations are indented 40 pixels and are surrounded by a box.</td> <td>Annotations are indented to match the text and are surrounded by a box.</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -2768,7 +3012,7 @@ struct TextToFind {
<p><b id="SCI_BRACEBADLIGHT">SCI_BRACEBADLIGHT(int pos1)</b><br /> <p><b id="SCI_BRACEBADLIGHT">SCI_BRACEBADLIGHT(int pos1)</b><br />
If there is no matching brace then the <a class="jump" href="#StyleDefinition">brace If there is no matching brace then the <a class="jump" href="#StyleDefinition">brace
badlighting style</a>, style <code>BRACE_BADLIGHT</code> (35), can be used to show the brace badlighting style</a>, style <code>STYLE_BRACEBAD</code> (35), can be used to show the brace
that is unmatched. Using a position of <code>INVALID_POSITION</code> (-1) removes the that is unmatched. Using a position of <code>INVALID_POSITION</code> (-1) removes the
highlight.</p> highlight.</p>
@ -2965,11 +3209,12 @@ struct TextToFind {
<code>SC_MARK_SMALLRECT</code>, <code>SC_MARK_SHORTARROW</code>, <code>SC_MARK_EMPTY</code>, <code>SC_MARK_SMALLRECT</code>, <code>SC_MARK_SHORTARROW</code>, <code>SC_MARK_EMPTY</code>,
<code>SC_MARK_ARROWDOWN</code>, <code>SC_MARK_MINUS</code>, <code>SC_MARK_PLUS</code>, <code>SC_MARK_ARROWDOWN</code>, <code>SC_MARK_MINUS</code>, <code>SC_MARK_PLUS</code>,
<code>SC_MARK_ARROWS</code>, <code>SC_MARK_DOTDOTDOT</code>, <code>SC_MARK_EMPTY</code>, <code>SC_MARK_ARROWS</code>, <code>SC_MARK_DOTDOTDOT</code>, <code>SC_MARK_EMPTY</code>,
<code>SC_MARK_BACKGROUND</code>, <code>SC_MARK_LEFTRECT</code> <code>SC_MARK_BACKGROUND</code>, <code>SC_MARK_LEFTRECT</code>,
and <code>SC_MARK_FULLRECT</code>.</p> <code>SC_MARK_FULLRECT</code>, and <code>SC_MARK_UNDERLINE</code>.</p>
<p>The <code>SC_MARK_BACKGROUND</code> marker changes the background colour of the line only. <p>The <code>SC_MARK_BACKGROUND</code> marker changes the background colour of the line only.
The <code>SC_MARK_FULLRECT</code> symbol mirrors this, changing only the margin background colour. The <code>SC_MARK_FULLRECT</code> symbol mirrors this, changing only the margin background colour.
<code>SC_MARK_UNDERLINE</code> draws an underline across the text.
The <code>SC_MARK_EMPTY</code> symbol is invisible, allowing client code to track the movement The <code>SC_MARK_EMPTY</code> symbol is invisible, allowing client code to track the movement
of lines. You would also use it if you changed the folding style and wanted one or more of the of lines. You would also use it if you changed the folding style and wanted one or more of the
<code>SC_FOLDERNUM_</code>* markers to have no associated symbol.</p> <code>SC_FOLDERNUM_</code>* markers to have no associated symbol.</p>
@ -3130,7 +3375,7 @@ struct TextToFind {
<p><b id="SCI_MARKERSETALPHA">SCI_MARKERSETALPHA(int markerNumber, int <a class="jump" <p><b id="SCI_MARKERSETALPHA">SCI_MARKERSETALPHA(int markerNumber, int <a class="jump"
href="#alpha">alpha</a>)</b><br /> href="#alpha">alpha</a>)</b><br />
When markers are drawn in the content area, either because there is no margin for them or When markers are drawn in the content area, either because there is no margin for them or
they are of SC_MARK_BACKGROUND type, they may be drawn translucently by they are of <code>SC_MARK_BACKGROUND</code> or <code>SC_MARK_UNDERLINE</code> types, they may be drawn translucently by
setting an alpha value.</p> setting an alpha value.</p>
<p><b id="SCI_MARKERADD">SCI_MARKERADD(int line, int markerNumber)</b><br /> <p><b id="SCI_MARKERADD">SCI_MARKERADD(int line, int markerNumber)</b><br />
@ -4516,6 +4761,8 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
<a class="message" href="#SCI_GETWRAPVISUALFLAGS">SCI_GETWRAPVISUALFLAGS</a><br /> <a class="message" href="#SCI_GETWRAPVISUALFLAGS">SCI_GETWRAPVISUALFLAGS</a><br />
<a class="message" href="#SCI_SETWRAPVISUALFLAGSLOCATION">SCI_SETWRAPVISUALFLAGSLOCATION(int wrapVisualFlagsLocation)</a><br /> <a class="message" href="#SCI_SETWRAPVISUALFLAGSLOCATION">SCI_SETWRAPVISUALFLAGSLOCATION(int wrapVisualFlagsLocation)</a><br />
<a class="message" href="#SCI_GETWRAPVISUALFLAGSLOCATION">SCI_GETWRAPVISUALFLAGSLOCATION</a><br /> <a class="message" href="#SCI_GETWRAPVISUALFLAGSLOCATION">SCI_GETWRAPVISUALFLAGSLOCATION</a><br />
<a class="message" href="#SCI_SETWRAPINDENTMODE">SCI_SETWRAPINDENTMODE(int indentMode)</a><br />
<a class="message" href="#SCI_GETWRAPINDENTMODE">SCI_GETWRAPINDENTMODE</a><br />
<a class="message" href="#SCI_SETWRAPSTARTINDENT">SCI_SETWRAPSTARTINDENT(int indent)</a><br /> <a class="message" href="#SCI_SETWRAPSTARTINDENT">SCI_SETWRAPSTARTINDENT(int indent)</a><br />
<a class="message" href="#SCI_GETWRAPSTARTINDENT">SCI_GETWRAPSTARTINDENT</a><br /> <a class="message" href="#SCI_GETWRAPSTARTINDENT">SCI_GETWRAPSTARTINDENT</a><br />
<a class="message" href="#SCI_SETLAYOUTCACHE">SCI_SETLAYOUTCACHE(int cacheMode)</a><br /> <a class="message" href="#SCI_SETLAYOUTCACHE">SCI_SETLAYOUTCACHE(int cacheMode)</a><br />
@ -4535,7 +4782,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
<p>For wrapped lines Scintilla can draw visual flags (little arrows) at end of a a subline of a <p>For wrapped lines Scintilla can draw visual flags (little arrows) at end of a a subline of a
wrapped line and at begin of the next subline. These can be enabled individually, but if Scintilla wrapped line and at begin of the next subline. These can be enabled individually, but if Scintilla
draws the visual flag at begin of the next subline this subline will be indented by one char. draws the visual flag at the beginning of the next subline this subline will be indented by one char.
Independent from drawing a visual flag at the begin the subline can have an indention.</p> Independent from drawing a visual flag at the begin the subline can have an indention.</p>
<p>Much of the time used by Scintilla is spent on laying out and drawing text. The same text <p>Much of the time used by Scintilla is spent on laying out and drawing text. The same text
@ -4606,7 +4853,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
<p><b id="SCI_SETWRAPVISUALFLAGSLOCATION">SCI_SETWRAPVISUALFLAGSLOCATION(int wrapVisualFlagsLocation)</b><br /> <p><b id="SCI_SETWRAPVISUALFLAGSLOCATION">SCI_SETWRAPVISUALFLAGSLOCATION(int wrapVisualFlagsLocation)</b><br />
<b id="SCI_GETWRAPVISUALFLAGSLOCATION">SCI_GETWRAPVISUALFLAGSLOCATION</b><br /> <b id="SCI_GETWRAPVISUALFLAGSLOCATION">SCI_GETWRAPVISUALFLAGSLOCATION</b><br />
You can set wether the visual flags to indicate a line is wrapped are drawn near the border or near the text. You can set whether the visual flags to indicate a line is wrapped are drawn near the border or near the text.
Bits set in wrapVisualFlagsLocation set the location to near the text for the corresponding visual flag. Bits set in wrapVisualFlagsLocation set the location to near the text for the corresponding visual flag.
<table cellpadding="1" cellspacing="2" border="0" summary="Wrap visual flags locations"> <table cellpadding="1" cellspacing="2" border="0" summary="Wrap visual flags locations">
@ -4634,7 +4881,45 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
<tr> <tr>
<td align="left"><code>SC_WRAPVISUALFLAGLOC_START_BY_TEXT</code></td> <td align="left"><code>SC_WRAPVISUALFLAGLOC_START_BY_TEXT</code></td>
<td align="center">2</td> <td align="center">2</td>
<td>Visual flag at begin of subline drawn near text</td> <td>Visual flag at beginning of subline drawn near text</td>
</tr>
</tbody>
</table>
</p>
<p><b id="SCI_SETWRAPINDENTMODE">SCI_SETWRAPINDENTMODE(int indentMode)</b><br />
<b id="SCI_GETWRAPINDENTMODE">SCI_GETWRAPINDENTMODE</b><br />
Wrapped sublines can be indented to the position of their first subline or one more indent level.
The default is <code>SC_WRAPINDENT_FIXED</code>.
The modes are:
<table cellpadding="1" cellspacing="2" border="0" summary="Wrap visual flags locations">
<tbody>
<tr>
<th align="left">Symbol</th>
<th>Value</th>
<th align="left">Effect</th>
</tr>
</tbody>
<tbody valign="top">
<tr>
<td align="left"><code>SC_WRAPINDENT_FIXED</code></td>
<td align="center">0</td>
<td>Wrapped sublines aligned to left of window plus amount set by
<a class="message" href="#SCI_SETWRAPSTARTINDENT">SCI_SETWRAPSTARTINDENT</a></td>
</tr>
<tr>
<td align="left"><code>SC_WRAPINDENT_SAME</code></td>
<td align="center">1</td>
<td>Wrapped sublines are aligned to first subline indent</td>
</tr>
<tr>
<td align="left"><code>SC_WRAPINDENT_INDENT</code></td>
<td align="center">2</td>
<td>Wrapped sublines are aligned to first subline indent plus one more level of indentation</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -4643,7 +4928,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
<p><b id="SCI_SETWRAPSTARTINDENT">SCI_SETWRAPSTARTINDENT(int indent)</b><br /> <p><b id="SCI_SETWRAPSTARTINDENT">SCI_SETWRAPSTARTINDENT(int indent)</b><br />
<b id="SCI_GETWRAPSTARTINDENT">SCI_GETWRAPSTARTINDENT</b><br /> <b id="SCI_GETWRAPSTARTINDENT">SCI_GETWRAPSTARTINDENT</b><br />
<code>SCI_SETWRAPSTARTINDENT</code> sets the size of indentation of sublines for <code>SCI_SETWRAPSTARTINDENT</code> sets the size of indentation of sublines for
wrapped lines in terms of the width of a space in wrapped lines in terms of the average character width in
<a class="message" href="#StyleDefinition"><code>STYLE_DEFAULT</code></a>. <a class="message" href="#StyleDefinition"><code>STYLE_DEFAULT</code></a>.
There are no limits on indent sizes, but values less than 0 or large values may have There are no limits on indent sizes, but values less than 0 or large values may have
undesirable effects.<br /> undesirable effects.<br />

View File

@ -25,9 +25,9 @@
<table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0"> <table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
<tr> <tr>
<td> <td>
<font size="4"> <a href="http://prdownloads.sourceforge.net/scintilla/scintilla178.zip?download"> <font size="4"> <a href="http://prdownloads.sourceforge.net/scintilla/scintilla201.zip?download">
Windows</a>&nbsp;&nbsp; Windows</a>&nbsp;&nbsp;
<a href="http://prdownloads.sourceforge.net/scintilla/scintilla178.tgz?download"> <a href="http://prdownloads.sourceforge.net/scintilla/scintilla201.tgz?download">
GTK+/Linux</a>&nbsp;&nbsp; GTK+/Linux</a>&nbsp;&nbsp;
</font> </font>
</td> </td>
@ -41,7 +41,7 @@
containing very few restrictions. containing very few restrictions.
</p> </p>
<h3> <h3>
Release 1.78 Release 2.01
</h3> </h3>
<h4> <h4>
Source Code Source Code
@ -49,8 +49,8 @@
The source code package contains all of the source code for Scintilla but no binary The source code package contains all of the source code for Scintilla but no binary
executable code and is available in executable code and is available in
<ul> <ul>
<li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla178.zip?download">zip format</a> (960K) commonly used on Windows</li> <li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla201.zip?download">zip format</a> (1130K) commonly used on Windows</li>
<li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla178.tgz?download">tgz format</a> (800K) commonly used on Linux and compatible operating systems</li> <li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla201.tgz?download">tgz format</a> (970K) commonly used on Linux and compatible operating systems</li>
</ul> </ul>
Instructions for building on both Windows and Linux are included in the readme file. Instructions for building on both Windows and Linux are included in the readme file.
<h4> <h4>

View File

@ -332,6 +332,13 @@
<td>James Moffatt</td> <td>James Moffatt</td>
</tr><tr> </tr><tr>
<td>Yuzhou Xin</td> <td>Yuzhou Xin</td>
<td>Nic Jansma</td>
<td>Evan Jones</td>
<td>Mike Lischke</td>
</tr><tr>
<td>Eric Kidd</td>
<td>maXmo</td>
<td>David Severwright</td>
</tr> </tr>
</table> </table>
<p> <p>
@ -343,6 +350,198 @@
Icons</a> Copyright(C) 1998 by Dean S. Jones<br /> Icons</a> Copyright(C) 1998 by Dean S. Jones<br />
</li> </li>
</ul> </ul>
<h3>
<a href="http://prdownloads.sourceforge.net/scintilla/scite201.zip?download">Release 2.01</a>
</h3>
<ul>
<li>
Released on 19 August 2009.
</li>
<li>
Fix to positioning rectangular paste when viewing line ends.
</li>
<li>
Don't insert new lines and indentation for line ends at end of rectangular paste.
</li>
<li>
When not in additional selection typing mode, cutting a rectangular selection removes all of the selected text.
</li>
<li>
Rectangular selections are copied to the clipboard in document order, not in the order of selection.
</li>
<li>
SCI_SETCURRENTPOS and SCI_SETANCHOR work in rectangular mode.
</li>
<li>
On GTK+, drag and drop to a later position in the document now drops at the position.
</li>
<li>
Fix bug where missing property did not use default value.
</li>
</ul>
<h3>
<a href="http://prdownloads.sourceforge.net/scintilla/scite200.zip?download">Release 2.0</a>
</h3>
<ul>
<li>
Released on 11 August 2009.
</li>
<li>
Multiple pieces of text can be selected simultaneously by holding control whil dragging the mouse.
Typing, backspace and delete may affect all selections together.
</li>
<li>
Virtual space allows selecting beyond the last character on a line.
</li>
<li>
SciTE on GTK+ path bar is now optional and defaults to off.
</li>
<li>
MagikSF lexer recognises numbers correctly.
</li>
<li>
Folding of Python comments and blank lines improved. Bug #210240.
</li>
<li>
Bug fixed where background colour of last character in document leaked past that character.
</li>
<li>
Crash fixed when adding marker beyond last line in document. Bug #2830307.
</li>
<li>
Resource leak fixed in SciTE for Windows when printing fails. Bug #2816524.
</li>
<li>
Bug fixed on Windows where the system caret was destroyed during destruction when another window
was using the system caret. Bug #2830223.
</li>
<li>
Bug fixed where indentation guides were drawn over text when the indentation used a style with a different
space width to the default style.
</li>
<li>
SciTE bug fixed where box comment added a bare line feed rather than the chosen line end. Bug #2818104.
</li>
<li>
Reverted fix that led to wrapping whole document when displaying the first line of the document.
</li>
<li>
Export to LaTeX in SciTE fixed to work in more cases and not use as much space. Bug #1286548.
</li>
<li>
Bug fixed where EN_CHANGE notification was sent when performing a paste operation in a
read-only document. Bug #2825485.
</li>
<li>
Refactored code so that Scintilla exposes less of its internal implementation and uses the C++ standard
library for some basic collections. Projects that linked to Scintilla's SString or PropSet classes
should copy this code from a previous version of Scintilla or from SciTE.
</li>
</ul>
<h3>
<a href="http://prdownloads.sourceforge.net/scintilla/scite179.zip?download">Release 1.79</a>
</h3>
<ul>
<li>
Released on 1 July 2009.
</li>
<li>
Memory exhaustion and other exceptions handled by placing an error value into the
status property rather than crashing.
Scintilla now builds with exception handling enabled and requires exception handling to be enabled. <br />
This is a major change and application developers should consider how they will deal with Scintilla exhausting
memory since Scintilla may not be in a stable state.
</li>
<li>
Deprecated APIs removed. The symbols removed are:
<ul>
<li>SCI_SETCARETPOLICY</li>
<li> CARET_CENTER</li>
<li> CARET_XEVEN</li>
<li> CARET_XJUMPS</li>
<li> SC_FOLDFLAG_BOX</li>
<li> SC_FOLDLEVELBOXHEADERFLAG</li>
<li> SC_FOLDLEVELBOXFOOTERFLAG</li>
<li> SC_FOLDLEVELCONTRACTED</li>
<li> SC_FOLDLEVELUNINDENT</li>
<li> SCN_POSCHANGED</li>
<li> SCN_CHECKBRACE</li>
<li> SCLEX_ASP</li>
<li> SCLEX_PHP</li>
</ul>
</li>
<li>
Cocoa platform added.
</li>
<li>
Names of struct types in Scintilla.h now start with "Sci_" to avoid possible clashes with platform
definitions. Currently, the old names still work but these will be phased out.
</li>
<li>
When lines are wrapped, subsequent lines may be indented to match the indent of the initial line,
or one more indentation level. Feature #2796119.
</li>
<li>
APIs added for finding the character at a point rather than an inter-character position. Feature #2646738.
</li>
<li>
A new marker SC_MARK_BACKGROUND_UNDERLINE is drawn in the text area as an underline
the full width of the window.
</li>
<li>
Batch file lexer understands variables surrounded by '!'.
</li>
<li>
CAML lexer also supports SML.
</li>
<li>
D lexer handles string and numeric literals more accurately. Feature #2793782.
</li>
<li>
Forth lexer is now case-insensitive and better supports numbers like $hex and %binary. Feature #2804894.
</li>
<li>
Lisp lexer treats '[', ']', '{', and '}' as balanced delimiters which is common usage. Feature #2794989.<br />
It treats keyword argument names as being equivalent to symbols. Feature #2794901.
</li>
<li>
Pascal lexer bug fixed to prevent hang when 'interface' near beginning of file. Bug #2802863.
</li>
<li>
Perl lexer bug fixed where previous lexical states persisted causing "/" special case styling and
subroutine prototype styling to not be correct. Bug #2809168.
</li>
<li>
XML lexer fixes bug where Unicode entities like '&amp;—' were broken into fragments. Bug #2804760.
</li>
<li>
SciTE on GTK+ enables scrolling the tab bar on recent versions of GTK+. Feature #2061821.
</li>
<li>
SciTE on Windows allows tab bar tabs to be reordered by drag and drop.
</li>
<li>
Unit test script for Scintilla on Windows included with source code.
</li>
<li>
User defined menu items are now localised when there is a matching translation.
</li>
<li>
Width of icon column of autocompletion lists on GTK+ made more consistent.
</li>
<li>
Bug with slicing UTF-8 text into character fragments when there is a sequence of 100 or more 3 byte characters. Bug #2780566.
</li>
<li>
Folding bugs introduced in 1.78 fixed. Some of the fix was generic and there was also a specific fix for C++.
</li>
<li>
Bug fixed where a rectangular paste was not padding the line with sufficient spaces to align the pasted text.
</li>
<li>
Bug fixed with showing all text on each line of multi-line annotations when styling the whole annotation using SCI_ANNOTATIONSETSTYLE. Bug #2789430.
</li>
</ul>
<h3> <h3>
<a href="http://prdownloads.sourceforge.net/scintilla/scite178.zip?download">Release 1.78</a> <a href="http://prdownloads.sourceforge.net/scintilla/scite178.zip?download">Release 1.78</a>
</h3> </h3>

View File

@ -9,7 +9,7 @@
<meta name="keywords" content="Scintilla, SciTE, Editing Component, Text Editor" /> <meta name="keywords" content="Scintilla, SciTE, Editing Component, Text Editor" />
<meta name="Description" <meta name="Description"
content="www.scintilla.org is the home of the Scintilla editing component and SciTE text editor application." /> content="www.scintilla.org is the home of the Scintilla editing component and SciTE text editor application." />
<meta name="Date.Modified" content="20090428" /> <meta name="Date.Modified" content="20090819" />
<style type="text/css"> <style type="text/css">
.versionlist { .versionlist {
color: #FFCC99; color: #FFCC99;
@ -36,8 +36,8 @@
GTK+</font> GTK+</font>
</td> </td>
<td width="40%" align="right"> <td width="40%" align="right">
<font color="#FFCC99" size="3"> Release version 1.78<br /> <font color="#FFCC99" size="3"> Release version 2.01<br />
Site last modified April 28 2009</font> Site last modified August 19 2009</font>
</td> </td>
<td width="20%"> <td width="20%">
&nbsp; &nbsp;
@ -52,6 +52,23 @@
</tr> </tr>
</table> </table>
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="6" border="0"> <table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="6" border="0">
<tr>
<td width="100%">
<span class="versionlist">Version 2.01 fixes some problems with multiple selection.</span>
</td>
</tr>
<tr>
<td width="100%">
<span class="versionlist">Version 2.0 supports multiple selection and virtual space.</span>
</td>
</tr>
<tr>
<td width="100%">
<span class="versionlist">Version 1.79 reports memory exhaustion instead of crashing.<br />
This is a major change and application developers should consider how they will deal with Scintilla exhausting
memory since Scintilla may not be in a stable state.</span>
</td>
</tr>
<tr> <tr>
<td width="100%"> <td width="100%">
<span class="versionlist">Version 1.78 allows annotation lines to be displayed beneath each document line <span class="versionlist">Version 1.78 allows annotation lines to be displayed beneath each document line
@ -68,40 +85,6 @@
<span class="versionlist">Version 1.76 fixes some minor bugs.</span> <span class="versionlist">Version 1.76 fixes some minor bugs.</span>
</td> </td>
</tr> </tr>
<tr>
<td width="100%">
<span class="versionlist">Version 1.75 displays invalid UTF-8 bytes as hexadecimal and
can show indentation guides on completely empty lines.</span>
</td>
</tr>
<tr>
<td width="100%">
<span class="versionlist">Version 1.74 runs natively on OS X.
Indicators are separated from the style buffer so there can be more indicators.
Wide lines are faster.</span>
</td>
</tr>
<tr>
<td width="100%">
<span class="versionlist">Version 1.73 allows style changes to be made during text modification events.</span>
</td>
</tr>
<tr>
<td width="100%">
<span class="versionlist">Version 1.72 is more efficient at handling per-line information.</span>
</td>
</tr>
<tr>
<td width="100%">
<span class="versionlist">Version 1.71 has some internationalisation fixes.</span>
</td>
</tr>
<tr>
<td width="100%">
<span class="versionlist">Version 1.70 allows, on GTK+, approximate character set conversions
for pasting and uses internationalised input at all times.</span>
</td>
</tr>
</table> </table>
<table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0"> <table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
<tr> <tr>
@ -160,8 +143,8 @@ if (IsRemote()) {
</p> </p>
<p> <p>
Scintilla and SciTE are currently available for Intel Win32 and Linux compatible operating 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 Fedora 8 systems with GTK+. They have been run on Windows XP, Windows 7RC, and on Ubuntu 9.04
with GTK+ 2.12. <a href="http://www.scintilla.org/SciTEImage.html">Here is a screenshot of with GTK+ 2.16. <a href="http://www.scintilla.org/SciTEImage.html">Here is a screenshot of
SciTE.</a><br /> SciTE.</a><br />
</p> </p>
<p> <p>

View File

@ -173,8 +173,8 @@ static FontHandle *PFont(Font &f) {
return reinterpret_cast<FontHandle *>(f.GetID()); return reinterpret_cast<FontHandle *>(f.GetID());
} }
static GtkWidget *PWidget(WindowID id) { static GtkWidget *PWidget(WindowID wid) {
return reinterpret_cast<GtkWidget *>(id); return reinterpret_cast<GtkWidget *>(wid);
} }
static GtkWidget *PWidget(Window &w) { static GtkWidget *PWidget(Window &w) {
@ -421,7 +421,7 @@ class FontCached : Font {
static FontCached *first; static FontCached *first;
public: public:
static FontID FindOrCreate(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_); static FontID FindOrCreate(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_);
static void ReleaseId(FontID id_); static void ReleaseId(FontID fid_);
}; };
FontCached *FontCached::first = 0; FontCached *FontCached::first = 0;
@ -430,7 +430,7 @@ FontCached::FontCached(const char *faceName_, int characterSet_, int size_, bool
next(0), usage(0), hash(0) { next(0), usage(0), hash(0) {
::SetLogFont(lf, faceName_, characterSet_, size_, bold_, italic_); ::SetLogFont(lf, faceName_, characterSet_, size_, bold_, italic_);
hash = HashFont(faceName_, characterSet_, size_, bold_, italic_); hash = HashFont(faceName_, characterSet_, size_, bold_, italic_);
id = CreateNewFont(faceName_, characterSet_, size_, bold_, italic_); fid = CreateNewFont(faceName_, characterSet_, size_, bold_, italic_);
usage = 1; usage = 1;
} }
@ -444,9 +444,9 @@ bool FontCached::SameAs(const char *faceName_, int characterSet_, int size_, boo
} }
void FontCached::Release() { void FontCached::Release() {
if (id) if (fid)
delete PFont(*this); delete PFont(*this);
id = 0; fid = 0;
} }
FontID FontCached::FindOrCreate(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_) { FontID FontCached::FindOrCreate(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_) {
@ -457,7 +457,7 @@ FontID FontCached::FindOrCreate(const char *faceName_, int characterSet_, int si
if ((cur->hash == hashFind) && if ((cur->hash == hashFind) &&
cur->SameAs(faceName_, characterSet_, size_, bold_, italic_)) { cur->SameAs(faceName_, characterSet_, size_, bold_, italic_)) {
cur->usage++; cur->usage++;
ret = cur->id; ret = cur->fid;
} }
} }
if (ret == 0) { if (ret == 0) {
@ -465,18 +465,18 @@ FontID FontCached::FindOrCreate(const char *faceName_, int characterSet_, int si
if (fc) { if (fc) {
fc->next = first; fc->next = first;
first = fc; first = fc;
ret = fc->id; ret = fc->fid;
} }
} }
FontMutexUnlock(); FontMutexUnlock();
return ret; return ret;
} }
void FontCached::ReleaseId(FontID id_) { void FontCached::ReleaseId(FontID fid_) {
FontMutexLock(); FontMutexLock();
FontCached **pcur = &first; FontCached **pcur = &first;
for (FontCached *cur = first; cur; cur = cur->next) { for (FontCached *cur = first; cur; cur = cur->next) {
if (cur->id == id_) { if (cur->fid == fid_) {
cur->usage--; cur->usage--;
if (cur->usage == 0) { if (cur->usage == 0) {
*pcur = cur->next; *pcur = cur->next;
@ -661,20 +661,20 @@ FontID FontCached::CreateNewFont(const char *fontName, int characterSet,
return new FontHandle(newid); return new FontHandle(newid);
} }
Font::Font() : id(0) {} Font::Font() : fid(0) {}
Font::~Font() {} Font::~Font() {}
void Font::Create(const char *faceName, int characterSet, int size, void Font::Create(const char *faceName, int characterSet, int size,
bool bold, bool italic, bool) { bool bold, bool italic, bool) {
Release(); Release();
id = FontCached::FindOrCreate(faceName, characterSet, size, bold, italic); fid = FontCached::FindOrCreate(faceName, characterSet, size, bold, italic);
} }
void Font::Release() { void Font::Release() {
if (id) if (fid)
FontCached::ReleaseId(id); FontCached::ReleaseId(fid);
id = 0; fid = 0;
} }
// Required on OS X // Required on OS X
@ -1057,6 +1057,19 @@ void SurfaceImpl::AlphaRectangle(PRectangle rc, int , ColourAllocated , int , Co
} }
} }
#else #else
static guint32 u32FromRGBA(guint8 r, guint8 g, guint8 b, guint8 a) {
union {
guint8 pixVal[4];
guint32 val;
} converter;
converter.pixVal[0] = r;
converter.pixVal[1] = g;
converter.pixVal[2] = b;
converter.pixVal[3] = a;
return converter.val;
}
void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, ColourAllocated fill, int alphaFill, void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, ColourAllocated fill, int alphaFill,
ColourAllocated outline, int alphaOutline, int flags) { ColourAllocated outline, int alphaOutline, int flags) {
if (gc && drawable && rc.Width() > 0) { if (gc && drawable && rc.Width() > 0) {
@ -1067,18 +1080,11 @@ void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, ColourAllocated
// Make a 32 bit deep pixbuf with alpha // Make a 32 bit deep pixbuf with alpha
GdkPixbuf *pixalpha = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, width, height); GdkPixbuf *pixalpha = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, width, height);
guint8 pixVal[4] = {0}; guint32 valEmpty = u32FromRGBA(0,0,0,0);
guint32 valEmpty = *(reinterpret_cast<guint32 *>(pixVal)); guint32 valFill = u32FromRGBA(GetRValue(fill.AsLong()),
pixVal[0] = GetRValue(fill.AsLong()); GetGValue(fill.AsLong()), GetBValue(fill.AsLong()), alphaFill);
pixVal[1] = GetGValue(fill.AsLong()); guint32 valOutline = u32FromRGBA(GetRValue(outline.AsLong()),
pixVal[2] = GetBValue(fill.AsLong()); GetGValue(outline.AsLong()), GetBValue(outline.AsLong()), alphaOutline);
pixVal[3] = alphaFill;
guint32 valFill = *(reinterpret_cast<guint32 *>(pixVal));
pixVal[0] = GetRValue(outline.AsLong());
pixVal[1] = GetGValue(outline.AsLong());
pixVal[2] = GetBValue(outline.AsLong());
pixVal[3] = alphaOutline;
guint32 valOutline = *(reinterpret_cast<guint32 *>(pixVal));
guint32 *pixels = reinterpret_cast<guint32 *>(gdk_pixbuf_get_pixels(pixalpha)); guint32 *pixels = reinterpret_cast<guint32 *>(gdk_pixbuf_get_pixels(pixalpha));
int stride = gdk_pixbuf_get_rowstride(pixalpha) / 4; int stride = gdk_pixbuf_get_rowstride(pixalpha) / 4;
for (int yr=0; yr<height; yr++) { for (int yr=0; yr<height; yr++) {
@ -1106,6 +1112,7 @@ void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, ColourAllocated
g_object_unref(pixalpha); g_object_unref(pixalpha);
} }
} }
#endif #endif
void SurfaceImpl::Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back) { void SurfaceImpl::Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back) {
@ -1735,24 +1742,24 @@ Surface *Surface::Allocate() {
Window::~Window() {} Window::~Window() {}
void Window::Destroy() { void Window::Destroy() {
if (id) if (wid)
gtk_widget_destroy(GTK_WIDGET(id)); gtk_widget_destroy(GTK_WIDGET(wid));
id = 0; wid = 0;
} }
bool Window::HasFocus() { bool Window::HasFocus() {
return GTK_WIDGET_HAS_FOCUS(id); return GTK_WIDGET_HAS_FOCUS(wid);
} }
PRectangle Window::GetPosition() { PRectangle Window::GetPosition() {
// Before any size allocated pretend its 1000 wide so not scrolled // Before any size allocated pretend its 1000 wide so not scrolled
PRectangle rc(0, 0, 1000, 1000); PRectangle rc(0, 0, 1000, 1000);
if (id) { if (wid) {
rc.left = PWidget(id)->allocation.x; rc.left = PWidget(wid)->allocation.x;
rc.top = PWidget(id)->allocation.y; rc.top = PWidget(wid)->allocation.y;
if (PWidget(id)->allocation.width > 20) { if (PWidget(wid)->allocation.width > 20) {
rc.right = rc.left + PWidget(id)->allocation.width; rc.right = rc.left + PWidget(wid)->allocation.width;
rc.bottom = rc.top + PWidget(id)->allocation.height; rc.bottom = rc.top + PWidget(wid)->allocation.height;
} }
} }
return rc; return rc;
@ -1765,18 +1772,18 @@ void Window::SetPosition(PRectangle rc) {
alloc.y = rc.top; alloc.y = rc.top;
alloc.width = rc.Width(); alloc.width = rc.Width();
alloc.height = rc.Height(); alloc.height = rc.Height();
gtk_widget_size_allocate(PWidget(id), &alloc); gtk_widget_size_allocate(PWidget(wid), &alloc);
#else #else
gtk_widget_set_uposition(id, rc.left, rc.top); gtk_widget_set_uposition(wid, rc.left, rc.top);
gtk_widget_set_usize(id, rc.right - rc.left, rc.bottom - rc.top); gtk_widget_set_usize(wid, rc.right - rc.left, rc.bottom - rc.top);
#endif #endif
} }
void Window::SetPositionRelative(PRectangle rc, Window relativeTo) { void Window::SetPositionRelative(PRectangle rc, Window relativeTo) {
int ox = 0; int ox = 0;
int oy = 0; int oy = 0;
gdk_window_get_origin(PWidget(relativeTo.id)->window, &ox, &oy); gdk_window_get_origin(PWidget(relativeTo.wid)->window, &ox, &oy);
ox += rc.left; ox += rc.left;
if (ox < 0) if (ox < 0)
ox = 0; ox = 0;
@ -1797,9 +1804,9 @@ void Window::SetPositionRelative(PRectangle rc, Window relativeTo) {
oy = screenHeight - sizey; oy = screenHeight - sizey;
#if GTK_MAJOR_VERSION >= 2 #if GTK_MAJOR_VERSION >= 2
gtk_window_move(GTK_WINDOW(PWidget(id)), ox, oy); gtk_window_move(GTK_WINDOW(PWidget(wid)), ox, oy);
#else #else
gtk_widget_set_uposition(PWidget(id), ox, oy); gtk_widget_set_uposition(PWidget(wid), ox, oy);
#endif #endif
#if 0 #if 0
@ -1809,9 +1816,9 @@ void Window::SetPositionRelative(PRectangle rc, Window relativeTo) {
alloc.y = rc.top + oy; alloc.y = rc.top + oy;
alloc.width = rc.right - rc.left; alloc.width = rc.right - rc.left;
alloc.height = rc.bottom - rc.top; alloc.height = rc.bottom - rc.top;
gtk_widget_size_allocate(id, &alloc); gtk_widget_size_allocate(wid, &alloc);
#endif #endif
gtk_widget_set_usize(PWidget(id), sizex, sizey); gtk_widget_set_usize(PWidget(wid), sizex, sizey);
} }
PRectangle Window::GetClientPosition() { PRectangle Window::GetClientPosition() {
@ -1821,18 +1828,18 @@ PRectangle Window::GetClientPosition() {
void Window::Show(bool show) { void Window::Show(bool show) {
if (show) if (show)
gtk_widget_show(PWidget(id)); gtk_widget_show(PWidget(wid));
} }
void Window::InvalidateAll() { void Window::InvalidateAll() {
if (id) { if (wid) {
gtk_widget_queue_draw(PWidget(id)); gtk_widget_queue_draw(PWidget(wid));
} }
} }
void Window::InvalidateRectangle(PRectangle rc) { void Window::InvalidateRectangle(PRectangle rc) {
if (id) { if (wid) {
gtk_widget_queue_draw_area(PWidget(id), gtk_widget_queue_draw_area(PWidget(wid),
rc.left, rc.top, rc.left, rc.top,
rc.right - rc.left, rc.bottom - rc.top); rc.right - rc.left, rc.bottom - rc.top);
} }
@ -1875,13 +1882,13 @@ void Window::SetCursor(Cursor curs) {
break; break;
} }
if (PWidget(id)->window) if (PWidget(wid)->window)
gdk_window_set_cursor(PWidget(id)->window, gdkCurs); gdk_window_set_cursor(PWidget(wid)->window, gdkCurs);
gdk_cursor_destroy(gdkCurs); gdk_cursor_destroy(gdkCurs);
} }
void Window::SetTitle(const char *s) { void Window::SetTitle(const char *s) {
gtk_window_set_title(GTK_WINDOW(id), s); gtk_window_set_title(GTK_WINDOW(wid), s);
} }
/* Returns rectangle of monitor pt is on, both rect and pt are in Window's /* Returns rectangle of monitor pt is on, both rect and pt are in Window's
@ -1890,7 +1897,7 @@ PRectangle Window::GetMonitorRect(Point pt) {
gint x_offset, y_offset; gint x_offset, y_offset;
pt = pt; pt = pt;
gdk_window_get_origin(PWidget(id)->window, &x_offset, &y_offset); gdk_window_get_origin(PWidget(wid)->window, &x_offset, &y_offset);
// gtk 2.2+ // gtk 2.2+
#if GTK_MAJOR_VERSION > 2 || (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 2) #if GTK_MAJOR_VERSION > 2 || (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 2)
@ -1899,7 +1906,7 @@ PRectangle Window::GetMonitorRect(Point pt) {
gint monitor_num; gint monitor_num;
GdkRectangle rect; GdkRectangle rect;
screen = gtk_widget_get_screen(PWidget(id)); screen = gtk_widget_get_screen(PWidget(wid));
monitor_num = gdk_screen_get_monitor_at_point(screen, pt.x + x_offset, pt.y + y_offset); monitor_num = gdk_screen_get_monitor_at_point(screen, pt.x + x_offset, pt.y + y_offset);
gdk_screen_get_monitor_geometry(screen, monitor_num, &rect); gdk_screen_get_monitor_geometry(screen, monitor_num, &rect);
rect.x -= x_offset; rect.x -= x_offset;
@ -1957,6 +1964,9 @@ class ListBoxX : public ListBox {
int current; int current;
#endif #endif
void *pixhash; void *pixhash;
#if GTK_MAJOR_VERSION >= 2
GtkCellRenderer* pixbuf_renderer;
#endif
int lineHeight; int lineHeight;
XPMSet xset; XPMSet xset;
bool unicodeMode; bool unicodeMode;
@ -1971,6 +1981,9 @@ public:
doubleClickAction(NULL), doubleClickActionData(NULL) { doubleClickAction(NULL), doubleClickActionData(NULL) {
#if GTK_MAJOR_VERSION < 2 #if GTK_MAJOR_VERSION < 2
current = 0; current = 0;
#endif
#if GTK_MAJOR_VERSION >= 2
pixbuf_renderer = 0;
#endif #endif
} }
virtual ~ListBoxX() { virtual ~ListBoxX() {
@ -2021,12 +2034,16 @@ static void SelectionAC(GtkWidget *, gint row, gint,
#endif #endif
static gboolean ButtonPress(GtkWidget *, GdkEventButton* ev, gpointer p) { static gboolean ButtonPress(GtkWidget *, GdkEventButton* ev, gpointer p) {
try {
ListBoxX* lb = reinterpret_cast<ListBoxX*>(p); ListBoxX* lb = reinterpret_cast<ListBoxX*>(p);
if (ev->type == GDK_2BUTTON_PRESS && lb->doubleClickAction != NULL) { if (ev->type == GDK_2BUTTON_PRESS && lb->doubleClickAction != NULL) {
lb->doubleClickAction(lb->doubleClickActionData); lb->doubleClickAction(lb->doubleClickActionData);
return TRUE; return TRUE;
} }
} catch (...) {
// No pointer back to Scintilla to save status
}
return FALSE; return FALSE;
} }
@ -2056,7 +2073,7 @@ static void StyleSet(GtkWidget *w, GtkStyle*, void*) {
#endif #endif
void ListBoxX::Create(Window &, int, Point, int, bool) { void ListBoxX::Create(Window &, int, Point, int, bool) {
id = gtk_window_new(GTK_WINDOW_POPUP); wid = gtk_window_new(GTK_WINDOW_POPUP);
GtkWidget *frame = gtk_frame_new(NULL); GtkWidget *frame = gtk_frame_new(NULL);
gtk_widget_show(frame); gtk_widget_show(frame);
@ -2104,12 +2121,13 @@ void ListBoxX::Create(Window &, int, Point, int, bool) {
gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_title(column, "Autocomplete"); gtk_tree_view_column_set_title(column, "Autocomplete");
GtkCellRenderer *renderer = gtk_cell_renderer_pixbuf_new(); pixbuf_renderer = gtk_cell_renderer_pixbuf_new();
gtk_tree_view_column_pack_start(column, renderer, FALSE); gtk_cell_renderer_set_fixed_size(pixbuf_renderer, 0, -1);
gtk_tree_view_column_add_attribute(column, renderer, gtk_tree_view_column_pack_start(column, pixbuf_renderer, FALSE);
gtk_tree_view_column_add_attribute(column, pixbuf_renderer,
"pixbuf", PIXBUF_COLUMN); "pixbuf", PIXBUF_COLUMN);
renderer = gtk_cell_renderer_text_new(); GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
gtk_cell_renderer_text_set_fixed_height_from_font(GTK_CELL_RENDERER_TEXT(renderer), 1); gtk_cell_renderer_text_set_fixed_height_from_font(GTK_CELL_RENDERER_TEXT(renderer), 1);
gtk_tree_view_column_pack_start(column, renderer, TRUE); gtk_tree_view_column_pack_start(column, renderer, TRUE);
gtk_tree_view_column_add_attribute(column, renderer, gtk_tree_view_column_add_attribute(column, renderer,
@ -2125,7 +2143,7 @@ void ListBoxX::Create(Window &, int, Point, int, bool) {
g_signal_connect(G_OBJECT(wid), "button_press_event", g_signal_connect(G_OBJECT(wid), "button_press_event",
G_CALLBACK(ButtonPress), this); G_CALLBACK(ButtonPress), this);
#endif #endif
gtk_widget_realize(PWidget(id)); gtk_widget_realize(PWidget(wid));
} }
void ListBoxX::SetFont(Font &scint_font) { void ListBoxX::SetFont(Font &scint_font) {
@ -2163,7 +2181,7 @@ int ListBoxX::GetVisibleRows() const {
PRectangle ListBoxX::GetDesiredRect() { PRectangle ListBoxX::GetDesiredRect() {
// Before any size allocated pretend its 100 wide so not scrolled // Before any size allocated pretend its 100 wide so not scrolled
PRectangle rc(0, 0, 100, 100); PRectangle rc(0, 0, 100, 100);
if (id) { if (wid) {
int rows = Length(); int rows = Length();
if ((rows == 0) || (rows > desiredVisibleRows)) if ((rows == 0) || (rows > desiredVisibleRows))
rows = desiredVisibleRows; rows = desiredVisibleRows;
@ -2211,6 +2229,12 @@ PRectangle ListBoxX::GetDesiredRect() {
} }
int ListBoxX::CaretFromEdge() { int ListBoxX::CaretFromEdge() {
#if GTK_MAJOR_VERSION >= 2
gint renderer_width, renderer_height;
gtk_cell_renderer_get_fixed_size(pixbuf_renderer, &renderer_width,
&renderer_height);
return 4 + renderer_width;
#endif
return 4 + xset.GetWidth(); return 4 + xset.GetWidth();
} }
@ -2297,6 +2321,14 @@ void ListBoxX::Append(char *s, int type) {
gtk_list_store_set(GTK_LIST_STORE(store), &iter, gtk_list_store_set(GTK_LIST_STORE(store), &iter,
PIXBUF_COLUMN, list_image->pixbuf, PIXBUF_COLUMN, list_image->pixbuf,
TEXT_COLUMN, s, -1); TEXT_COLUMN, s, -1);
gint pixbuf_width = gdk_pixbuf_get_width(list_image->pixbuf);
gint renderer_height, renderer_width;
gtk_cell_renderer_get_fixed_size(pixbuf_renderer,
&renderer_width, &renderer_height);
if (pixbuf_width > renderer_width)
gtk_cell_renderer_set_fixed_size(pixbuf_renderer,
pixbuf_width, -1);
} else { } else {
gtk_list_store_set(GTK_LIST_STORE(store), &iter, gtk_list_store_set(GTK_LIST_STORE(store), &iter,
TEXT_COLUMN, s, -1); TEXT_COLUMN, s, -1);
@ -2312,7 +2344,7 @@ void ListBoxX::Append(char *s, int type) {
} }
int ListBoxX::Length() { int ListBoxX::Length() {
if (id) if (wid)
#if GTK_MAJOR_VERSION < 2 #if GTK_MAJOR_VERSION < 2
return GTK_CLIST(list)->rows; return GTK_CLIST(list)->rows;
#else #else
@ -2534,27 +2566,27 @@ void ListBoxX::SetList(const char *listText, char separator, char typesep) {
} }
} }
Menu::Menu() : id(0) {} Menu::Menu() : mid(0) {}
void Menu::CreatePopUp() { void Menu::CreatePopUp() {
Destroy(); Destroy();
id = gtk_item_factory_new(GTK_TYPE_MENU, "<main>", NULL); mid = gtk_item_factory_new(GTK_TYPE_MENU, "<main>", NULL);
} }
void Menu::Destroy() { void Menu::Destroy() {
if (id) if (mid)
#if GTK_MAJOR_VERSION < 2 #if GTK_MAJOR_VERSION < 2
gtk_object_unref(GTK_OBJECT(id)); gtk_object_unref(GTK_OBJECT(mid));
#else #else
g_object_unref(G_OBJECT(id)); g_object_unref(G_OBJECT(mid));
#endif #endif
id = 0; mid = 0;
} }
void Menu::Show(Point pt, Window &) { void Menu::Show(Point pt, Window &) {
int screenHeight = gdk_screen_height(); int screenHeight = gdk_screen_height();
int screenWidth = gdk_screen_width(); int screenWidth = gdk_screen_width();
GtkItemFactory *factory = reinterpret_cast<GtkItemFactory *>(id); GtkItemFactory *factory = reinterpret_cast<GtkItemFactory *>(mid);
GtkWidget *widget = gtk_item_factory_get_widget(factory, "<main>"); GtkWidget *widget = gtk_item_factory_get_widget(factory, "<main>");
gtk_widget_show_all(widget); gtk_widget_show_all(widget);
GtkRequisition requisition; GtkRequisition requisition;

View File

@ -3,12 +3,16 @@
// Copyright 1998-2004 by Neil Hodgson <neilh@scintilla.org> // Copyright 1998-2004 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed. // The License.txt file describes the conditions under which this software may be distributed.
#include <new>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
#include <time.h> #include <time.h>
#include <string>
#include <vector>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
@ -23,6 +27,7 @@
#ifdef SCI_LEXER #ifdef SCI_LEXER
#include "SciLexer.h" #include "SciLexer.h"
#include "PropSet.h" #include "PropSet.h"
#include "PropSetSimple.h"
#include "Accessor.h" #include "Accessor.h"
#include "KeyWords.h" #include "KeyWords.h"
#endif #endif
@ -43,9 +48,9 @@
#include "Decoration.h" #include "Decoration.h"
#include "CharClassify.h" #include "CharClassify.h"
#include "Document.h" #include "Document.h"
#include "Selection.h"
#include "PositionCache.h" #include "PositionCache.h"
#include "Editor.h" #include "Editor.h"
#include "SString.h"
#include "ScintillaBase.h" #include "ScintillaBase.h"
#include "UniConversion.h" #include "UniConversion.h"
@ -115,6 +120,7 @@ class ScintillaGTK : public ScintillaBase {
bool capturedMouse; bool capturedMouse;
bool dragWasDropped; bool dragWasDropped;
int lastKey; int lastKey;
int rectangularSelectionModifier;
GtkWidgetClass *parentClass; GtkWidgetClass *parentClass;
@ -220,7 +226,9 @@ private:
void UnMapThis(); void UnMapThis();
static void UnMap(GtkWidget *widget); static void UnMap(GtkWidget *widget);
static gint CursorMoved(GtkWidget *widget, int xoffset, int yoffset, ScintillaGTK *sciThis); static gint CursorMoved(GtkWidget *widget, int xoffset, int yoffset, ScintillaGTK *sciThis);
gint FocusInThis(GtkWidget *widget);
static gint FocusIn(GtkWidget *widget, GdkEventFocus *event); static gint FocusIn(GtkWidget *widget, GdkEventFocus *event);
gint FocusOutThis(GtkWidget *widget);
static gint FocusOut(GtkWidget *widget, GdkEventFocus *event); static gint FocusOut(GtkWidget *widget, GdkEventFocus *event);
static void SizeRequest(GtkWidget *widget, GtkRequisition *requisition); static void SizeRequest(GtkWidget *widget, GtkRequisition *requisition);
static void SizeAllocate(GtkWidget *widget, GtkAllocation *allocation); static void SizeAllocate(GtkWidget *widget, GtkAllocation *allocation);
@ -243,12 +251,12 @@ private:
static gboolean KeyPress(GtkWidget *widget, GdkEventKey *event); static gboolean KeyPress(GtkWidget *widget, GdkEventKey *event);
static gboolean KeyRelease(GtkWidget *widget, GdkEventKey *event); static gboolean KeyRelease(GtkWidget *widget, GdkEventKey *event);
#if GTK_MAJOR_VERSION >= 2 #if GTK_MAJOR_VERSION >= 2
static gboolean ExposePreedit(GtkWidget *widget, GdkEventExpose *ose, ScintillaGTK *sciThis);
gboolean ExposePreeditThis(GtkWidget *widget, GdkEventExpose *ose); gboolean ExposePreeditThis(GtkWidget *widget, GdkEventExpose *ose);
static void Commit(GtkIMContext *context, char *str, ScintillaGTK *sciThis); static gboolean ExposePreedit(GtkWidget *widget, GdkEventExpose *ose, ScintillaGTK *sciThis);
void CommitThis(char *str); void CommitThis(char *str);
static void PreeditChanged(GtkIMContext *context, ScintillaGTK *sciThis); static void Commit(GtkIMContext *context, char *str, ScintillaGTK *sciThis);
void PreeditChangedThis(); void PreeditChangedThis();
static void PreeditChanged(GtkIMContext *context, ScintillaGTK *sciThis);
#endif #endif
static gint StyleSetText(GtkWidget *widget, GtkStyle *previous, void*); static gint StyleSetText(GtkWidget *widget, GtkStyle *previous, void*);
static gint RealizeText(GtkWidget *widget, void*); static gint RealizeText(GtkWidget *widget, void*);
@ -343,7 +351,7 @@ ScintillaGTK::ScintillaGTK(_ScintillaObject *sci_) :
adjustmentv(0), adjustmenth(0), adjustmentv(0), adjustmenth(0),
scrollBarWidth(30), scrollBarHeight(30), scrollBarWidth(30), scrollBarHeight(30),
capturedMouse(false), dragWasDropped(false), capturedMouse(false), dragWasDropped(false),
lastKey(0), parentClass(0), lastKey(0), rectangularSelectionModifier(SCMOD_CTRL), parentClass(0),
#ifdef INTERNATIONAL_INPUT #ifdef INTERNATIONAL_INPUT
#if GTK_MAJOR_VERSION < 2 #if GTK_MAJOR_VERSION < 2
ic(NULL), ic(NULL),
@ -358,6 +366,12 @@ ScintillaGTK::ScintillaGTK(_ScintillaObject *sci_) :
sci = sci_; sci = sci_;
wMain = GTK_WIDGET(sci); wMain = GTK_WIDGET(sci);
#if PLAT_GTK_WIN32
rectangularSelectionModifier = SCMOD_ALT;
#else
rectangularSelectionModifier = SCMOD_CTRL;
#endif
#if PLAT_GTK_WIN32 #if PLAT_GTK_WIN32
// There does not seem to be a real standard for indicating that the clipboard // There does not seem to be a real standard for indicating that the clipboard
// contains a rectangular selection, so copy Developer Studio. // contains a rectangular selection, so copy Developer Studio.
@ -504,6 +518,7 @@ void ScintillaGTK::Realize(GtkWidget *widget) {
} }
void ScintillaGTK::UnRealizeThis(GtkWidget *widget) { void ScintillaGTK::UnRealizeThis(GtkWidget *widget) {
try {
if (GTK_WIDGET_MAPPED(widget)) { if (GTK_WIDGET_MAPPED(widget)) {
gtk_widget_unmap(widget); gtk_widget_unmap(widget);
} }
@ -532,6 +547,9 @@ void ScintillaGTK::UnRealizeThis(GtkWidget *widget) {
GTK_WIDGET_CLASS(parentClass)->unrealize(widget); GTK_WIDGET_CLASS(parentClass)->unrealize(widget);
Finalise(); Finalise();
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
} }
void ScintillaGTK::UnRealize(GtkWidget *widget) { void ScintillaGTK::UnRealize(GtkWidget *widget) {
@ -548,6 +566,7 @@ static void MapWidget(GtkWidget *widget) {
} }
void ScintillaGTK::MapThis() { void ScintillaGTK::MapThis() {
try {
//Platform::DebugPrintf("ScintillaGTK::map this\n"); //Platform::DebugPrintf("ScintillaGTK::map this\n");
GTK_WIDGET_SET_FLAGS(PWidget(wMain), GTK_MAPPED); GTK_WIDGET_SET_FLAGS(PWidget(wMain), GTK_MAPPED);
MapWidget(PWidget(wText)); MapWidget(PWidget(wText));
@ -558,6 +577,9 @@ void ScintillaGTK::MapThis() {
scrollbarh.SetCursor(Window::cursorArrow); scrollbarh.SetCursor(Window::cursorArrow);
ChangeSize(); ChangeSize();
gdk_window_show(PWidget(wMain)->window); gdk_window_show(PWidget(wMain)->window);
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
} }
void ScintillaGTK::Map(GtkWidget *widget) { void ScintillaGTK::Map(GtkWidget *widget) {
@ -566,6 +588,7 @@ void ScintillaGTK::Map(GtkWidget *widget) {
} }
void ScintillaGTK::UnMapThis() { void ScintillaGTK::UnMapThis() {
try {
//Platform::DebugPrintf("ScintillaGTK::unmap this\n"); //Platform::DebugPrintf("ScintillaGTK::unmap this\n");
GTK_WIDGET_UNSET_FLAGS(PWidget(wMain), GTK_MAPPED); GTK_WIDGET_UNSET_FLAGS(PWidget(wMain), GTK_MAPPED);
DropGraphics(); DropGraphics();
@ -573,6 +596,9 @@ void ScintillaGTK::UnMapThis() {
gtk_widget_unmap(PWidget(wText)); gtk_widget_unmap(PWidget(wText));
gtk_widget_unmap(PWidget(scrollbarh)); gtk_widget_unmap(PWidget(scrollbarh));
gtk_widget_unmap(PWidget(scrollbarv)); gtk_widget_unmap(PWidget(scrollbarv));
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
} }
void ScintillaGTK::UnMap(GtkWidget *widget) { void ScintillaGTK::UnMap(GtkWidget *widget) {
@ -581,9 +607,13 @@ void ScintillaGTK::UnMap(GtkWidget *widget) {
} }
void ScintillaGTK::ForAll(GtkCallback callback, gpointer callback_data) { void ScintillaGTK::ForAll(GtkCallback callback, gpointer callback_data) {
try {
(*callback) (PWidget(wText), callback_data); (*callback) (PWidget(wText), callback_data);
(*callback) (PWidget(scrollbarv), callback_data); (*callback) (PWidget(scrollbarv), callback_data);
(*callback) (PWidget(scrollbarh), callback_data); (*callback) (PWidget(scrollbarh), callback_data);
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
} }
void ScintillaGTK::MainForAll(GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data) { void ScintillaGTK::MainForAll(GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data) {
@ -622,70 +652,84 @@ gint ScintillaGTK::CursorMoved(GtkWidget *, int, int, ScintillaGTK *) {
} }
#endif #endif
gint ScintillaGTK::FocusIn(GtkWidget *widget, GdkEventFocus * /*event*/) { gint ScintillaGTK::FocusInThis(GtkWidget *widget) {
ScintillaGTK *sciThis = ScintillaFromWidget(widget); try {
//Platform::DebugPrintf("ScintillaGTK::focus in %x\n", sciThis);
GTK_WIDGET_SET_FLAGS(widget, GTK_HAS_FOCUS); GTK_WIDGET_SET_FLAGS(widget, GTK_HAS_FOCUS);
sciThis->SetFocusState(true); SetFocusState(true);
#ifdef INTERNATIONAL_INPUT #ifdef INTERNATIONAL_INPUT
#if GTK_MAJOR_VERSION < 2 #if GTK_MAJOR_VERSION < 2
if (sciThis->ic) if (ic)
gdk_im_begin(sciThis->ic, widget->window); gdk_im_begin(ic, widget->window);
#else #else
if (sciThis->im_context != NULL) { if (im_context != NULL) {
gchar *str = NULL; gchar *str = NULL;
gint cursor_pos; gint cursor_pos;
gtk_im_context_get_preedit_string(sciThis->im_context, &str, NULL, &cursor_pos); gtk_im_context_get_preedit_string(im_context, &str, NULL, &cursor_pos);
if (PWidget(sciThis->wPreedit) != NULL) { if (PWidget(wPreedit) != NULL) {
if (strlen(str) > 0) { if (strlen(str) > 0) {
gtk_widget_show(PWidget(sciThis->wPreedit)); gtk_widget_show(PWidget(wPreedit));
} else { } else {
gtk_widget_hide(PWidget(sciThis->wPreedit)); gtk_widget_hide(PWidget(wPreedit));
} }
} }
g_free(str); g_free(str);
gtk_im_context_focus_in(sciThis->im_context); gtk_im_context_focus_in(im_context);
} }
#endif #endif
#endif #endif
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
return FALSE; return FALSE;
} }
gint ScintillaGTK::FocusOut(GtkWidget *widget, GdkEventFocus * /*event*/) { gint ScintillaGTK::FocusIn(GtkWidget *widget, GdkEventFocus * /*event*/) {
ScintillaGTK *sciThis = ScintillaFromWidget(widget); ScintillaGTK *sciThis = ScintillaFromWidget(widget);
//Platform::DebugPrintf("ScintillaGTK::focus out %x\n", sciThis); return sciThis->FocusInThis(widget);
}
gint ScintillaGTK::FocusOutThis(GtkWidget *widget) {
try {
GTK_WIDGET_UNSET_FLAGS(widget, GTK_HAS_FOCUS); GTK_WIDGET_UNSET_FLAGS(widget, GTK_HAS_FOCUS);
sciThis->SetFocusState(false); SetFocusState(false);
#ifdef INTERNATIONAL_INPUT #ifdef INTERNATIONAL_INPUT
#if GTK_MAJOR_VERSION < 2 #if GTK_MAJOR_VERSION < 2
gdk_im_end(); gdk_im_end();
#else #else
if (PWidget(sciThis->wPreedit) != NULL) if (PWidget(wPreedit) != NULL)
gtk_widget_hide(PWidget(sciThis->wPreedit)); gtk_widget_hide(PWidget(wPreedit));
if (sciThis->im_context != NULL) if (im_context != NULL)
gtk_im_context_focus_out(sciThis->im_context); gtk_im_context_focus_out(im_context);
#endif #endif
#endif #endif
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
return FALSE; return FALSE;
} }
gint ScintillaGTK::FocusOut(GtkWidget *widget, GdkEventFocus * /*event*/) {
ScintillaGTK *sciThis = ScintillaFromWidget(widget);
return sciThis->FocusOutThis(widget);
}
void ScintillaGTK::SizeRequest(GtkWidget *widget, GtkRequisition *requisition) { void ScintillaGTK::SizeRequest(GtkWidget *widget, GtkRequisition *requisition) {
ScintillaGTK *sciThis = ScintillaFromWidget(widget);
requisition->width = 600; requisition->width = 600;
requisition->height = gdk_screen_height(); requisition->height = gdk_screen_height();
ScintillaGTK *sciThis = ScintillaFromWidget(widget);
GtkRequisition child_requisition; GtkRequisition child_requisition;
gtk_widget_size_request(PWidget(sciThis->scrollbarh), &child_requisition); gtk_widget_size_request(PWidget(sciThis->scrollbarh), &child_requisition);
gtk_widget_size_request(PWidget(sciThis->scrollbarv), &child_requisition); gtk_widget_size_request(PWidget(sciThis->scrollbarv), &child_requisition);
} }
void ScintillaGTK::SizeAllocate(GtkWidget *widget, GtkAllocation *allocation) { void ScintillaGTK::SizeAllocate(GtkWidget *widget, GtkAllocation *allocation) {
widget->allocation = *allocation;
ScintillaGTK *sciThis = ScintillaFromWidget(widget); ScintillaGTK *sciThis = ScintillaFromWidget(widget);
try {
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED(widget)) if (GTK_WIDGET_REALIZED(widget))
gdk_window_move_resize(widget->window, gdk_window_move_resize(widget->window,
widget->allocation.x, widget->allocation.x,
@ -708,6 +752,9 @@ void ScintillaGTK::SizeAllocate(GtkWidget *widget, GtkAllocation *allocation) {
} }
#endif #endif
#endif #endif
} catch (...) {
sciThis->errorStatus = SC_STATUS_FAILURE;
}
} }
void ScintillaGTK::Initialise() { void ScintillaGTK::Initialise() {
@ -958,6 +1005,7 @@ bool ScintillaGTK::ValidCodePage(int codePage) const {
} }
sptr_t ScintillaGTK::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { sptr_t ScintillaGTK::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
try {
switch (iMessage) { switch (iMessage) {
case SCI_GRABFOCUS: case SCI_GRABFOCUS:
@ -982,9 +1030,21 @@ sptr_t ScintillaGTK::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam
return EncodedFromUTF8(reinterpret_cast<char*>(wParam), return EncodedFromUTF8(reinterpret_cast<char*>(wParam),
reinterpret_cast<char*>(lParam)); reinterpret_cast<char*>(lParam));
case SCI_SETRECTANGULARSELECTIONMODIFIER:
rectangularSelectionModifier = wParam;
break;
case SCI_GETRECTANGULARSELECTIONMODIFIER:
return rectangularSelectionModifier;
default: default:
return ScintillaBase::WndProc(iMessage, wParam, lParam); return ScintillaBase::WndProc(iMessage, wParam, lParam);
} }
} catch (std::bad_alloc&) {
errorStatus = SC_STATUS_BADALLOC;
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
return 0l; return 0l;
} }
@ -1303,7 +1363,7 @@ void ScintillaGTK::CopyToClipboard(const SelectionText &selectedText) {
} }
void ScintillaGTK::Copy() { void ScintillaGTK::Copy() {
if (currentPos != anchor) { if (!sel.Empty()) {
#ifndef USE_GTK_CLIPBOARD #ifndef USE_GTK_CLIPBOARD
CopySelectionRange(&copyText); CopySelectionRange(&copyText);
gtk_selection_owner_set(GTK_WIDGET(PWidget(wMain)), gtk_selection_owner_set(GTK_WIDGET(PWidget(wMain)),
@ -1315,7 +1375,7 @@ void ScintillaGTK::Copy() {
StoreOnClipboard(clipText); StoreOnClipboard(clipText);
#endif #endif
#if PLAT_GTK_WIN32 #if PLAT_GTK_WIN32
if (selType == selRectangle) { if (sel.IsRectangular()) {
::OpenClipboard(NULL); ::OpenClipboard(NULL);
::SetClipboardData(cfColumnSelect, 0); ::SetClipboardData(cfColumnSelect, 0);
::CloseClipboard(); ::CloseClipboard();
@ -1391,7 +1451,7 @@ bool ScintillaGTK::OwnPrimarySelection() {
void ScintillaGTK::ClaimSelection() { void ScintillaGTK::ClaimSelection() {
// X Windows has a 'primary selection' as well as the clipboard. // X Windows has a 'primary selection' as well as the clipboard.
// Whenever the user selects some text, we become the primary selection // Whenever the user selects some text, we become the primary selection
if (currentPos != anchor && GTK_WIDGET_REALIZED(GTK_WIDGET(PWidget(wMain)))) { if (!sel.Empty() && GTK_WIDGET_REALIZED(GTK_WIDGET(PWidget(wMain)))) {
primarySelection = true; primarySelection = true;
gtk_selection_owner_set(GTK_WIDGET(PWidget(wMain)), gtk_selection_owner_set(GTK_WIDGET(PWidget(wMain)),
GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME); GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME);
@ -1459,6 +1519,7 @@ void ScintillaGTK::GetGtkSelectionText(GtkSelectionData *selectionData, Selectio
} }
void ScintillaGTK::ReceivedSelection(GtkSelectionData *selection_data) { void ScintillaGTK::ReceivedSelection(GtkSelectionData *selection_data) {
try {
if ((selection_data->selection == atomClipboard) || if ((selection_data->selection == atomClipboard) ||
(selection_data->selection == GDK_SELECTION_PRIMARY)) { (selection_data->selection == GDK_SELECTION_PRIMARY)) {
if ((atomSought == atomUTF8) && (selection_data->length <= 0)) { if ((atomSought == atomUTF8) && (selection_data->length <= 0)) {
@ -1470,25 +1531,29 @@ void ScintillaGTK::ReceivedSelection(GtkSelectionData *selection_data) {
SelectionText selText; SelectionText selText;
GetGtkSelectionText(selection_data, selText); GetGtkSelectionText(selection_data, selText);
pdoc->BeginUndoAction(); UndoGroup ug(pdoc);
if (selection_data->selection != GDK_SELECTION_PRIMARY) { if (selection_data->selection != GDK_SELECTION_PRIMARY) {
ClearSelection(); ClearSelection();
} }
int selStart = SelectionStart(); SelectionPosition selStart = SelectionStart();
if (selText.rectangular) { if (selText.rectangular) {
PasteRectangular(selStart, selText.s, selText.len); PasteRectangular(selStart, selText.s, selText.len);
} else { } else {
pdoc->InsertString(currentPos, selText.s, selText.len); selStart = SelectionPosition(InsertSpace(selStart.Position(), selStart.VirtualSpace()));
SetEmptySelection(currentPos + selText.len); if (pdoc->InsertString(selStart.Position(),selText.s, selText.len)) {
SetEmptySelection(selStart.Position() + selText.len);
}
} }
pdoc->EndUndoAction();
EnsureCaretVisible(); EnsureCaretVisible();
} }
} }
// else fprintf(stderr, "Target non string %d %d\n", (int)(selection_data->type), // else fprintf(stderr, "Target non string %d %d\n", (int)(selection_data->type),
// (int)(atomUTF8)); // (int)(atomUTF8));
Redraw(); Redraw();
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
} }
void ScintillaGTK::ReceivedDrop(GtkSelectionData *selection_data) { void ScintillaGTK::ReceivedDrop(GtkSelectionData *selection_data) {
@ -1549,18 +1614,19 @@ void ScintillaGTK::GetSelection(GtkSelectionData *selection_data, guint info, Se
// All other tested aplications behave benignly by ignoring the \0. // All other tested aplications behave benignly by ignoring the \0.
// The #if is here because on Windows cfColumnSelect clip entry is used // The #if is here because on Windows cfColumnSelect clip entry is used
// instead as standard indicator of rectangularness (so no need to kludge) // instead as standard indicator of rectangularness (so no need to kludge)
int len = strlen(text->s); const char *textData = text->s ? text->s : "";
int len = strlen(textData);
#if PLAT_GTK_WIN32 == 0 #if PLAT_GTK_WIN32 == 0
if (text->rectangular) if (text->rectangular)
len++; len++;
#endif #endif
if (info == TARGET_UTF8_STRING) { if (info == TARGET_UTF8_STRING) {
gtk_selection_data_set_text(selection_data, text->s, len); gtk_selection_data_set_text(selection_data, textData, len);
} else { } else {
gtk_selection_data_set(selection_data, gtk_selection_data_set(selection_data,
static_cast<GdkAtom>(GDK_SELECTION_TYPE_STRING), static_cast<GdkAtom>(GDK_SELECTION_TYPE_STRING),
8, reinterpret_cast<unsigned char *>(text->s), len); 8, reinterpret_cast<const unsigned char *>(textData), len);
} }
delete converted; delete converted;
@ -1651,6 +1717,7 @@ void ScintillaGTK::ClipboardClearSelection(GtkClipboard *, void *data) {
#endif #endif
void ScintillaGTK::UnclaimSelection(GdkEventSelection *selection_event) { void ScintillaGTK::UnclaimSelection(GdkEventSelection *selection_event) {
try {
//Platform::DebugPrintf("UnclaimSelection\n"); //Platform::DebugPrintf("UnclaimSelection\n");
if (selection_event->selection == GDK_SELECTION_PRIMARY) { if (selection_event->selection == GDK_SELECTION_PRIMARY) {
//Platform::DebugPrintf("UnclaimPrimarySelection\n"); //Platform::DebugPrintf("UnclaimPrimarySelection\n");
@ -1660,6 +1727,9 @@ void ScintillaGTK::UnclaimSelection(GdkEventSelection *selection_event) {
FullPaint(); FullPaint();
} }
} }
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
} }
void ScintillaGTK::Resize(int width, int height) { void ScintillaGTK::Resize(int width, int height) {
@ -1730,7 +1800,23 @@ static void SetAdjustmentValue(GtkObject *object, int value) {
gtk_adjustment_set_value(adjustment, value); gtk_adjustment_set_value(adjustment, value);
} }
static int modifierTranslated(int sciModifier) {
switch (sciModifier) {
case SCMOD_SHIFT:
return GDK_SHIFT_MASK;
case SCMOD_CTRL:
return GDK_CONTROL_MASK;
case SCMOD_ALT:
return GDK_MOD1_MASK;
case SCMOD_SUPER:
return GDK_MOD4_MASK;
default:
return 0;
}
}
gint ScintillaGTK::PressThis(GdkEventButton *event) { gint ScintillaGTK::PressThis(GdkEventButton *event) {
try {
//Platform::DebugPrintf("Press %x time=%d state = %x button = %x\n",this,event->time, event->state, event->button); //Platform::DebugPrintf("Press %x time=%d state = %x button = %x\n",this,event->time, event->state, event->button);
// Do not use GTK+ double click events as Scintilla has its own double click detection // Do not use GTK+ double click events as Scintilla has its own double click detection
if (event->type != GDK_BUTTON_PRESS) if (event->type != GDK_BUTTON_PRESS)
@ -1752,22 +1838,16 @@ gint ScintillaGTK::PressThis(GdkEventButton *event) {
gtk_widget_grab_focus(PWidget(wMain)); gtk_widget_grab_focus(PWidget(wMain));
if (event->button == 1) { if (event->button == 1) {
// On X, instead of sending literal modifiers use control instead of alt // On X, instead of sending literal modifiers use the user specified
// modifier, defaulting to control instead of alt.
// This is because most X window managers grab alt + click for moving // This is because most X window managers grab alt + click for moving
#if !PLAT_GTK_WIN32
ButtonDown(pt, event->time, ButtonDown(pt, event->time,
(event->state & GDK_SHIFT_MASK) != 0, (event->state & GDK_SHIFT_MASK) != 0,
(event->state & GDK_CONTROL_MASK) != 0, (event->state & GDK_CONTROL_MASK) != 0,
(event->state & GDK_CONTROL_MASK) != 0); (event->state & modifierTranslated(rectangularSelectionModifier)) != 0);
#else
ButtonDown(pt, event->time,
(event->state & GDK_SHIFT_MASK) != 0,
(event->state & GDK_CONTROL_MASK) != 0,
(event->state & GDK_MOD1_MASK) != 0);
#endif
} else if (event->button == 2) { } else if (event->button == 2) {
// Grab the primary selection if it exists // Grab the primary selection if it exists
Position pos = PositionFromLocation(pt); SelectionPosition pos = SPositionFromLocation(pt);
if (OwnPrimarySelection() && primary.s == NULL) if (OwnPrimarySelection() && primary.s == NULL)
CopySelectionRange(&primary); CopySelectionRange(&primary);
@ -1799,6 +1879,9 @@ gint ScintillaGTK::PressThis(GdkEventButton *event) {
else else
SetAdjustmentValue(adjustmentv, topLine + 3); SetAdjustmentValue(adjustmentv, topLine + 3);
} }
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
#if GTK_MAJOR_VERSION >= 2 #if GTK_MAJOR_VERSION >= 2
return TRUE; return TRUE;
#else #else
@ -1815,6 +1898,7 @@ gint ScintillaGTK::Press(GtkWidget *widget, GdkEventButton *event) {
gint ScintillaGTK::MouseRelease(GtkWidget *widget, GdkEventButton *event) { gint ScintillaGTK::MouseRelease(GtkWidget *widget, GdkEventButton *event) {
ScintillaGTK *sciThis = ScintillaFromWidget(widget); ScintillaGTK *sciThis = ScintillaFromWidget(widget);
try {
//Platform::DebugPrintf("Release %x %d %d\n",sciThis,event->time,event->state); //Platform::DebugPrintf("Release %x %d %d\n",sciThis,event->time,event->state);
if (!sciThis->HaveMouseCapture()) if (!sciThis->HaveMouseCapture())
return FALSE; return FALSE;
@ -1830,6 +1914,9 @@ gint ScintillaGTK::MouseRelease(GtkWidget *widget, GdkEventButton *event) {
pt = sciThis->ptMouseLast; pt = sciThis->ptMouseLast;
sciThis->ButtonUp(pt, event->time, (event->state & 4) != 0); sciThis->ButtonUp(pt, event->time, (event->state & 4) != 0);
} }
} catch (...) {
sciThis->errorStatus = SC_STATUS_FAILURE;
}
return FALSE; return FALSE;
} }
@ -1839,6 +1926,7 @@ gint ScintillaGTK::MouseRelease(GtkWidget *widget, GdkEventButton *event) {
gint ScintillaGTK::ScrollEvent(GtkWidget *widget, gint ScintillaGTK::ScrollEvent(GtkWidget *widget,
GdkEventScroll *event) { GdkEventScroll *event) {
ScintillaGTK *sciThis = ScintillaFromWidget(widget); ScintillaGTK *sciThis = ScintillaFromWidget(widget);
try {
if (widget == NULL || event == NULL) if (widget == NULL || event == NULL)
return FALSE; return FALSE;
@ -1906,11 +1994,16 @@ gint ScintillaGTK::ScrollEvent(GtkWidget *widget,
sciThis->ScrollTo(sciThis->topLine + cLineScroll); sciThis->ScrollTo(sciThis->topLine + cLineScroll);
} }
return TRUE; return TRUE;
} catch (...) {
sciThis->errorStatus = SC_STATUS_FAILURE;
}
return FALSE;
} }
#endif #endif
gint ScintillaGTK::Motion(GtkWidget *widget, GdkEventMotion *event) { gint ScintillaGTK::Motion(GtkWidget *widget, GdkEventMotion *event) {
ScintillaGTK *sciThis = ScintillaFromWidget(widget); ScintillaGTK *sciThis = ScintillaFromWidget(widget);
try {
//Platform::DebugPrintf("Motion %x %d\n",sciThis,event->time); //Platform::DebugPrintf("Motion %x %d\n",sciThis,event->time);
if (event->window != widget->window) if (event->window != widget->window)
return FALSE; return FALSE;
@ -1928,6 +2021,9 @@ gint ScintillaGTK::Motion(GtkWidget *widget, GdkEventMotion *event) {
// sciThis,event->window,event->time,event->is_hint? 'h' :'.', x, y); // sciThis,event->window,event->time,event->is_hint? 'h' :'.', x, y);
Point pt(x, y); Point pt(x, y);
sciThis->ButtonMove(pt); sciThis->ButtonMove(pt);
} catch (...) {
sciThis->errorStatus = SC_STATUS_FAILURE;
}
return FALSE; return FALSE;
} }
@ -2005,6 +2101,7 @@ static int KeyTranslate(int keyIn) {
} }
gboolean ScintillaGTK::KeyThis(GdkEventKey *event) { gboolean ScintillaGTK::KeyThis(GdkEventKey *event) {
try {
//fprintf(stderr, "SC-key: %d %x [%s]\n", //fprintf(stderr, "SC-key: %d %x [%s]\n",
// event->keyval, event->state, (event->length > 0) ? event->string : "empty"); // event->keyval, event->state, (event->length > 0) ? event->string : "empty");
#if GTK_MAJOR_VERSION >= 2 #if GTK_MAJOR_VERSION >= 2
@ -2045,6 +2142,10 @@ gboolean ScintillaGTK::KeyThis(GdkEventKey *event) {
} }
} }
return consumed; return consumed;
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
return FALSE;
} }
gboolean ScintillaGTK::KeyPress(GtkWidget *widget, GdkEventKey *event) { gboolean ScintillaGTK::KeyPress(GtkWidget *widget, GdkEventKey *event) {
@ -2058,11 +2159,8 @@ gboolean ScintillaGTK::KeyRelease(GtkWidget *, GdkEventKey * /*event*/) {
} }
#if GTK_MAJOR_VERSION >= 2 #if GTK_MAJOR_VERSION >= 2
gboolean ScintillaGTK::ExposePreedit(GtkWidget *widget, GdkEventExpose *ose, ScintillaGTK *sciThis) {
return sciThis->ExposePreeditThis(widget, ose);
}
gboolean ScintillaGTK::ExposePreeditThis(GtkWidget *widget, GdkEventExpose *ose) { gboolean ScintillaGTK::ExposePreeditThis(GtkWidget *widget, GdkEventExpose *ose) {
try {
gchar *str; gchar *str;
gint cursor_pos; gint cursor_pos;
PangoAttrList *attrs; PangoAttrList *attrs;
@ -2073,7 +2171,8 @@ gboolean ScintillaGTK::ExposePreeditThis(GtkWidget *widget, GdkEventExpose *ose)
GdkGC *gc = gdk_gc_new(widget->window); GdkGC *gc = gdk_gc_new(widget->window);
GdkColor color[2] = { {0, 0x0000, 0x0000, 0x0000}, GdkColor color[2] = { {0, 0x0000, 0x0000, 0x0000},
{0, 0xffff, 0xffff, 0xffff}}; {0, 0xffff, 0xffff, 0xffff}
};
gdk_color_alloc(gdk_colormap_get_system(), color); gdk_color_alloc(gdk_colormap_get_system(), color);
gdk_color_alloc(gdk_colormap_get_system(), color + 1); gdk_color_alloc(gdk_colormap_get_system(), color + 1);
@ -2089,23 +2188,27 @@ gboolean ScintillaGTK::ExposePreeditThis(GtkWidget *widget, GdkEventExpose *ose)
g_free(str); g_free(str);
pango_attr_list_unref(attrs); pango_attr_list_unref(attrs);
g_object_unref(layout); g_object_unref(layout);
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
return TRUE; return TRUE;
} }
void ScintillaGTK::Commit(GtkIMContext *, char *str, ScintillaGTK *sciThis) { gboolean ScintillaGTK::ExposePreedit(GtkWidget *widget, GdkEventExpose *ose, ScintillaGTK *sciThis) {
sciThis->CommitThis(str); return sciThis->ExposePreeditThis(widget, ose);
} }
void ScintillaGTK::CommitThis(char *utfVal) { void ScintillaGTK::CommitThis(char *utfVal) {
try {
//~ fprintf(stderr, "Commit '%s'\n", utfVal); //~ fprintf(stderr, "Commit '%s'\n", utfVal);
if (IsUnicodeMode()) { if (IsUnicodeMode()) {
AddCharUTF(utfVal,strlen(utfVal)); AddCharUTF(utfVal, strlen(utfVal));
} else { } else {
const char *source = CharacterSetID(); const char *source = CharacterSetID();
if (*source) { if (*source) {
Converter conv(source, "UTF-8", true); Converter conv(source, "UTF-8", true);
if (conv) { if (conv) {
char localeVal[4]="\0\0\0"; char localeVal[4] = "\0\0\0";
char *pin = utfVal; char *pin = utfVal;
size_t inLeft = strlen(utfVal); size_t inLeft = strlen(utfVal);
char *pout = localeVal; char *pout = localeVal;
@ -2113,7 +2216,7 @@ void ScintillaGTK::CommitThis(char *utfVal) {
size_t conversions = conv.Convert(&pin, &inLeft, &pout, &outLeft); size_t conversions = conv.Convert(&pin, &inLeft, &pout, &outLeft);
if (conversions != ((size_t)(-1))) { if (conversions != ((size_t)(-1))) {
*pout = '\0'; *pout = '\0';
for (int i=0; localeVal[i]; i++) { for (int i = 0; localeVal[i]; i++) {
AddChar(localeVal[i]); AddChar(localeVal[i]);
} }
} else { } else {
@ -2122,18 +2225,22 @@ void ScintillaGTK::CommitThis(char *utfVal) {
} }
} }
} }
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
} }
void ScintillaGTK::PreeditChanged(GtkIMContext *, ScintillaGTK *sciThis) { void ScintillaGTK::Commit(GtkIMContext *, char *str, ScintillaGTK *sciThis) {
sciThis->PreeditChangedThis(); sciThis->CommitThis(str);
} }
void ScintillaGTK::PreeditChangedThis() { void ScintillaGTK::PreeditChangedThis() {
try {
gchar *str; gchar *str;
PangoAttrList *attrs; PangoAttrList *attrs;
gint cursor_pos; gint cursor_pos;
gtk_im_context_get_preedit_string(im_context, &str, &attrs, &cursor_pos); gtk_im_context_get_preedit_string(im_context, &str, &attrs, &cursor_pos);
if (strlen(str) > 0){ if (strlen(str) > 0) {
PangoLayout *layout = gtk_widget_create_pango_layout(PWidget(wText), str); PangoLayout *layout = gtk_widget_create_pango_layout(PWidget(wText), str);
pango_layout_set_attributes(layout, attrs); pango_layout_set_attributes(layout, attrs);
@ -2144,13 +2251,13 @@ void ScintillaGTK::PreeditChangedThis() {
gint x, y; gint x, y;
gdk_window_get_origin((PWidget(wText))->window, &x, &y); gdk_window_get_origin((PWidget(wText))->window, &x, &y);
Point pt = LocationFromPosition(currentPos); Point pt = PointMainCaret();
if (pt.x < 0) if (pt.x < 0)
pt.x = 0; pt.x = 0;
if (pt.y < 0) if (pt.y < 0)
pt.y = 0; pt.y = 0;
gtk_window_move(GTK_WINDOW(PWidget(wPreedit)), x+pt.x, y+pt.y); gtk_window_move(GTK_WINDOW(PWidget(wPreedit)), x + pt.x, y + pt.y);
gtk_window_resize(GTK_WINDOW(PWidget(wPreedit)), w, h); gtk_window_resize(GTK_WINDOW(PWidget(wPreedit)), w, h);
gtk_widget_show(PWidget(wPreedit)); gtk_widget_show(PWidget(wPreedit));
gtk_widget_queue_draw_area(PWidget(wPreeditDraw), 0, 0, w, h); gtk_widget_queue_draw_area(PWidget(wPreeditDraw), 0, 0, w, h);
@ -2159,6 +2266,13 @@ void ScintillaGTK::PreeditChangedThis() {
} }
g_free(str); g_free(str);
pango_attr_list_unref(attrs); pango_attr_list_unref(attrs);
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
}
void ScintillaGTK::PreeditChanged(GtkIMContext *, ScintillaGTK *sciThis) {
sciThis->PreeditChangedThis();
} }
#endif #endif
@ -2180,6 +2294,7 @@ void ScintillaGTK::Destroy(GtkObject *object)
void ScintillaGTK::Destroy(GObject *object) void ScintillaGTK::Destroy(GObject *object)
#endif #endif
{ {
try {
ScintillaObject *scio = reinterpret_cast<ScintillaObject *>(object); ScintillaObject *scio = reinterpret_cast<ScintillaObject *>(object);
// This avoids a double destruction // This avoids a double destruction
if (!scio->pscin) if (!scio->pscin)
@ -2197,6 +2312,9 @@ void ScintillaGTK::Destroy(GObject *object)
delete sciThis; delete sciThis;
scio->pscin = 0; scio->pscin = 0;
} catch (...) {
// Its dead so nowhere to save the status
}
} }
static void DrawChild(GtkWidget *widget, GdkRectangle *area) { static void DrawChild(GtkWidget *widget, GdkRectangle *area) {
@ -2210,6 +2328,7 @@ static void DrawChild(GtkWidget *widget, GdkRectangle *area) {
void ScintillaGTK::Draw(GtkWidget *widget, GdkRectangle *area) { void ScintillaGTK::Draw(GtkWidget *widget, GdkRectangle *area) {
ScintillaGTK *sciThis = ScintillaFromWidget(widget); ScintillaGTK *sciThis = ScintillaFromWidget(widget);
try {
//Platform::DebugPrintf("Draw %p %0d,%0d %0d,%0d\n", widget, area->x, area->y, area->width, area->height); //Platform::DebugPrintf("Draw %p %0d,%0d %0d,%0d\n", widget, area->x, area->y, area->width, area->height);
PRectangle rcPaint(area->x, area->y, area->x + area->width, area->y + area->height); PRectangle rcPaint(area->x, area->y, area->x + area->width, area->y + area->height);
sciThis->SyncPaint(rcPaint); sciThis->SyncPaint(rcPaint);
@ -2219,15 +2338,19 @@ void ScintillaGTK::Draw(GtkWidget *widget, GdkRectangle *area) {
} }
#ifdef INTERNATIONAL_INPUT #ifdef INTERNATIONAL_INPUT
Point pt = sciThis->LocationFromPosition(sciThis->currentPos); Point pt = sciThis->PointMainCaret();
pt.y += sciThis->vs.lineHeight - 2; pt.y += sciThis->vs.lineHeight - 2;
if (pt.x < 0) pt.x = 0; if (pt.x < 0) pt.x = 0;
if (pt.y < 0) pt.y = 0; if (pt.y < 0) pt.y = 0;
CursorMoved(widget, pt.x, pt.y, sciThis); CursorMoved(widget, pt.x, pt.y, sciThis);
#endif #endif
} catch (...) {
sciThis->errorStatus = SC_STATUS_FAILURE;
}
} }
gint ScintillaGTK::ExposeTextThis(GtkWidget * /*widget*/, GdkEventExpose *ose) { gint ScintillaGTK::ExposeTextThis(GtkWidget * /*widget*/, GdkEventExpose *ose) {
try {
paintState = painting; paintState = painting;
rcPaint.left = ose->area.x; rcPaint.left = ose->area.x;
@ -2258,6 +2381,9 @@ gint ScintillaGTK::ExposeTextThis(GtkWidget * /*widget*/, GdkEventExpose *ose) {
gdk_region_destroy(rgnUpdate); gdk_region_destroy(rgnUpdate);
} }
rgnUpdate = 0; rgnUpdate = 0;
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
return FALSE; return FALSE;
} }
@ -2274,6 +2400,7 @@ gint ScintillaGTK::ExposeMain(GtkWidget *widget, GdkEventExpose *ose) {
} }
gint ScintillaGTK::Expose(GtkWidget *, GdkEventExpose *ose) { gint ScintillaGTK::Expose(GtkWidget *, GdkEventExpose *ose) {
try {
//fprintf(stderr, "Expose %0d,%0d %0d,%0d\n", //fprintf(stderr, "Expose %0d,%0d %0d,%0d\n",
//ose->area.x, ose->area.y, ose->area.width, ose->area.height); //ose->area.x, ose->area.y, ose->area.width, ose->area.height);
@ -2323,15 +2450,26 @@ gint ScintillaGTK::Expose(GtkWidget *, GdkEventExpose *ose) {
GTK_CONTAINER(PWidget(wMain)), PWidget(scrollbarv), ose); GTK_CONTAINER(PWidget(wMain)), PWidget(scrollbarv), ose);
#endif #endif
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
return FALSE; return FALSE;
} }
void ScintillaGTK::ScrollSignal(GtkAdjustment *adj, ScintillaGTK *sciThis) { void ScintillaGTK::ScrollSignal(GtkAdjustment *adj, ScintillaGTK *sciThis) {
try {
sciThis->ScrollTo(static_cast<int>(adj->value), false); sciThis->ScrollTo(static_cast<int>(adj->value), false);
} catch (...) {
sciThis->errorStatus = SC_STATUS_FAILURE;
}
} }
void ScintillaGTK::ScrollHSignal(GtkAdjustment *adj, ScintillaGTK *sciThis) { void ScintillaGTK::ScrollHSignal(GtkAdjustment *adj, ScintillaGTK *sciThis) {
try {
sciThis->HorizontalScrollTo(static_cast<int>(adj->value * 2)); sciThis->HorizontalScrollTo(static_cast<int>(adj->value * 2));
} catch (...) {
sciThis->errorStatus = SC_STATUS_FAILURE;
}
} }
void ScintillaGTK::SelectionReceived(GtkWidget *widget, void ScintillaGTK::SelectionReceived(GtkWidget *widget,
@ -2344,6 +2482,7 @@ void ScintillaGTK::SelectionReceived(GtkWidget *widget,
void ScintillaGTK::SelectionGet(GtkWidget *widget, void ScintillaGTK::SelectionGet(GtkWidget *widget,
GtkSelectionData *selection_data, guint info, guint) { GtkSelectionData *selection_data, guint info, guint) {
ScintillaGTK *sciThis = ScintillaFromWidget(widget); ScintillaGTK *sciThis = ScintillaFromWidget(widget);
try {
//Platform::DebugPrintf("Selection get\n"); //Platform::DebugPrintf("Selection get\n");
if (selection_data->selection == GDK_SELECTION_PRIMARY) { if (selection_data->selection == GDK_SELECTION_PRIMARY) {
if (sciThis->primary.s == NULL) { if (sciThis->primary.s == NULL) {
@ -2356,6 +2495,9 @@ void ScintillaGTK::SelectionGet(GtkWidget *widget,
sciThis->GetSelection(selection_data, info, &sciThis->copyText); sciThis->GetSelection(selection_data, info, &sciThis->copyText);
} }
#endif #endif
} catch (...) {
sciThis->errorStatus = SC_STATUS_FAILURE;
}
} }
gint ScintillaGTK::SelectionClear(GtkWidget *widget, GdkEventSelection *selection_event) { gint ScintillaGTK::SelectionClear(GtkWidget *widget, GdkEventSelection *selection_event) {
@ -2378,11 +2520,12 @@ void ScintillaGTK::DragBegin(GtkWidget *, GdkDragContext *) {
gboolean ScintillaGTK::DragMotionThis(GdkDragContext *context, gboolean ScintillaGTK::DragMotionThis(GdkDragContext *context,
gint x, gint y, guint dragtime) { gint x, gint y, guint dragtime) {
try {
Point npt(x, y); Point npt(x, y);
SetDragPosition(PositionFromLocation(npt)); SetDragPosition(SPositionFromLocation(npt, false, false, UserVirtualSpace()));
GdkDragAction preferredAction = context->suggested_action; GdkDragAction preferredAction = context->suggested_action;
int pos = PositionFromLocation(npt); SelectionPosition pos = SPositionFromLocation(npt);
if ((inDragDrop == ddDragging) && (0 == PositionInSelection(pos))) { if ((inDragDrop == ddDragging) && (PositionInSelection(pos.Position()))) {
// Avoid dragging selection onto itself as that produces a move // Avoid dragging selection onto itself as that produces a move
// with no real effect but which creates undo actions. // with no real effect but which creates undo actions.
preferredAction = static_cast<GdkDragAction>(0); preferredAction = static_cast<GdkDragAction>(0);
@ -2391,6 +2534,9 @@ gboolean ScintillaGTK::DragMotionThis(GdkDragContext *context,
preferredAction = GDK_ACTION_MOVE; preferredAction = GDK_ACTION_MOVE;
} }
gdk_drag_status(context, preferredAction, dragtime); gdk_drag_status(context, preferredAction, dragtime);
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
return FALSE; return FALSE;
} }
@ -2402,55 +2548,75 @@ gboolean ScintillaGTK::DragMotion(GtkWidget *widget, GdkDragContext *context,
void ScintillaGTK::DragLeave(GtkWidget *widget, GdkDragContext * /*context*/, guint) { void ScintillaGTK::DragLeave(GtkWidget *widget, GdkDragContext * /*context*/, guint) {
ScintillaGTK *sciThis = ScintillaFromWidget(widget); ScintillaGTK *sciThis = ScintillaFromWidget(widget);
sciThis->SetDragPosition(invalidPosition); try {
sciThis->SetDragPosition(SelectionPosition(invalidPosition));
//Platform::DebugPrintf("DragLeave %x\n", sciThis); //Platform::DebugPrintf("DragLeave %x\n", sciThis);
} catch (...) {
sciThis->errorStatus = SC_STATUS_FAILURE;
}
} }
void ScintillaGTK::DragEnd(GtkWidget *widget, GdkDragContext * /*context*/) { void ScintillaGTK::DragEnd(GtkWidget *widget, GdkDragContext * /*context*/) {
ScintillaGTK *sciThis = ScintillaFromWidget(widget); ScintillaGTK *sciThis = ScintillaFromWidget(widget);
try {
// If drag did not result in drop here or elsewhere // If drag did not result in drop here or elsewhere
if (!sciThis->dragWasDropped) if (!sciThis->dragWasDropped)
sciThis->SetEmptySelection(sciThis->posDrag); sciThis->SetEmptySelection(sciThis->posDrag);
sciThis->SetDragPosition(invalidPosition); sciThis->SetDragPosition(SelectionPosition(invalidPosition));
//Platform::DebugPrintf("DragEnd %x %d\n", sciThis, sciThis->dragWasDropped); //Platform::DebugPrintf("DragEnd %x %d\n", sciThis, sciThis->dragWasDropped);
sciThis->inDragDrop = ddNone; sciThis->inDragDrop = ddNone;
} catch (...) {
sciThis->errorStatus = SC_STATUS_FAILURE;
}
} }
gboolean ScintillaGTK::Drop(GtkWidget *widget, GdkDragContext * /*context*/, gboolean ScintillaGTK::Drop(GtkWidget *widget, GdkDragContext * /*context*/,
gint, gint, guint) { gint, gint, guint) {
ScintillaGTK *sciThis = ScintillaFromWidget(widget); ScintillaGTK *sciThis = ScintillaFromWidget(widget);
try {
//Platform::DebugPrintf("Drop %x\n", sciThis); //Platform::DebugPrintf("Drop %x\n", sciThis);
sciThis->SetDragPosition(invalidPosition); sciThis->SetDragPosition(SelectionPosition(invalidPosition));
} catch (...) {
sciThis->errorStatus = SC_STATUS_FAILURE;
}
return FALSE; return FALSE;
} }
void ScintillaGTK::DragDataReceived(GtkWidget *widget, GdkDragContext * /*context*/, void ScintillaGTK::DragDataReceived(GtkWidget *widget, GdkDragContext * /*context*/,
gint, gint, GtkSelectionData *selection_data, guint /*info*/, guint) { gint, gint, GtkSelectionData *selection_data, guint /*info*/, guint) {
ScintillaGTK *sciThis = ScintillaFromWidget(widget); ScintillaGTK *sciThis = ScintillaFromWidget(widget);
try {
sciThis->ReceivedDrop(selection_data); sciThis->ReceivedDrop(selection_data);
sciThis->SetDragPosition(invalidPosition); sciThis->SetDragPosition(SelectionPosition(invalidPosition));
} catch (...) {
sciThis->errorStatus = SC_STATUS_FAILURE;
}
} }
void ScintillaGTK::DragDataGet(GtkWidget *widget, GdkDragContext *context, void ScintillaGTK::DragDataGet(GtkWidget *widget, GdkDragContext *context,
GtkSelectionData *selection_data, guint info, guint) { GtkSelectionData *selection_data, guint info, guint) {
ScintillaGTK *sciThis = ScintillaFromWidget(widget); ScintillaGTK *sciThis = ScintillaFromWidget(widget);
try {
sciThis->dragWasDropped = true; sciThis->dragWasDropped = true;
if (sciThis->currentPos != sciThis->anchor) { if (!sciThis->sel.Empty()) {
sciThis->GetSelection(selection_data, info, &sciThis->drag); sciThis->GetSelection(selection_data, info, &sciThis->drag);
} }
if (context->action == GDK_ACTION_MOVE) { if (context->action == GDK_ACTION_MOVE) {
int selStart = sciThis->SelectionStart(); for (size_t r=0; r<sciThis->sel.Count(); r++) {
int selEnd = sciThis->SelectionEnd(); if (sciThis->posDrop >= sciThis->sel.Range(r).Start()) {
if (sciThis->posDrop > selStart) { if (sciThis->posDrop > sciThis->sel.Range(r).End()) {
if (sciThis->posDrop > selEnd) sciThis->posDrop.Add(-sciThis->sel.Range(r).Length());
sciThis->posDrop = sciThis->posDrop - (selEnd - selStart); } else {
else sciThis->posDrop.Add(-SelectionRange(sciThis->posDrop, sciThis->sel.Range(r).Start()).Length());
sciThis->posDrop = selStart; }
sciThis->posDrop = sciThis->pdoc->ClampPositionIntoDocument(sciThis->posDrop); }
} }
sciThis->ClearSelection(); sciThis->ClearSelection();
} }
sciThis->SetDragPosition(invalidPosition); sciThis->SetDragPosition(SelectionPosition(invalidPosition));
} catch (...) {
sciThis->errorStatus = SC_STATUS_FAILURE;
}
} }
int ScintillaGTK::TimeOut(ScintillaGTK *sciThis) { int ScintillaGTK::TimeOut(ScintillaGTK *sciThis) {
@ -2478,6 +2644,7 @@ void ScintillaGTK::PopUpCB(ScintillaGTK *sciThis, guint action, GtkWidget *) {
} }
gint ScintillaGTK::PressCT(GtkWidget *widget, GdkEventButton *event, ScintillaGTK *sciThis) { gint ScintillaGTK::PressCT(GtkWidget *widget, GdkEventButton *event, ScintillaGTK *sciThis) {
try {
if (event->window != widget->window) if (event->window != widget->window)
return FALSE; return FALSE;
if (event->type != GDK_BUTTON_PRESS) if (event->type != GDK_BUTTON_PRESS)
@ -2487,6 +2654,8 @@ gint ScintillaGTK::PressCT(GtkWidget *widget, GdkEventButton *event, ScintillaGT
pt.y = int(event->y); pt.y = int(event->y);
sciThis->ct.MouseClick(pt); sciThis->ct.MouseClick(pt);
sciThis->CallTipClick(); sciThis->CallTipClick();
} catch (...) {
}
#if GTK_MAJOR_VERSION >= 2 #if GTK_MAJOR_VERSION >= 2
return TRUE; return TRUE;
#else #else
@ -2495,6 +2664,7 @@ gint ScintillaGTK::PressCT(GtkWidget *widget, GdkEventButton *event, ScintillaGT
} }
gint ScintillaGTK::ExposeCT(GtkWidget *widget, GdkEventExpose * /*ose*/, CallTip *ctip) { gint ScintillaGTK::ExposeCT(GtkWidget *widget, GdkEventExpose * /*ose*/, CallTip *ctip) {
try {
Surface *surfaceWindow = Surface::Allocate(); Surface *surfaceWindow = Surface::Allocate();
if (surfaceWindow) { if (surfaceWindow) {
surfaceWindow->Init(widget->window, widget); surfaceWindow->Init(widget->window, widget);
@ -2504,6 +2674,9 @@ gint ScintillaGTK::ExposeCT(GtkWidget *widget, GdkEventExpose * /*ose*/, CallTip
surfaceWindow->Release(); surfaceWindow->Release();
delete surfaceWindow; delete surfaceWindow;
} }
} catch (...) {
// No pointer back to Scintilla to save status
}
return TRUE; return TRUE;
} }
@ -2526,6 +2699,7 @@ extern void Platform_Finalise();
#if GLIB_MAJOR_VERSION < 2 #if GLIB_MAJOR_VERSION < 2
GtkType scintilla_get_type() { GtkType scintilla_get_type() {
static GtkType scintilla_type = 0; static GtkType scintilla_type = 0;
try {
if (!scintilla_type) { if (!scintilla_type) {
Platform_Initialise(); Platform_Initialise();
@ -2543,11 +2717,14 @@ GtkType scintilla_get_type() {
scintilla_type = gtk_type_unique(gtk_container_get_type(), &scintilla_info); scintilla_type = gtk_type_unique(gtk_container_get_type(), &scintilla_info);
} }
} catch (...) {
}
return scintilla_type; return scintilla_type;
} }
#else #else
GType scintilla_get_type() { GType scintilla_get_type() {
static GType scintilla_type = 0; static GType scintilla_type = 0;
try {
if (!scintilla_type) { if (!scintilla_type) {
scintilla_type = g_type_from_name("Scintilla"); scintilla_type = g_type_from_name("Scintilla");
@ -2570,6 +2747,8 @@ GType scintilla_get_type() {
} }
} }
} catch (...) {
}
return scintilla_type; return scintilla_type;
} }
#endif #endif
@ -2641,6 +2820,7 @@ void ScintillaGTK::ClassInit(OBJECT_CLASS* object_class, GtkWidgetClass *widget_
#endif #endif
static void scintilla_class_init(ScintillaClass *klass) { static void scintilla_class_init(ScintillaClass *klass) {
try {
OBJECT_CLASS *object_class = (OBJECT_CLASS*) klass; OBJECT_CLASS *object_class = (OBJECT_CLASS*) klass;
GtkWidgetClass *widget_class = (GtkWidgetClass*) klass; GtkWidgetClass *widget_class = (GtkWidgetClass*) klass;
GtkContainerClass *container_class = (GtkContainerClass*) klass; GtkContainerClass *container_class = (GtkContainerClass*) klass;
@ -2695,11 +2875,16 @@ static void scintilla_class_init(ScintillaClass *klass) {
klass->notify = NULL; klass->notify = NULL;
ScintillaGTK::ClassInit(object_class, widget_class, container_class); ScintillaGTK::ClassInit(object_class, widget_class, container_class);
} catch (...) {
}
} }
static void scintilla_init(ScintillaObject *sci) { static void scintilla_init(ScintillaObject *sci) {
try {
GTK_WIDGET_SET_FLAGS(sci, GTK_CAN_FOCUS); GTK_WIDGET_SET_FLAGS(sci, GTK_CAN_FOCUS);
sci->pscin = new ScintillaGTK(sci); sci->pscin = new ScintillaGTK(sci);
} catch (...) {
}
} }
GtkWidget* scintilla_new() { GtkWidget* scintilla_new() {
@ -2716,5 +2901,8 @@ void scintilla_set_id(ScintillaObject *sci, uptr_t id) {
} }
void scintilla_release_resources(void) { void scintilla_release_resources(void) {
try {
Platform_Finalise(); Platform_Finalise();
} catch (...) {
}
} }

View File

@ -3,18 +3,18 @@ PlatGTK.o: PlatGTK.cxx \
../src/UniConversion.h ../src/XPM.h Converter.h ../src/UniConversion.h ../src/XPM.h Converter.h
ScintillaGTK.o: ScintillaGTK.cxx \ ScintillaGTK.o: ScintillaGTK.cxx \
../include/Scintilla.h ../include/ScintillaWidget.h \ ../include/Scintilla.h ../include/ScintillaWidget.h \
../include/SciLexer.h ../include/PropSet.h ../include/SString.h \ ../include/SciLexer.h ../include/PropSet.h ../src/PropSetSimple.h \
../include/Accessor.h ../include/KeyWords.h ../src/SVector.h \ ../include/Accessor.h ../include/KeyWords.h ../src/SVector.h \
../src/SplitVector.h ../src/Partitioning.h ../src/RunStyles.h \ ../src/SplitVector.h ../src/Partitioning.h ../src/RunStyles.h \
../src/ContractionState.h ../src/CellBuffer.h ../src/CallTip.h \ ../src/ContractionState.h ../src/CellBuffer.h ../src/CallTip.h \
../src/KeyMap.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \ ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \
../src/Style.h ../src/AutoComplete.h ../src/ViewStyle.h \ ../src/Style.h ../src/AutoComplete.h ../src/ViewStyle.h \
../src/Decoration.h ../src/CharClassify.h ../src/Document.h \ ../src/Decoration.h ../src/CharClassify.h ../src/Document.h \
../src/PositionCache.h ../src/Editor.h ../include/SString.h \ ../src/Selection.h ../src/PositionCache.h ../src/Editor.h \
../src/ScintillaBase.h ../src/UniConversion.h scintilla-marshal.h \ ../src/ScintillaBase.h ../src/UniConversion.h scintilla-marshal.h \
../src/ExternalLexer.h Converter.h ../src/ExternalLexer.h Converter.h
AutoComplete.o: ../src/AutoComplete.cxx ../include/Platform.h \ AutoComplete.o: ../src/AutoComplete.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../src/AutoComplete.h ../src/CharClassify.h ../src/AutoComplete.h
CallTip.o: ../src/CallTip.cxx ../include/Platform.h \ CallTip.o: ../src/CallTip.cxx ../include/Platform.h \
../include/Scintilla.h ../src/CallTip.h ../include/Scintilla.h ../src/CallTip.h
CellBuffer.o: ../src/CellBuffer.cxx ../include/Platform.h \ CellBuffer.o: ../src/CellBuffer.cxx ../include/Platform.h \
@ -28,10 +28,10 @@ Decoration.o: ../src/Decoration.cxx ../include/Platform.h \
../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \ ../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \
../src/RunStyles.h ../src/Decoration.h ../src/RunStyles.h ../src/Decoration.h
DocumentAccessor.o: ../src/DocumentAccessor.cxx ../include/Platform.h \ DocumentAccessor.o: ../src/DocumentAccessor.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../src/DocumentAccessor.h \
../src/DocumentAccessor.h ../src/SplitVector.h ../src/Partitioning.h \ ../src/SplitVector.h ../src/Partitioning.h ../src/RunStyles.h \
../src/RunStyles.h ../src/CellBuffer.h ../include/Scintilla.h \ ../src/CellBuffer.h ../include/Scintilla.h ../src/CharClassify.h \
../src/CharClassify.h ../src/Decoration.h ../src/Document.h ../src/Decoration.h ../src/Document.h
Document.o: ../src/Document.cxx ../include/Platform.h \ Document.o: ../src/Document.cxx ../include/Platform.h \
../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \ ../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \
../src/RunStyles.h ../src/CellBuffer.h ../src/PerLine.h \ ../src/RunStyles.h ../src/CellBuffer.h ../src/PerLine.h \
@ -42,284 +42,253 @@ Editor.o: ../src/Editor.cxx ../include/Platform.h ../include/Scintilla.h \
../src/ContractionState.h ../src/CellBuffer.h ../src/KeyMap.h \ ../src/ContractionState.h ../src/CellBuffer.h ../src/KeyMap.h \
../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \ ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \
../src/ViewStyle.h ../src/CharClassify.h ../src/Decoration.h \ ../src/ViewStyle.h ../src/CharClassify.h ../src/Decoration.h \
../src/Document.h ../src/PositionCache.h ../src/Editor.h ../src/Document.h ../src/Selection.h ../src/PositionCache.h \
../src/Editor.h
ExternalLexer.o: ../src/ExternalLexer.cxx ../include/Platform.h \ ExternalLexer.o: ../src/ExternalLexer.cxx ../include/Platform.h \
../include/Scintilla.h ../include/SciLexer.h ../include/PropSet.h \ ../include/Scintilla.h ../include/SciLexer.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/DocumentAccessor.h \ ../include/Accessor.h ../src/DocumentAccessor.h ../include/KeyWords.h \
../include/KeyWords.h ../src/ExternalLexer.h ../src/ExternalLexer.h
Indicator.o: ../src/Indicator.cxx ../include/Platform.h \ Indicator.o: ../src/Indicator.cxx ../include/Platform.h \
../include/Scintilla.h ../src/Indicator.h ../include/Scintilla.h ../src/Indicator.h
KeyMap.o: ../src/KeyMap.cxx ../include/Platform.h ../include/Scintilla.h \ KeyMap.o: ../src/KeyMap.cxx ../include/Platform.h ../include/Scintilla.h \
../src/KeyMap.h ../src/KeyMap.h
KeyWords.o: ../src/KeyWords.cxx ../include/Platform.h \ KeyWords.o: ../src/KeyWords.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../include/KeyWords.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/Scintilla.h ../include/SciLexer.h
LexAbaqus.o: ../src/LexAbaqus.cxx ../include/Platform.h \ LexAbaqus.o: ../src/LexAbaqus.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
../include/SciLexer.h
LexAda.o: ../src/LexAda.cxx ../include/Platform.h ../include/Accessor.h \ LexAda.o: ../src/LexAda.cxx ../include/Platform.h ../include/Accessor.h \
../src/StyleContext.h ../include/PropSet.h ../include/SString.h \ ../src/StyleContext.h ../include/PropSet.h ../include/KeyWords.h \
../include/KeyWords.h ../include/SciLexer.h ../include/SString.h
LexAPDL.o: ../src/LexAPDL.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexAsm.o: ../src/LexAsm.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexAsn1.o: ../src/LexAsn1.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexASY.o: ../src/LexASY.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h \
../src/CharacterSet.h
LexAU3.o: ../src/LexAU3.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexAVE.o: ../src/LexAVE.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexBaan.o: ../src/LexBaan.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexBash.o: ../src/LexBash.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h \
../src/CharacterSet.h
LexBasic.o: ../src/LexBasic.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h ../include/SciLexer.h
LexBullant.o: ../src/LexBullant.cxx ../include/Platform.h \ LexAPDL.o: ../src/LexAPDL.cxx ../include/Platform.h ../include/PropSet.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h
LexAsm.o: ../src/LexAsm.cxx ../include/Platform.h ../include/PropSet.h \
../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h
LexAsn1.o: ../src/LexAsn1.cxx ../include/Platform.h ../include/PropSet.h \
../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h
LexASY.o: ../src/LexASY.cxx ../include/Platform.h ../include/PropSet.h \
../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h ../src/CharacterSet.h
LexAU3.o: ../src/LexAU3.cxx ../include/Platform.h ../include/PropSet.h \
../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h
LexAVE.o: ../src/LexAVE.cxx ../include/Platform.h ../include/PropSet.h \
../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h
LexBaan.o: ../src/LexBaan.cxx ../include/Platform.h ../include/PropSet.h \
../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h
LexBash.o: ../src/LexBash.cxx ../include/Platform.h ../include/PropSet.h \
../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h ../src/CharacterSet.h
LexBasic.o: ../src/LexBasic.cxx ../include/Platform.h \
../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexBullant.o: ../src/LexBullant.cxx ../include/Platform.h \
../include/PropSet.h ../include/Accessor.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h
LexCaml.o: ../src/LexCaml.cxx ../include/Platform.h ../include/PropSet.h \ LexCaml.o: ../src/LexCaml.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../src/PropSetSimple.h ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexCLW.o: ../src/LexCLW.cxx ../include/Platform.h ../include/PropSet.h \ LexCLW.o: ../src/LexCLW.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/Scintilla.h ../include/SciLexer.h
LexCmake.o: ../src/LexCmake.cxx ../include/Platform.h \ LexCmake.o: ../src/LexCmake.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../src/CharClassify.h ../include/PropSet.h ../include/Accessor.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexCOBOL.o: ../src/LexCOBOL.cxx ../include/Platform.h \ LexCOBOL.o: ../src/LexCOBOL.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../include/KeyWords.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h \ ../include/Scintilla.h ../include/SciLexer.h ../src/StyleContext.h
../src/StyleContext.h
LexConf.o: ../src/LexConf.cxx ../include/Platform.h ../include/PropSet.h \ LexConf.o: ../src/LexConf.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../include/KeyWords.h \ ../include/Accessor.h ../include/KeyWords.h ../include/Scintilla.h \
../include/Scintilla.h ../include/SciLexer.h ../include/SciLexer.h
LexCPP.o: ../src/LexCPP.cxx ../include/Platform.h ../include/PropSet.h \ LexCPP.o: ../src/LexCPP.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h \ ../include/Scintilla.h ../include/SciLexer.h ../src/CharacterSet.h
../src/CharacterSet.h
LexCrontab.o: ../src/LexCrontab.cxx ../include/Platform.h \ LexCrontab.o: ../src/LexCrontab.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../include/KeyWords.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/Scintilla.h ../include/SciLexer.h
LexCsound.o: ../src/LexCsound.cxx ../include/Platform.h \ LexCsound.o: ../src/LexCsound.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
../include/SciLexer.h
LexCSS.o: ../src/LexCSS.cxx ../include/Platform.h ../include/PropSet.h \ LexCSS.o: ../src/LexCSS.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/Scintilla.h ../include/SciLexer.h
LexD.o: ../src/LexD.cxx ../include/Platform.h ../include/PropSet.h \ LexD.o: ../src/LexD.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/Scintilla.h ../include/SciLexer.h
LexEiffel.o: ../src/LexEiffel.cxx ../include/Platform.h \ LexEiffel.o: ../src/LexEiffel.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
../include/SciLexer.h
LexErlang.o: ../src/LexErlang.cxx ../include/Platform.h \ LexErlang.o: ../src/LexErlang.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
../include/SciLexer.h
LexEScript.o: ../src/LexEScript.cxx ../include/Platform.h \ LexEScript.o: ../src/LexEScript.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
../include/SciLexer.h
LexFlagship.o: ../src/LexFlagship.cxx ../include/Platform.h \ LexFlagship.o: ../src/LexFlagship.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
../include/SciLexer.h
LexForth.o: ../src/LexForth.cxx ../include/Platform.h \ LexForth.o: ../src/LexForth.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexFortran.o: ../src/LexFortran.cxx ../include/Platform.h \ LexFortran.o: ../src/LexFortran.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h
LexGAP.o: ../src/LexGAP.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexGAP.o: ../src/LexGAP.cxx ../include/Platform.h ../include/PropSet.h \
../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h
LexGui4Cli.o: ../src/LexGui4Cli.cxx ../include/Platform.h \ LexGui4Cli.o: ../src/LexGui4Cli.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
../include/SciLexer.h
LexHaskell.o: ../src/LexHaskell.cxx ../include/Platform.h \ LexHaskell.o: ../src/LexHaskell.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../src/PropSetSimple.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h ../include/SciLexer.h
LexHTML.o: ../src/LexHTML.cxx ../include/Platform.h ../include/PropSet.h \ LexHTML.o: ../src/LexHTML.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h \ ../include/Scintilla.h ../include/SciLexer.h ../src/CharacterSet.h
../src/CharacterSet.h LexInno.o: ../src/LexInno.cxx ../include/Platform.h ../src/CharClassify.h \
LexInno.o: ../src/LexInno.cxx ../include/Platform.h ../include/PropSet.h \ ../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexKix.o: ../src/LexKix.cxx ../include/Platform.h ../include/PropSet.h \ LexKix.o: ../src/LexKix.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/Scintilla.h ../include/SciLexer.h
LexLisp.o: ../src/LexLisp.cxx ../include/Platform.h ../include/PropSet.h \ LexLisp.o: ../src/LexLisp.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../include/KeyWords.h \ ../include/Accessor.h ../include/KeyWords.h ../include/Scintilla.h \
../include/Scintilla.h ../include/SciLexer.h ../src/StyleContext.h ../include/SciLexer.h ../src/StyleContext.h
LexLout.o: ../src/LexLout.cxx ../include/Platform.h ../include/PropSet.h \ LexLout.o: ../src/LexLout.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/Scintilla.h ../include/SciLexer.h
LexLua.o: ../src/LexLua.cxx ../include/Platform.h ../include/PropSet.h \ LexLua.o: ../src/LexLua.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h \ ../include/Scintilla.h ../include/SciLexer.h ../src/CharacterSet.h
../src/CharacterSet.h
LexMagik.o: ../src/LexMagik.cxx ../include/Platform.h \ LexMagik.o: ../src/LexMagik.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h
LexMatlab.o: ../src/LexMatlab.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h
LexMetapost.o: ../src/LexMetapost.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h \
../src/StyleContext.h
LexMMIXAL.o: ../src/LexMMIXAL.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h
LexMPT.o: ../src/LexMPT.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h ../include/SString.h
LexMSSQL.o: ../src/LexMSSQL.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexMatlab.o: ../src/LexMatlab.cxx ../include/Platform.h \
../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexMetapost.o: ../src/LexMetapost.cxx ../include/Platform.h \
../include/PropSet.h ../include/Accessor.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h ../src/StyleContext.h
LexMMIXAL.o: ../src/LexMMIXAL.cxx ../include/Platform.h \
../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexMPT.o: ../src/LexMPT.cxx ../include/Platform.h ../include/PropSet.h \
../include/Accessor.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h
LexMSSQL.o: ../src/LexMSSQL.cxx ../include/Platform.h \
../include/PropSet.h ../include/Accessor.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h
LexMySQL.o: ../src/LexMySQL.cxx ../include/Platform.h \ LexMySQL.o: ../src/LexMySQL.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
../include/SciLexer.h
LexNimrod.o: ../src/LexNimrod.cxx ../include/Platform.h \ LexNimrod.o: ../src/LexNimrod.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
../include/SciLexer.h LexNsis.o: ../src/LexNsis.cxx ../include/Platform.h ../src/CharClassify.h \
LexNsis.o: ../src/LexNsis.cxx ../include/Platform.h ../include/PropSet.h \ ../include/PropSet.h ../include/Accessor.h ../include/KeyWords.h \
../include/SString.h ../include/Accessor.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h ../include/Scintilla.h ../include/SciLexer.h
LexOpal.o: ../src/LexOpal.cxx ../include/Platform.h ../include/PropSet.h \ LexOpal.o: ../src/LexOpal.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../include/KeyWords.h \ ../include/Accessor.h ../include/KeyWords.h ../include/Scintilla.h \
../include/Scintilla.h ../include/SciLexer.h ../src/StyleContext.h ../include/SciLexer.h ../src/StyleContext.h
LexOthers.o: ../src/LexOthers.cxx ../include/Platform.h \ LexOthers.o: ../src/LexOthers.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../src/CharClassify.h ../include/PropSet.h ../include/Accessor.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexPascal.o: ../src/LexPascal.cxx ../include/Platform.h \ LexPascal.o: ../src/LexPascal.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../include/KeyWords.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h \ ../include/Scintilla.h ../include/SciLexer.h ../src/StyleContext.h \
../src/StyleContext.h ../src/CharacterSet.h ../src/CharacterSet.h
LexPB.o: ../src/LexPB.cxx ../include/Platform.h ../include/PropSet.h \ LexPB.o: ../src/LexPB.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/Scintilla.h ../include/SciLexer.h
LexPerl.o: ../src/LexPerl.cxx ../include/Platform.h ../include/PropSet.h \ LexPerl.o: ../src/LexPerl.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h ../src/CharacterSet.h
LexPLM.o: ../src/LexPLM.cxx ../include/Platform.h ../include/PropSet.h \
../include/Accessor.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h ../src/StyleContext.h
LexPOV.o: ../src/LexPOV.cxx ../include/Platform.h ../include/PropSet.h \
../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h
LexPowerPro.o: ../src/LexPowerPro.cxx ../include/Platform.h \
../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h \ ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h \
../src/CharacterSet.h ../src/CharacterSet.h
LexPLM.o: ../src/LexPLM.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h ../src/StyleContext.h
LexPOV.o: ../src/LexPOV.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexPowerPro.o: ../src/LexPowerPro.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h ../src/CharacterSet.h
LexPowerShell.o: ../src/LexPowerShell.cxx ../include/Platform.h \ LexPowerShell.o: ../src/LexPowerShell.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
../include/SciLexer.h
LexProgress.o: ../src/LexProgress.cxx ../include/Platform.h \ LexProgress.o: ../src/LexProgress.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
../include/SciLexer.h
LexPS.o: ../src/LexPS.cxx ../include/Platform.h ../include/PropSet.h \ LexPS.o: ../src/LexPS.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexPython.o: ../src/LexPython.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h
LexR.o: ../src/LexR.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexRebol.o: ../src/LexRebol.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h \
../src/StyleContext.h
LexRuby.o: ../src/LexRuby.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h ../include/Scintilla.h ../include/SciLexer.h
LexPython.o: ../src/LexPython.cxx ../include/Platform.h \
../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexR.o: ../src/LexR.cxx ../include/Platform.h ../include/PropSet.h \
../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h
LexRebol.o: ../src/LexRebol.cxx ../include/Platform.h \
../include/PropSet.h ../include/Accessor.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h ../src/StyleContext.h
LexRuby.o: ../src/LexRuby.cxx ../include/Platform.h ../include/PropSet.h \
../include/Accessor.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h
LexScriptol.o: ../src/LexScriptol.cxx ../include/Platform.h \ LexScriptol.o: ../src/LexScriptol.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../include/KeyWords.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/Scintilla.h ../include/SciLexer.h
LexSmalltalk.o: ../src/LexSmalltalk.cxx ../include/Platform.h \ LexSmalltalk.o: ../src/LexSmalltalk.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h
LexSML.o: ../src/LexSML.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexSML.o: ../src/LexSML.cxx ../include/Platform.h ../include/PropSet.h \
../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h
LexSorcus.o: ../src/LexSorcus.cxx ../include/Platform.h \ LexSorcus.o: ../src/LexSorcus.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
../include/SciLexer.h
LexSpecman.o: ../src/LexSpecman.cxx ../include/Platform.h \ LexSpecman.o: ../src/LexSpecman.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
../include/SciLexer.h
LexSpice.o: ../src/LexSpice.cxx ../include/Platform.h \ LexSpice.o: ../src/LexSpice.cxx ../include/Platform.h \
../include/Accessor.h ../src/StyleContext.h ../include/PropSet.h \ ../include/Accessor.h ../src/StyleContext.h ../include/PropSet.h \
../include/SString.h ../include/KeyWords.h ../include/SciLexer.h \ ../include/KeyWords.h ../include/SciLexer.h
../include/SString.h
LexSQL.o: ../src/LexSQL.cxx ../include/Platform.h ../include/PropSet.h \ LexSQL.o: ../src/LexSQL.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/Scintilla.h ../include/SciLexer.h
LexTACL.o: ../src/LexTACL.cxx ../include/Platform.h ../include/PropSet.h \ LexTACL.o: ../src/LexTACL.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../include/KeyWords.h \ ../include/Accessor.h ../include/KeyWords.h ../include/Scintilla.h \
../include/Scintilla.h ../include/SciLexer.h ../src/StyleContext.h ../include/SciLexer.h ../src/StyleContext.h
LexTADS3.o: ../src/LexTADS3.cxx ../include/Platform.h \ LexTADS3.o: ../src/LexTADS3.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
../include/SciLexer.h
LexTAL.o: ../src/LexTAL.cxx ../include/Platform.h ../include/PropSet.h \ LexTAL.o: ../src/LexTAL.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../include/KeyWords.h \ ../include/Accessor.h ../include/KeyWords.h ../include/Scintilla.h \
../include/Scintilla.h ../include/SciLexer.h ../src/StyleContext.h ../include/SciLexer.h ../src/StyleContext.h
LexTCL.o: ../src/LexTCL.cxx ../include/Platform.h ../include/PropSet.h \ LexTCL.o: ../src/LexTCL.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/Scintilla.h ../include/SciLexer.h
LexTeX.o: ../src/LexTeX.cxx ../include/Platform.h ../include/PropSet.h \ LexTeX.o: ../src/LexTeX.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../include/KeyWords.h \ ../include/Accessor.h ../include/KeyWords.h ../include/Scintilla.h \
../include/Scintilla.h ../include/SciLexer.h ../src/StyleContext.h ../include/SciLexer.h ../src/StyleContext.h
LexVB.o: ../src/LexVB.cxx ../include/Platform.h ../include/PropSet.h \ LexVB.o: ../src/LexVB.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/Scintilla.h ../include/SciLexer.h
LexVerilog.o: ../src/LexVerilog.cxx ../include/Platform.h \ LexVerilog.o: ../src/LexVerilog.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
../include/SciLexer.h
LexVHDL.o: ../src/LexVHDL.cxx ../include/Platform.h ../include/PropSet.h \ LexVHDL.o: ../src/LexVHDL.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/Scintilla.h ../include/SciLexer.h
LexYAML.o: ../src/LexYAML.cxx ../include/Platform.h ../include/PropSet.h \ LexYAML.o: ../src/LexYAML.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h ../include/KeyWords.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/Scintilla.h ../include/SciLexer.h
LineMarker.o: ../src/LineMarker.cxx ../include/Platform.h \ LineMarker.o: ../src/LineMarker.cxx ../include/Platform.h \
../include/Scintilla.h ../src/XPM.h ../src/LineMarker.h ../include/Scintilla.h ../src/XPM.h ../src/LineMarker.h
PerLine.o: ../src/PerLine.cxx ../include/Platform.h \ PerLine.o: ../src/PerLine.cxx ../include/Platform.h \
@ -330,26 +299,28 @@ PositionCache.o: ../src/PositionCache.cxx ../include/Platform.h \
../src/RunStyles.h ../src/ContractionState.h ../src/CellBuffer.h \ ../src/RunStyles.h ../src/ContractionState.h ../src/CellBuffer.h \
../src/KeyMap.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \ ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \
../src/Style.h ../src/ViewStyle.h ../src/CharClassify.h \ ../src/Style.h ../src/ViewStyle.h ../src/CharClassify.h \
../src/Decoration.h ../src/Document.h ../src/PositionCache.h ../src/Decoration.h ../src/Document.h ../src/Selection.h \
../src/PositionCache.h
PropSet.o: ../src/PropSet.cxx ../include/Platform.h ../include/PropSet.h \ PropSet.o: ../src/PropSet.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../src/PropSetSimple.h
RESearch.o: ../src/RESearch.cxx ../src/CharClassify.h ../src/RESearch.h RESearch.o: ../src/RESearch.cxx ../src/CharClassify.h ../src/RESearch.h
RunStyles.o: ../src/RunStyles.cxx ../include/Platform.h \ RunStyles.o: ../src/RunStyles.cxx ../include/Platform.h \
../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \ ../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \
../src/RunStyles.h ../src/RunStyles.h
ScintillaBase.o: ../src/ScintillaBase.cxx ../include/Platform.h \ ScintillaBase.o: ../src/ScintillaBase.cxx ../include/Platform.h \
../include/Scintilla.h ../include/PropSet.h ../include/SString.h \ ../include/Scintilla.h ../include/PropSet.h ../src/PropSetSimple.h \
../include/SciLexer.h ../include/Accessor.h ../src/DocumentAccessor.h \ ../include/SciLexer.h ../include/Accessor.h ../src/DocumentAccessor.h \
../include/KeyWords.h ../src/SplitVector.h ../src/Partitioning.h \ ../include/KeyWords.h ../src/SplitVector.h ../src/Partitioning.h \
../src/RunStyles.h ../src/ContractionState.h ../src/CellBuffer.h \ ../src/RunStyles.h ../src/ContractionState.h ../src/CellBuffer.h \
../src/CallTip.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \ ../src/CallTip.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \
../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \ ../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \
../src/AutoComplete.h ../src/CharClassify.h ../src/Decoration.h \ ../src/AutoComplete.h ../src/CharClassify.h ../src/Decoration.h \
../src/Document.h ../src/PositionCache.h ../src/Editor.h \ ../src/Document.h ../src/Selection.h ../src/PositionCache.h \
../src/ScintillaBase.h ../src/Editor.h ../src/ScintillaBase.h
Selection.o: ../src/Selection.cxx ../include/Platform.h \
../include/Scintilla.h ../src/Selection.h
StyleContext.o: ../src/StyleContext.cxx ../include/Platform.h \ StyleContext.o: ../src/StyleContext.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../src/StyleContext.h
../src/StyleContext.h
Style.o: ../src/Style.cxx ../include/Platform.h ../include/Scintilla.h \ Style.o: ../src/Style.cxx ../include/Platform.h ../include/Scintilla.h \
../src/Style.h ../src/Style.h
UniConversion.o: ../src/UniConversion.cxx ../src/UniConversion.h UniConversion.o: ../src/UniConversion.cxx ../src/UniConversion.h
@ -358,6 +329,6 @@ ViewStyle.o: ../src/ViewStyle.cxx ../include/Platform.h \
../src/RunStyles.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \ ../src/RunStyles.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \
../src/Style.h ../src/ViewStyle.h ../src/Style.h ../src/ViewStyle.h
WindowAccessor.o: ../src/WindowAccessor.cxx ../include/Platform.h \ WindowAccessor.o: ../src/WindowAccessor.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h ../include/WindowAccessor.h \
../include/WindowAccessor.h ../include/Scintilla.h ../include/Scintilla.h
XPM.o: ../src/XPM.cxx ../include/Platform.h ../src/XPM.h XPM.o: ../src/XPM.cxx ../include/Platform.h ../src/XPM.h

View File

@ -40,17 +40,17 @@ endif
# If explicit setting of GTK1 or GTK2 then use that else look for # If explicit setting of GTK1 or GTK2 then use that else look for
# pkg-config which is an OK indication that GTK2 is available # pkg-config which is an OK indication that GTK2 is available
ifdef GTK2 ifdef GTK2
CONFIGFLAGS=$(shell pkg-config --cflags gtk+-2.0) CONFIGFLAGS:=$(shell pkg-config --cflags gtk+-2.0)
MARSHALLER=scintilla-marshal.o MARSHALLER=scintilla-marshal.o
else else
ifdef GTK1 ifdef GTK1
CONFIGFLAGS=$(shell gtk-config --cflags) CONFIGFLAGS:=$(shell gtk-config --cflags)
else else
ifneq (,$(findstring /,$(shell whereis pkg-config))) ifneq (,$(findstring /,$(shell whereis pkg-config)))
CONFIGFLAGS=$(shell pkg-config --cflags gtk+-2.0) CONFIGFLAGS:=$(shell pkg-config --cflags gtk+-2.0)
MARSHALLER=scintilla-marshal.o MARSHALLER=scintilla-marshal.o
else else
CONFIGFLAGS=$(shell gtk-config --cflags) CONFIGFLAGS:=$(shell gtk-config --cflags)
endif endif
endif endif
endif endif
@ -88,7 +88,7 @@ $(COMPLIB): DocumentAccessor.o WindowAccessor.o KeyWords.o StyleContext.o \
CharClassify.o Decoration.o Document.o PerLine.o CallTip.o \ CharClassify.o Decoration.o Document.o PerLine.o CallTip.o \
ScintillaBase.o ContractionState.o Editor.o ExternalLexer.o PropSet.o PlatGTK.o \ ScintillaBase.o ContractionState.o Editor.o ExternalLexer.o PropSet.o PlatGTK.o \
KeyMap.o LineMarker.o PositionCache.o ScintillaGTK.o CellBuffer.o ViewStyle.o \ KeyMap.o LineMarker.o PositionCache.o ScintillaGTK.o CellBuffer.o ViewStyle.o \
RESearch.o RunStyles.o Style.o Indicator.o AutoComplete.o UniConversion.o XPM.o \ RESearch.o RunStyles.o Selection.o Style.o Indicator.o AutoComplete.o UniConversion.o XPM.o \
$(MARSHALLER) $(LEXOBJS) $(MARSHALLER) $(LEXOBJS)
$(AR) rc $@ $^ $(AR) rc $@ $^
$(RANLIB) $@ $(RANLIB) $@

View File

@ -62,7 +62,7 @@ ALL_GTK_LIBS=$(GTK_TOP)/gtk+/gtk/gtk-1.3.lib \
!ENDIF !ENDIF
INCLUDEDIRS=-I ../include -I ../src $(GTK_INCLUDES) INCLUDEDIRS=-I ../include -I ../src $(GTK_INCLUDES)
CXXFLAGS=/TP /W4 -DGTK -D_CRT_SECURE_NO_DEPRECATE=1 CXXFLAGS=/TP /W4 -EHsc -DGTK -D_CRT_SECURE_NO_DEPRECATE=1
CFLAGS=/W4 -DGTK CFLAGS=/W4 -DGTK
# For something scary:/Wp64 # For something scary:/Wp64
CXXDEBUG=/Zi /Od /MDd -DDEBUG CXXDEBUG=/Zi /Od /MDd -DDEBUG
@ -90,7 +90,7 @@ LD=ilink32
INCLUDEDIRS=-I../include -I../src INCLUDEDIRS=-I../include -I../src
CXXFLAGS = -v CXXFLAGS = -v
CXXFLAGS=-P -tWM -w -w-prc -w-inl -RT- -x- CXXFLAGS=-P -tWM -w -w-prc -w-inl -RT- -x
# Above turns off warnings for clarfying parentheses and inlines with for not expanded # Above turns off warnings for clarfying parentheses and inlines with for not expanded
CXXDEBUG=-v -DDEBUG CXXDEBUG=-v -DDEBUG
CXXNDEBUG=-O1 -DNDEBUG CXXNDEBUG=-O1 -DNDEBUG
@ -135,6 +135,7 @@ SOBJS=\
$(DIR_O)\PropSet.obj \ $(DIR_O)\PropSet.obj \
$(DIR_O)\ScintillaBase.obj \ $(DIR_O)\ScintillaBase.obj \
$(DIR_O)\ScintillaGTK.obj \ $(DIR_O)\ScintillaGTK.obj \
$(DIR_O)\Selection.obj \
$(DIR_O)\Style.obj \ $(DIR_O)\Style.obj \
$(DIR_O)\UniConversion.obj \ $(DIR_O)\UniConversion.obj \
$(DIR_O)\ViewStyle.obj \ $(DIR_O)\ViewStyle.obj \
@ -245,6 +246,7 @@ LOBJS=\
$(DIR_O)\PropSet.obj \ $(DIR_O)\PropSet.obj \
$(DIR_O)\ScintillaBaseL.obj \ $(DIR_O)\ScintillaBaseL.obj \
$(DIR_O)\ScintillaGTKL.obj \ $(DIR_O)\ScintillaGTKL.obj \
$(DIR_O)\Selection.obj \
$(DIR_O)\Style.obj \ $(DIR_O)\Style.obj \
$(DIR_O)\StyleContext.obj \ $(DIR_O)\StyleContext.obj \
$(DIR_O)\UniConversion.obj \ $(DIR_O)\UniConversion.obj \
@ -307,11 +309,11 @@ $(DIR_O)\ScintillaGTKS.obj: ScintillaGTK.cxx
# All lexers depend on this set of headers # All lexers depend on this set of headers
LEX_HEADERS=..\include\Platform.h ..\include\PropSet.h \ LEX_HEADERS=..\include\Platform.h ..\include\PropSet.h \
..\include\SString.h ..\include\Accessor.h ..\include\KeyWords.h \ ..\include\Accessor.h ..\include\KeyWords.h \
..\include\Scintilla.h ..\include\SciLexer.h ..\src\StyleContext.h ..\include\Scintilla.h ..\include\SciLexer.h ..\src\StyleContext.h
$(DIR_O)\AutoComplete.obj: ../src/AutoComplete.cxx ../include/Platform.h \ $(DIR_O)\AutoComplete.obj: ../src/AutoComplete.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../src/AutoComplete.h ../include/PropSet.h ../src/AutoComplete.h
$(DIR_O)\CallTip.obj: ../src/CallTip.cxx ../include/Platform.h \ $(DIR_O)\CallTip.obj: ../src/CallTip.cxx ../include/Platform.h \
../include/Scintilla.h ../src/CallTip.h ../include/Scintilla.h ../src/CallTip.h
@ -331,7 +333,7 @@ $(DIR_O)\Document.obj: ../src/Document.cxx ../include/Platform.h \
../src/Document.h ../src/RESearch.h ../src/Document.h ../src/RESearch.h
$(DIR_O)\DocumentAccessor.obj: ../src/DocumentAccessor.cxx ../include/Platform.h \ $(DIR_O)\DocumentAccessor.obj: ../src/DocumentAccessor.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../src/SVector.h \ ../include/PropSet.h ../src/SVector.h \
../include/Accessor.h ../src/DocumentAccessor.h ../src/SplitVector.h \ ../include/Accessor.h ../src/DocumentAccessor.h ../src/SplitVector.h \
../src/Partitioning.h ../src/CellBuffer.h ../include/Scintilla.h \ ../src/Partitioning.h ../src/CellBuffer.h ../include/Scintilla.h \
../src/CharClassify.h ../src/Document.h ../src/CharClassify.h ../src/Document.h
@ -341,11 +343,11 @@ $(DIR_O)\Editor.obj: ../src/Editor.cxx ../include/Platform.h ../include/Scintill
../src/Partitioning.h ../src/CellBuffer.h ../src/KeyMap.h \ ../src/Partitioning.h ../src/CellBuffer.h ../src/KeyMap.h \
../src/RunStyles.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \ ../src/RunStyles.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \
../src/Style.h ../src/ViewStyle.h ../src/CharClassify.h \ ../src/Style.h ../src/ViewStyle.h ../src/CharClassify.h \
../src/Document.h ../src/Editor.h ../src/PositionCache.h ../src/Document.h ../src/Editor.h ../src/Selection.h ../src/PositionCache.h
$(DIR_O)\ExternalLexer.obj: ../src/ExternalLexer.cxx ../include/Platform.h \ $(DIR_O)\ExternalLexer.obj: ../src/ExternalLexer.cxx ../include/Platform.h \
../include/Scintilla.h ../include/SciLexer.h ../include/PropSet.h \ ../include/Scintilla.h ../include/SciLexer.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/DocumentAccessor.h \ ../include/Accessor.h ../src/DocumentAccessor.h \
../include/KeyWords.h ../src/ExternalLexer.h ../include/KeyWords.h ../src/ExternalLexer.h
$(DIR_O)\Indicator.obj: ../src/Indicator.cxx ../include/Platform.h \ $(DIR_O)\Indicator.obj: ../src/Indicator.cxx ../include/Platform.h \
@ -356,7 +358,7 @@ $(DIR_O)\KeyMap.obj: ../src/KeyMap.cxx ../include/Platform.h ../include/Scintill
../src/KeyMap.h ../src/KeyMap.h
$(DIR_O)\KeyWords.obj: ../src/KeyWords.cxx ../include/Platform.h \ $(DIR_O)\KeyWords.obj: ../src/KeyWords.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
#++Autogenerated -- run src/LexGen.py to regenerate #++Autogenerated -- run src/LexGen.py to regenerate
@ -530,10 +532,9 @@ $(DIR_O)\PositionCache.obj: ../src/Editor.cxx ../include/Platform.h ../include/S
../src/Partitioning.h ../src/CellBuffer.h ../src/KeyMap.h \ ../src/Partitioning.h ../src/CellBuffer.h ../src/KeyMap.h \
../src/RunStyles.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \ ../src/RunStyles.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \
../src/Style.h ../src/ViewStyle.h ../src/CharClassify.h \ ../src/Style.h ../src/ViewStyle.h ../src/CharClassify.h \
../src/Decoration.h ../src/Document.h ../src/Editor.h ../src/PositionCache.h ../src/Decoration.h ../src/Document.h ../src/Editor.h ../src/Selection.h ../src/PositionCache.h
$(DIR_O)\PropSet.obj: ../src/PropSet.cxx ../include/Platform.h ../include/PropSet.h \ $(DIR_O)\PropSet.obj: ../src/PropSet.cxx ../include/Platform.h ../include/PropSet.h
../include/SString.h
$(DIR_O)\RESearch.obj: ../src/RESearch.cxx ../src/CharClassify.h ../src/RESearch.h $(DIR_O)\RESearch.obj: ../src/RESearch.cxx ../src/CharClassify.h ../src/RESearch.h
@ -542,55 +543,58 @@ $(DIR_O)\RunStyles.obj: ../src/RunStyles.cxx ../include/Platform.h \
../src/RunStyles.h ../src/RunStyles.h
$(DIR_O)\ScintillaBase.obj: ../src/ScintillaBase.cxx ../include/Platform.h \ $(DIR_O)\ScintillaBase.obj: ../src/ScintillaBase.cxx ../include/Platform.h \
../include/Scintilla.h ../include/PropSet.h ../include/SString.h \ ../include/Scintilla.h ../include/PropSet.h \
../src/ContractionState.h ../src/SVector.h ../src/SplitVector.h \ ../src/ContractionState.h ../src/SVector.h ../src/SplitVector.h \
../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \ ../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \
../src/CallTip.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \ ../src/CallTip.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \
../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \ ../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \
../src/AutoComplete.h ../src/CharClassify.h ../src/Document.h \ ../src/AutoComplete.h ../src/CharClassify.h ../src/Document.h \
../src/Editor.h ../src/ScintillaBase.h ../src/Editor.h ../src/Selection.h ../src/ScintillaBase.h
$(DIR_O)\ScintillaBaseL.obj: ../src/ScintillaBase.cxx ../include/Platform.h \ $(DIR_O)\ScintillaBaseL.obj: ../src/ScintillaBase.cxx ../include/Platform.h \
../include/Scintilla.h ../include/PropSet.h ../include/SString.h \ ../include/Scintilla.h ../include/PropSet.h \
../src/ContractionState.h ../src/SVector.h ../src/SplitVector.h \ ../src/ContractionState.h ../src/SVector.h ../src/SplitVector.h \
../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \ ../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \
../src/CallTip.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \ ../src/CallTip.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \
../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \ ../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \
../src/AutoComplete.h ../src/CharClassify.h ../src/Document.h \ ../src/AutoComplete.h ../src/CharClassify.h ../src/Document.h \
../src/Editor.h ../src/ScintillaBase.h ../src/Editor.h ../src/Selection.h ../src/ScintillaBase.h
$(DIR_O)\ScintillaGTK.obj: ScintillaGTK.cxx ../include/Platform.h \ $(DIR_O)\ScintillaGTK.obj: ScintillaGTK.cxx ../include/Platform.h \
../include/Scintilla.h ../include/SString.h ../src/ContractionState.h \ ../include/Scintilla.h ../src/ContractionState.h \
../src/SVector.h ../src/SplitVector.h ../src/Partitioning.h \ ../src/SVector.h ../src/SplitVector.h ../src/Partitioning.h \
../src/RunStyles.h ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h \ ../src/RunStyles.h ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h \
../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \ ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \
../src/AutoComplete.h ../src/ViewStyle.h ../src/CharClassify.h \ ../src/AutoComplete.h ../src/ViewStyle.h ../src/CharClassify.h \
../src/Document.h ../src/Editor.h ../src/ScintillaBase.h \ ../src/Document.h ../src/Editor.h ../src/ScintillaBase.h \
../src/UniConversion.h ../src/Selection.h ../src/UniConversion.h
$(DIR_O)\ScintillaGTKL.obj: ScintillaGTK.cxx ../include/Platform.h \ $(DIR_O)\ScintillaGTKL.obj: ScintillaGTK.cxx ../include/Platform.h \
../include/Scintilla.h ../include/SString.h ../src/ContractionState.h \ ../include/Scintilla.h ../src/ContractionState.h \
../src/SVector.h ../src/SplitVector.h ../src/Partitioning.h \ ../src/SVector.h ../src/SplitVector.h ../src/Partitioning.h \
../src/RunStyles.h ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h \ ../src/RunStyles.h ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h \
../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \ ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \
../src/AutoComplete.h ../src/ViewStyle.h ../src/CharClassify.h \ ../src/AutoComplete.h ../src/ViewStyle.h ../src/CharClassify.h \
../src/Document.h ../src/Editor.h ../src/ScintillaBase.h \ ../src/Document.h ../src/Editor.h ../src/ScintillaBase.h \
../src/UniConversion.h ../src/Selection.h ../src/UniConversion.h
$(DIR_O)\ScintillaGTKS.obj: ScintillaGTK.cxx ../include/Platform.h \ $(DIR_O)\ScintillaGTKS.obj: ScintillaGTK.cxx ../include/Platform.h \
../include/Scintilla.h ../include/SString.h ../src/ContractionState.h \ ../include/Scintilla.h ../src/ContractionState.h \
../src/SVector.h ../src/SplitVector.h ../src/Partitioning.h \ ../src/SVector.h ../src/SplitVector.h ../src/Partitioning.h \
../src/RunStyles.h ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h \ ../src/RunStyles.h ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h \
../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \ ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \
../src/AutoComplete.h ../src/ViewStyle.h ../src/CharClassify.h \ ../src/AutoComplete.h ../src/ViewStyle.h ../src/CharClassify.h \
../src/Document.h ../src/Editor.h ../src/ScintillaBase.h \ ../src/Document.h ../src/Editor.h ../src/ScintillaBase.h \
../src/UniConversion.h ../src/Selection.h ../src/UniConversion.h
$(DIR_O)\Selection.obj: ../src/Selection.cxx ../include/Platform.h ../include/Scintilla.h \
../src/Selection.h
$(DIR_O)\Style.obj: ../src/Style.cxx ../include/Platform.h ../include/Scintilla.h \ $(DIR_O)\Style.obj: ../src/Style.cxx ../include/Platform.h ../include/Scintilla.h \
../src/Style.h ../src/Style.h
$(DIR_O)\StyleContext.obj: ../src/StyleContext.cxx ../include/Platform.h \ $(DIR_O)\StyleContext.obj: ../src/StyleContext.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../src/StyleContext.h ../src/StyleContext.h
$(DIR_O)\UniConversion.obj: ../src/UniConversion.cxx ../src/UniConversion.h $(DIR_O)\UniConversion.obj: ../src/UniConversion.cxx ../src/UniConversion.h
@ -601,7 +605,7 @@ $(DIR_O)\ViewStyle.obj: ../src/ViewStyle.cxx ../include/Platform.h \
../src/Style.h ../src/ViewStyle.h ../src/Style.h ../src/ViewStyle.h
$(DIR_O)\WindowAccessor.obj: ../src/WindowAccessor.cxx ../include/Platform.h \ $(DIR_O)\WindowAccessor.obj: ../src/WindowAccessor.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../include/WindowAccessor.h ../include/Scintilla.h ../include/WindowAccessor.h ../include/Scintilla.h
$(DIR_O)\XPM.obj: ../src/XPM.cxx ../include/Platform.h ../src/XPM.h $(DIR_O)\XPM.obj: ../src/XPM.cxx ../include/Platform.h ../src/XPM.h

View File

@ -90,7 +90,11 @@ class Face:
elif featureType == "cat": elif featureType == "cat":
currentCategory = featureVal currentCategory = featureVal
elif featureType == "val": elif featureType == "val":
try:
name, value = featureVal.split("=", 1) name, value = featureVal.split("=", 1)
except ValueError:
print("Failure %s" % featureVal)
raise
self.features[name] = { self.features[name] = {
"FeatureType": featureType, "FeatureType": featureType,
"Category": currentCategory, "Category": currentCategory,

View File

@ -9,6 +9,29 @@
namespace Scintilla { namespace Scintilla {
#endif #endif
/**
*/
class WordList {
public:
// Each word contains at least one character - a empty word acts as sentinel at the end.
char **words;
char *list;
int len;
bool onlyLineEnds; ///< Delimited by any white space or only line ends
bool sorted;
int starts[256];
WordList(bool onlyLineEnds_ = false) :
words(0), list(0), len(0), onlyLineEnds(onlyLineEnds_),
sorted(false)
{}
~WordList() { Clear(); }
operator bool() { return len ? true : false; }
void Clear();
void Set(const char *s);
bool InList(const char *s);
bool InListAbbreviated(const char *s, const char marker);
};
typedef void (*LexerFunction)(unsigned int startPos, int lengthDoc, int initStyle, typedef void (*LexerFunction)(unsigned int startPos, int lengthDoc, int initStyle,
WordList *keywordlists[], Accessor &styler); WordList *keywordlists[], Accessor &styler);

View File

@ -3,7 +3,7 @@
** Interface to platform facilities. Also includes some basic utilities. ** Interface to platform facilities. Also includes some basic utilities.
** Implemented in PlatGTK.cxx for GTK+/Linux, PlatWin.cxx for Windows, and PlatWX.cxx for wxWindows. ** Implemented in PlatGTK.cxx for GTK+/Linux, PlatWin.cxx for Windows, and PlatWX.cxx for wxWindows.
**/ **/
// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org> // Copyright 1998-2009 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed. // The License.txt file describes the conditions under which this software may be distributed.
#ifndef PLATFORM_H #ifndef PLATFORM_H
@ -14,16 +14,6 @@
// PLAT_WIN = Win32 API on Win32 OS // PLAT_WIN = Win32 API on Win32 OS
// PLAT_WX is wxWindows on any supported platform // PLAT_WX is wxWindows on any supported platform
//*******************************************************//
// TODO: add your specific platform header here:
// Win32 example:
#include <windows.h>
//*******************************************************//
#define PLAT_GTK 0 #define PLAT_GTK 0
#define PLAT_GTK_WIN32 0 #define PLAT_GTK_WIN32 0
#define PLAT_MACOSX 0 #define PLAT_MACOSX 0
@ -48,7 +38,8 @@
#define PLAT_GTK_WIN32 1 #define PLAT_GTK_WIN32 1
#endif #endif
#elif defined(MACOSX) #elif defined(__APPLE__)
#undef PLAT_MACOSX #undef PLAT_MACOSX
#define PLAT_MACOSX 1 #define PLAT_MACOSX 1
@ -292,13 +283,13 @@ public:
*/ */
class Font { class Font {
protected: protected:
FontID id; FontID fid;
#if PLAT_WX #if PLAT_WX
int ascent; int ascent;
#endif #endif
// Private so Font objects can not be copied // Private so Font objects can not be copied
Font(const Font &) {} Font(const Font &) {}
Font &operator=(const Font &) { id=0; return *this; } Font &operator=(const Font &) { fid=0; return *this; }
public: public:
Font(); Font();
virtual ~Font(); virtual ~Font();
@ -307,9 +298,9 @@ public:
bool bold, bool italic, bool extraFontFlag=false); bool bold, bool italic, bool extraFontFlag=false);
virtual void Release(); virtual void Release();
FontID GetID() { return id; } FontID GetID() { return fid; }
// Alias another font - caller guarantees not to Release // Alias another font - caller guarantees not to Release
void SetID(FontID id_) { id = id_; } void SetID(FontID fid_) { fid = fid_; }
friend class Surface; friend class Surface;
friend class SurfaceImpl; friend class SurfaceImpl;
}; };
@ -380,31 +371,31 @@ typedef void (*CallBackAction)(void*);
*/ */
class Window { class Window {
protected: protected:
WindowID id; WindowID wid;
#if PLAT_MACOSX #if PLAT_MACOSX
void *windowRef; void *windowRef;
void *control; void *control;
#endif #endif
public: public:
Window() : id(0), cursorLast(cursorInvalid) { Window() : wid(0), cursorLast(cursorInvalid) {
#if PLAT_MACOSX #if PLAT_MACOSX
windowRef = 0; windowRef = 0;
control = 0; control = 0;
#endif #endif
} }
Window(const Window &source) : id(source.id), cursorLast(cursorInvalid) { Window(const Window &source) : wid(source.wid), cursorLast(cursorInvalid) {
#if PLAT_MACOSX #if PLAT_MACOSX
windowRef = 0; windowRef = 0;
control = 0; control = 0;
#endif #endif
} }
virtual ~Window(); virtual ~Window();
Window &operator=(WindowID id_) { Window &operator=(WindowID wid_) {
id = id_; wid = wid_;
return *this; return *this;
} }
WindowID GetID() const { return id; } WindowID GetID() const { return wid; }
bool Created() const { return id != 0; } bool Created() const { return wid != 0; }
void Destroy(); void Destroy();
bool HasFocus(); bool HasFocus();
PRectangle GetPosition(); PRectangle GetPosition();
@ -461,10 +452,10 @@ public:
* Menu management. * Menu management.
*/ */
class Menu { class Menu {
MenuID id; MenuID mid;
public: public:
Menu(); Menu();
MenuID GetID() { return id; } MenuID GetID() { return mid; }
void CreatePopUp(); void CreatePopUp();
void Destroy(); void Destroy();
void Show(Point pt, Window &w); void Show(Point pt, Window &w);

View File

@ -1,104 +1,26 @@
// Scintilla source code edit control // Scintilla source code edit control
/** @file PropSet.h /** @file PropSet.h
** A Java style properties file module. ** An interface to the methods needed for access to property sets inside lexers.
**/ **/
// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org> // Copyright 1998-2009 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed. // The License.txt file describes the conditions under which this software may be distributed.
#ifndef PROPSET_H #ifndef PROPSET_H
#define PROPSET_H #define PROPSET_H
#include "SString.h"
bool EqualCaseInsensitive(const char *a, const char *b);
bool isprefix(const char *target, const char *prefix);
#ifdef SCI_NAMESPACE #ifdef SCI_NAMESPACE
namespace Scintilla { namespace Scintilla {
#endif #endif
struct Property { class PropertyGet {
unsigned int hash;
char *key;
char *val;
Property *next;
Property() : hash(0), key(0), val(0), next(0) {}
};
/**
*/
class PropSet {
protected:
enum { hashRoots=31 };
Property *props[hashRoots];
Property *enumnext;
int enumhash;
static unsigned int HashString(const char *s, size_t len) {
unsigned int ret = 0;
while (len--) {
ret <<= 4;
ret ^= *s;
s++;
}
return ret;
}
public: public:
PropSet *superPS; virtual char *ToString() const=0; // Caller must delete[] the return value
PropSet(); virtual int GetInt(const char *key, int defaultValue=0) const=0;
~PropSet(); virtual ~PropertyGet() {}
void Set(const char *key, const char *val, int lenKey=-1, int lenVal=-1);
void Set(const char *keyVal);
void Unset(const char *key, int lenKey=-1);
void SetMultiple(const char *s);
SString Get(const char *key) const;
SString GetExpanded(const char *key) const;
SString Expand(const char *withVars, int maxExpands=100) const;
int GetInt(const char *key, int defaultValue=0) const;
void Clear();
char *ToString() const; // Caller must delete[] the return value
private:
// copy-value semantics not implemented
PropSet(const PropSet &copy);
void operator=(const PropSet &assign);
}; };
/**
*/
class WordList {
public:
// Each word contains at least one character - a empty word acts as sentinel at the end.
char **words;
char *list;
int len;
bool onlyLineEnds; ///< Delimited by any white space or only line ends
bool sorted;
int starts[256];
WordList(bool onlyLineEnds_ = false) :
words(0), list(0), len(0), onlyLineEnds(onlyLineEnds_),
sorted(false)
{}
~WordList() { Clear(); }
operator bool() { return len ? true : false; }
void Clear();
void Set(const char *s);
bool InList(const char *s);
bool InListAbbreviated(const char *s, const char marker);
};
inline bool IsAlphabetic(unsigned int ch) {
return ((ch >= 'A') && (ch <= 'Z')) || ((ch >= 'a') && (ch <= 'z'));
}
#ifdef SCI_NAMESPACE #ifdef SCI_NAMESPACE
} }
#endif #endif
#ifdef _MSC_VER
// Visual C++ doesn't like the private copy idiom for disabling
// the default copy constructor and operator=, but it's fine.
#pragma warning(disable: 4511 4512)
#endif
#endif #endif

View File

@ -118,7 +118,6 @@
#define SCLEX_AUTOMATIC 1000 #define SCLEX_AUTOMATIC 1000
//For All lexer //For All lexer
//#define SCE_UNIVERSAL_SELECT_STYLE 30
#define SCE_UNIVERSAL_FOUND_STYLE 31 #define SCE_UNIVERSAL_FOUND_STYLE 31
#define SCE_UNIVERSAL_FOUND_STYLE_2 29 #define SCE_UNIVERSAL_FOUND_STYLE_2 29
#define SCE_UNIVERSAL_FOUND_STYLE_INC 28 #define SCE_UNIVERSAL_FOUND_STYLE_INC 28
@ -184,6 +183,11 @@
#define SCE_D_COMMENTLINEDOC 15 #define SCE_D_COMMENTLINEDOC 15
#define SCE_D_COMMENTDOCKEYWORD 16 #define SCE_D_COMMENTDOCKEYWORD 16
#define SCE_D_COMMENTDOCKEYWORDERROR 17 #define SCE_D_COMMENTDOCKEYWORDERROR 17
#define SCE_D_STRINGB 18
#define SCE_D_STRINGR 19
#define SCE_D_WORD5 20
#define SCE_D_WORD6 21
#define SCE_D_WORD7 22
#define SCE_SEARCHRESULT_DEFAULT 0 #define SCE_SEARCHRESULT_DEFAULT 0
#define SCE_SEARCHRESULT_SEARCH_HEADER 1 #define SCE_SEARCHRESULT_SEARCH_HEADER 1
@ -980,6 +984,7 @@
#define SCE_CAML_OPERATOR 7 #define SCE_CAML_OPERATOR 7
#define SCE_CAML_NUMBER 8 #define SCE_CAML_NUMBER 8
#define SCE_CAML_CHAR 9 #define SCE_CAML_CHAR 9
#define SCE_CAML_WHITE 10
#define SCE_CAML_STRING 11 #define SCE_CAML_STRING 11
#define SCE_CAML_COMMENT 12 #define SCE_CAML_COMMENT 12
#define SCE_CAML_COMMENT1 13 #define SCE_CAML_COMMENT1 13
@ -1317,6 +1322,7 @@
#define SCE_MYSQL_USER1 18 #define SCE_MYSQL_USER1 18
#define SCE_MYSQL_USER2 19 #define SCE_MYSQL_USER2 19
#define SCE_MYSQL_USER3 20 #define SCE_MYSQL_USER3 20
#define SCE_MYSQL_HIDDENCOMMAND 21
#define SCE_PO_DEFAULT 0 #define SCE_PO_DEFAULT 0
#define SCE_PO_COMMENT 1 #define SCE_PO_COMMENT 1
#define SCE_PO_MSGID 2 #define SCE_PO_MSGID 2
@ -1383,8 +1389,6 @@
#define SCE_SML_COMMENT1 13 #define SCE_SML_COMMENT1 13
#define SCE_SML_COMMENT2 14 #define SCE_SML_COMMENT2 14
#define SCE_SML_COMMENT3 15 #define SCE_SML_COMMENT3 15
#define SCLEX_ASP 29
#define SCLEX_PHP 30
/* --Autogenerated -- end of section automatically generated from Scintilla.iface */ /* --Autogenerated -- end of section automatically generated from Scintilla.iface */
#endif #endif

View File

@ -26,7 +26,7 @@ int Scintilla_LinkLexers();
* hold a pointer and sptr_t, a signed integer large enough to hold a pointer. * hold a pointer and sptr_t, a signed integer large enough to hold a pointer.
* May need to be changed for 64 bit platforms. */ * May need to be changed for 64 bit platforms. */
#if defined(_WIN32) #if defined(_WIN32)
#include <BaseTsd.h> #include <basetsd.h>
#endif #endif
#ifdef MAXULONG_PTR #ifdef MAXULONG_PTR
typedef ULONG_PTR uptr_t; typedef ULONG_PTR uptr_t;
@ -120,6 +120,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SC_MARK_FULLRECT 26 #define SC_MARK_FULLRECT 26
#define SC_MARK_LEFTRECT 27 #define SC_MARK_LEFTRECT 27
#define SC_MARK_AVAILABLE 28 #define SC_MARK_AVAILABLE 28
#define SC_MARK_UNDERLINE 29
#define SC_MARK_CHARACTER 10000 #define SC_MARK_CHARACTER 10000
#define SC_MARKNUM_FOLDEREND 25 #define SC_MARKNUM_FOLDEREND 25
#define SC_MARKNUM_FOLDEROPENMID 26 #define SC_MARKNUM_FOLDEROPENMID 26
@ -251,8 +252,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_INDICGETFORE 2083 #define SCI_INDICGETFORE 2083
#define SCI_INDICSETUNDER 2510 #define SCI_INDICSETUNDER 2510
#define SCI_INDICGETUNDER 2511 #define SCI_INDICGETUNDER 2511
#define SCI_GETCARETLINEVISIBLEALWAYS 3095 #define SCI_GETCARETLINEVISIBLEALWAYS 3095
#define SCI_SETCARETLINEVISIBLEALWAYS 3096 #define SCI_SETCARETLINEVISIBLEALWAYS 3096
#define SCI_SETWHITESPACEFORE 2084 #define SCI_SETWHITESPACEFORE 2084
#define SCI_SETWHITESPACEBACK 2085 #define SCI_SETWHITESPACEBACK 2085
#define SCI_SETSTYLEBITS 2090 #define SCI_SETSTYLEBITS 2090
@ -445,6 +448,11 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_GETWRAPVISUALFLAGSLOCATION 2463 #define SCI_GETWRAPVISUALFLAGSLOCATION 2463
#define SCI_SETWRAPSTARTINDENT 2464 #define SCI_SETWRAPSTARTINDENT 2464
#define SCI_GETWRAPSTARTINDENT 2465 #define SCI_GETWRAPSTARTINDENT 2465
#define SC_WRAPINDENT_FIXED 0
#define SC_WRAPINDENT_SAME 1
#define SC_WRAPINDENT_INDENT 2
#define SCI_SETWRAPINDENTMODE 2472
#define SCI_GETWRAPINDENTMODE 2473
#define SC_CACHE_NONE 0 #define SC_CACHE_NONE 0
#define SC_CACHE_CARET 1 #define SC_CACHE_CARET 1
#define SC_CACHE_PAGE 2 #define SC_CACHE_PAGE 2
@ -560,6 +568,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_GETMODEVENTMASK 2378 #define SCI_GETMODEVENTMASK 2378
#define SCI_SETFOCUS 2380 #define SCI_SETFOCUS 2380
#define SCI_GETFOCUS 2381 #define SCI_GETFOCUS 2381
#define SC_STATUS_OK 0
#define SC_STATUS_FAILURE 1
#define SC_STATUS_BADALLOC 2
#define SCI_SETSTATUS 2382 #define SCI_SETSTATUS 2382
#define SCI_GETSTATUS 2383 #define SCI_GETSTATUS 2383
#define SCI_SETMOUSEDOWNCAPTURES 2384 #define SCI_SETMOUSEDOWNCAPTURES 2384
@ -610,6 +621,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SC_SEL_STREAM 0 #define SC_SEL_STREAM 0
#define SC_SEL_RECTANGLE 1 #define SC_SEL_RECTANGLE 1
#define SC_SEL_LINES 2 #define SC_SEL_LINES 2
#define SC_SEL_THIN 3
#define SCI_SETSELECTIONMODE 2422 #define SCI_SETSELECTIONMODE 2422
#define SCI_GETSELECTIONMODE 2423 #define SCI_GETSELECTIONMODE 2423
#define SCI_GETLINESELSTARTPOSITION 2424 #define SCI_GETLINESELSTARTPOSITION 2424
@ -704,6 +716,55 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_ANNOTATIONGETSTYLEOFFSET 2551 #define SCI_ANNOTATIONGETSTYLEOFFSET 2551
#define UNDO_MAY_COALESCE 1 #define UNDO_MAY_COALESCE 1
#define SCI_ADDUNDOACTION 2560 #define SCI_ADDUNDOACTION 2560
#define SCI_CHARPOSITIONFROMPOINT 2561
#define SCI_CHARPOSITIONFROMPOINTCLOSE 2562
#define SCI_SETMULTIPLESELECTION 2563
#define SCI_GETMULTIPLESELECTION 2564
#define SCI_SETADDITIONALSELECTIONTYPING 2565
#define SCI_GETADDITIONALSELECTIONTYPING 2566
#define SCI_SETADDITIONALCARETSBLINK 2567
#define SCI_GETADDITIONALCARETSBLINK 2568
#define SCI_GETSELECTIONS 2570
#define SCI_CLEARSELECTIONS 2571
#define SCI_SETSELECTION 2572
#define SCI_ADDSELECTION 2573
#define SCI_SETMAINSELECTION 2574
#define SCI_GETMAINSELECTION 2575
#define SCI_SETSELECTIONNCARET 2576
#define SCI_GETSELECTIONNCARET 2577
#define SCI_SETSELECTIONNANCHOR 2578
#define SCI_GETSELECTIONNANCHOR 2579
#define SCI_SETSELECTIONNCARETVIRTUALSPACE 2580
#define SCI_GETSELECTIONNCARETVIRTUALSPACE 2581
#define SCI_SETSELECTIONNANCHORVIRTUALSPACE 2582
#define SCI_GETSELECTIONNANCHORVIRTUALSPACE 2583
#define SCI_SETSELECTIONNSTART 2584
#define SCI_GETSELECTIONNSTART 2585
#define SCI_SETSELECTIONNEND 2586
#define SCI_GETSELECTIONNEND 2587
#define SCI_SETRECTANGULARSELECTIONCARET 2588
#define SCI_GETRECTANGULARSELECTIONCARET 2589
#define SCI_SETRECTANGULARSELECTIONANCHOR 2590
#define SCI_GETRECTANGULARSELECTIONANCHOR 2591
#define SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE 2592
#define SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE 2593
#define SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE 2594
#define SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE 2595
#define SCVS_NONE 0
#define SCVS_RECTANGULARSELECTION 1
#define SCVS_USERACCESSIBLE 2
#define SCI_SETVIRTUALSPACEOPTIONS 2596
#define SCI_GETVIRTUALSPACEOPTIONS 2597
#define SCI_SETRECTANGULARSELECTIONMODIFIER 2598
#define SCI_GETRECTANGULARSELECTIONMODIFIER 2599
#define SCI_SETADDITIONALSELFORE 2600
#define SCI_SETADDITIONALSELBACK 2601
#define SCI_SETADDITIONALSELALPHA 2602
#define SCI_GETADDITIONALSELALPHA 2603
#define SCI_SETADDITIONALCARETFORE 2604
#define SCI_GETADDITIONALCARETFORE 2605
#define SCI_ROTATESELECTION 2606
#define SCI_SWAPMAINANCHORCARET 2607
#define SCI_STARTRECORD 3001 #define SCI_STARTRECORD 3001
#define SCI_STOPRECORD 3002 #define SCI_STOPRECORD 3002
#define SCI_SETLEXER 4001 #define SCI_SETLEXER 4001
@ -766,6 +827,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCMOD_SHIFT 1 #define SCMOD_SHIFT 1
#define SCMOD_CTRL 2 #define SCMOD_CTRL 2
#define SCMOD_ALT 4 #define SCMOD_ALT 4
#define SCMOD_SUPER 8
#define SCN_STYLENEEDED 2000 #define SCN_STYLENEEDED 2000
#define SCN_CHARADDED 2001 #define SCN_CHARADDED 2001
#define SCN_SAVEPOINTREACHED 2002 #define SCN_SAVEPOINTREACHED 2002
@ -804,38 +866,44 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
namespace Scintilla { namespace Scintilla {
#endif #endif
struct CharacterRange { struct Sci_CharacterRange {
long cpMin; long cpMin;
long cpMax; long cpMax;
}; };
struct TextRange { struct Sci_TextRange {
struct CharacterRange chrg; struct Sci_CharacterRange chrg;
char *lpstrText; char *lpstrText;
}; };
struct TextToFind { struct Sci_TextToFind {
struct CharacterRange chrg; struct Sci_CharacterRange chrg;
char *lpstrText; char *lpstrText;
struct CharacterRange chrgText; struct Sci_CharacterRange chrgText;
}; };
#define CharacterRange Sci_CharacterRange
#define TextRange Sci_TextRange
#define TextToFind Sci_TextToFind
#ifdef PLATFORM_H #ifdef PLATFORM_H
/* This structure is used in printing and requires some of the graphics types /* This structure is used in printing and requires some of the graphics types
* from Platform.h. Not needed by most client code. */ * from Platform.h. Not needed by most client code. */
struct RangeToFormat { struct Sci_RangeToFormat {
SurfaceID hdc; SurfaceID hdc;
SurfaceID hdcTarget; SurfaceID hdcTarget;
PRectangle rc; PRectangle rc;
PRectangle rcPage; PRectangle rcPage;
CharacterRange chrg; Sci_CharacterRange chrg;
}; };
#define RangeToFormat Sci_RangeToFormat
#endif #endif
struct NotifyHeader { struct Sci_NotifyHeader {
/* Compatible with Windows NMHDR. /* Compatible with Windows NMHDR.
* hwndFrom is really an environment specific window handle or pointer * hwndFrom is really an environment specific window handle or pointer
* but most clients of Scintilla.h do not have this type visible. */ * but most clients of Scintilla.h do not have this type visible. */
@ -844,13 +912,15 @@ struct NotifyHeader {
unsigned int code; unsigned int code;
}; };
#define NotifyHeader Sci_NotifyHeader
struct SCNotification { struct SCNotification {
struct NotifyHeader nmhdr; struct Sci_NotifyHeader nmhdr;
int position; /* SCN_STYLENEEDED, SCN_MODIFIED, SCN_DWELLSTART, SCN_DWELLEND */ int position; /* SCN_STYLENEEDED, SCN_MODIFIED, SCN_DWELLSTART, SCN_DWELLEND */
int ch; /* SCN_CHARADDED, SCN_KEY */ int ch; /* SCN_CHARADDED, SCN_KEY */
int modifiers; /* SCN_KEY */ int modifiers; /* SCN_KEY */
int modificationType; /* SCN_MODIFIED */ int modificationType; /* SCN_MODIFIED */
const char *text; // SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */ const char *text; /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */
int length; /* SCN_MODIFIED */ int length; /* SCN_MODIFIED */
int linesAdded; /* SCN_MODIFIED */ int linesAdded; /* SCN_MODIFIED */
int message; /* SCN_MACRORECORD */ int message; /* SCN_MACRORECORD */
@ -881,26 +951,4 @@ struct SearchResultMarkings {
} }
#endif #endif
/* Deprecation section listing all API features that are deprecated and
* will be removed completely in a future version.
* To enable these features define INCLUDE_DEPRECATED_FEATURES */
#ifdef INCLUDE_DEPRECATED_FEATURES
#define SCI_SETCARETPOLICY 2369
#define CARET_CENTER 0x02
#define CARET_XEVEN 0x08
#define CARET_XJUMPS 0x10
#define SC_FOLDFLAG_BOX 0x0001
#define SC_FOLDLEVELBOXHEADERFLAG 0x4000
#define SC_FOLDLEVELBOXFOOTERFLAG 0x8000
#define SC_FOLDLEVELCONTRACTED 0x10000
#define SC_FOLDLEVELUNINDENT 0x20000
#define SCN_POSCHANGED 2012
#define SCN_CHECKBRACE 2007
#endif
#endif #endif

View File

@ -270,6 +270,7 @@ val SC_MARK_PIXMAP=25
val SC_MARK_FULLRECT=26 val SC_MARK_FULLRECT=26
val SC_MARK_LEFTRECT=27 val SC_MARK_LEFTRECT=27
val SC_MARK_AVAILABLE=28 val SC_MARK_AVAILABLE=28
val SC_MARK_UNDERLINE=29
val SC_MARK_CHARACTER=10000 val SC_MARK_CHARACTER=10000
@ -476,10 +477,10 @@ set void StyleSetCharacterSet=2066(int style, int characterSet)
# Set a style to be a hotspot or not. # Set a style to be a hotspot or not.
set void StyleSetHotSpot=2409(int style, bool hotspot) set void StyleSetHotSpot=2409(int style, bool hotspot)
# Set the foreground colour of the selection and whether to use this setting. # Set the foreground colour of the main and additional selections and whether to use this setting.
fun void SetSelFore=2067(bool useSetting, colour fore) fun void SetSelFore=2067(bool useSetting, colour fore)
# Set the background colour of the selection and whether to use this setting. # Set the background colour of the main and additional selections and whether to use this setting.
fun void SetSelBack=2068(bool useSetting, colour back) fun void SetSelBack=2068(bool useSetting, colour back)
# Get the alpha of the selection. # Get the alpha of the selection.
@ -1130,6 +1131,17 @@ set void SetWrapStartIndent=2464(int indent,)
# Retrive the start indent for wrapped lines. # Retrive the start indent for wrapped lines.
get int GetWrapStartIndent=2465(,) get int GetWrapStartIndent=2465(,)
enu WrapIndentMode=SC_WRAPINDENT_
val SC_WRAPINDENT_FIXED=0
val SC_WRAPINDENT_SAME=1
val SC_WRAPINDENT_INDENT=2
# Sets how wrapped sublines are placed. Default is fixed.
set void SetWrapIndentMode=2472(int mode,)
# Retrieve how wrapped sublines are placed. Default is fixed.
get int GetWrapIndentMode=2473(,)
enu LineCache=SC_CACHE_ enu LineCache=SC_CACHE_
val SC_CACHE_NONE=0 val SC_CACHE_NONE=0
val SC_CACHE_CARET=1 val SC_CACHE_CARET=1
@ -1476,6 +1488,11 @@ set void SetFocus=2380(bool focus,)
# Get internal focus flag. # Get internal focus flag.
get bool GetFocus=2381(,) get bool GetFocus=2381(,)
enu Status=SC_STATUS_
val SC_STATUS_OK=0
val SC_STATUS_FAILURE=1
val SC_STATUS_BADALLOC=2
# Change error status - 0 = OK. # Change error status - 0 = OK.
set void SetStatus=2382(int statusCode,) set void SetStatus=2382(int statusCode,)
# Get error status. # Get error status.
@ -1620,8 +1637,9 @@ enu SelectionMode=SC_SEL_
val SC_SEL_STREAM=0 val SC_SEL_STREAM=0
val SC_SEL_RECTANGLE=1 val SC_SEL_RECTANGLE=1
val SC_SEL_LINES=2 val SC_SEL_LINES=2
val SC_SEL_THIN=3
# Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE) or # Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or
# by lines (SC_SEL_LINES). # by lines (SC_SEL_LINES).
set void SetSelectionMode=2422(int mode,) set void SetSelectionMode=2422(int mode,)
@ -1902,6 +1920,123 @@ val UNDO_MAY_COALESCE=1
# Add a container action to the undo stack # Add a container action to the undo stack
fun void AddUndoAction=2560(int token, int flags) fun void AddUndoAction=2560(int token, int flags)
# Find the position of a character from a point within the window.
fun position CharPositionFromPoint=2561(int x, int y)
# Find the position of a character from a point within the window.
# Return INVALID_POSITION if not close to text.
fun position CharPositionFromPointClose=2562(int x, int y)
# Set whether multiple selections can be made
set void SetMultipleSelection=2563(bool multipleSelection,)
# Whether multiple selections can be made
get bool GetMultipleSelection=2564(,)
# Set whether typing can be performed into multiple selections
set void SetAdditionalSelectionTyping=2565(bool additionalSelectionTyping,)
# Whether typing can be performed into multiple selections
get bool GetAdditionalSelectionTyping=2566(,)
# Set whether additional carets will blink
set void SetAdditionalCaretsBlink=2567(bool additionalCaretsBlink,)
# Whether additional carets will blink
get bool GetAdditionalCaretsBlink=2568(,)
# How many selections are there?
get int GetSelections=2570(,)
# Clear selections to a single empty stream selection
fun void ClearSelections=2571(,)
# Set a simple selection
fun int SetSelection=2572(int caret,int anchor)
# Add a selection
fun int AddSelection=2573(int caret,int anchor)
# Set the main selection
set void SetMainSelection=2574(int selection,)
# Which selection is the main selection
get int GetMainSelection=2575(,)
set void SetSelectionNCaret=2576(int selection, position pos)
get position GetSelectionNCaret=2577(int selection,)
set void SetSelectionNAnchor=2578(int selection, position posAnchor)
get position GetSelectionNAnchor=2579(int selection,)
set void SetSelectionNCaretVirtualSpace=2580(int selection, int space)
get int GetSelectionNCaretVirtualSpace=2581(int selection,)
set void SetSelectionNAnchorVirtualSpace=2582(int selection, int space)
get int GetSelectionNAnchorVirtualSpace=2583(int selection,)
# Sets the position that starts the selection - this becomes the anchor.
set void SetSelectionNStart=2584(int selection, position pos)
# Returns the position at the start of the selection.
get position GetSelectionNStart=2585(,)
# Sets the position that ends the selection - this becomes the currentPosition.
set void SetSelectionNEnd=2586(int selection, position pos,)
# Returns the position at the end of the selection.
get position GetSelectionNEnd=2587(,)
set void SetRectangularSelectionCaret=2588(position pos,)
get position GetRectangularSelectionCaret=2589(,)
set void SetRectangularSelectionAnchor=2590(position posAnchor,)
get position GetRectangularSelectionAnchor=2591(,)
set void SetRectangularSelectionCaretVirtualSpace=2592(int space,)
get int GetRectangularSelectionCaretVirtualSpace=2593(,)
set void SetRectangularSelectionAnchorVirtualSpace=2594(int space,)
get int GetRectangularSelectionAnchorVirtualSpace=2595(,)
enu VirtualSpace=SCVS_
val SCVS_NONE=0
val SCVS_RECTANGULARSELECTION=1
val SCVS_USERACCESSIBLE=2
set void SetVirtualSpaceOptions=2596(int virtualSpaceOptions,)
get int GetVirtualSpaceOptions=2597(,)
# On GTK+, allow selecting the modifier key to use for mouse-based
# rectangular selection. Often the window manager requires Alt+Mouse Drag
# for moving windows.
# Valid values are SCMOD_CTRL(default), SCMOD_ALT, or SCMOD_SUPER.
set void SetRectangularSelectionModifier=2598(int modifier,)
# Get the modifier key used for rectangular selection.
get int GetRectangularSelectionModifier=2599(,)
# Set the foreground colour of additional selections.
# Must have previously called SetSelFore with non-zero first argument for this to have an effect.
set void SetAdditionalSelFore=2600(colour fore,)
# Set the background colour of additional selections.
# Must have previously called SetSelBack with non-zero first argument for this to have an effect.
set void SetAdditionalSelBack=2601(colour back,)
# Set the alpha of the selection.
set void SetAdditionalSelAlpha=2602(int alpha,)
# Get the alpha of the selection.
get int GetAdditionalSelAlpha=2603(,)
# Set the foreground colour of additional carets.
set void SetAdditionalCaretFore=2604(colour fore,)
# Get the foreground colour of additional carets.
get colour GetAdditionalCaretFore=2605(,)
# Set the main selection to the next selection.
fun void RotateSelection=2606(,)
# Swap that caret and anchor of the main selection.
fun void SwapMainAnchorCaret=2607(,)
# Start notifying the container of all key presses and commands. # Start notifying the container of all key presses and commands.
fun void StartRecord=3001(,) fun void StartRecord=3001(,)
@ -2011,6 +2146,7 @@ val SCMOD_NORM=0
val SCMOD_SHIFT=1 val SCMOD_SHIFT=1
val SCMOD_CTRL=2 val SCMOD_CTRL=2
val SCMOD_ALT=4 val SCMOD_ALT=4
val SCMOD_SUPER=8
################################################ ################################################
# For SciLexer.h # For SciLexer.h
@ -2177,6 +2313,11 @@ val SCE_D_IDENTIFIER=14
val SCE_D_COMMENTLINEDOC=15 val SCE_D_COMMENTLINEDOC=15
val SCE_D_COMMENTDOCKEYWORD=16 val SCE_D_COMMENTDOCKEYWORD=16
val SCE_D_COMMENTDOCKEYWORDERROR=17 val SCE_D_COMMENTDOCKEYWORDERROR=17
val SCE_D_STRINGB=18
val SCE_D_STRINGR=19
val SCE_D_WORD5=20
val SCE_D_WORD6=21
val SCE_D_WORD7=22
# Lexical states for SCLEX_TCL # Lexical states for SCLEX_TCL
lex TCL=SCLEX_TCL SCE_TCL_ lex TCL=SCLEX_TCL SCE_TCL_
val SCE_TCL_DEFAULT=0 val SCE_TCL_DEFAULT=0
@ -3061,6 +3202,7 @@ val SCE_CAML_LINENUM=6
val SCE_CAML_OPERATOR=7 val SCE_CAML_OPERATOR=7
val SCE_CAML_NUMBER=8 val SCE_CAML_NUMBER=8
val SCE_CAML_CHAR=9 val SCE_CAML_CHAR=9
val SCE_CAML_WHITE=10
val SCE_CAML_STRING=11 val SCE_CAML_STRING=11
val SCE_CAML_COMMENT=12 val SCE_CAML_COMMENT=12
val SCE_CAML_COMMENT1=13 val SCE_CAML_COMMENT1=13
@ -3438,6 +3580,7 @@ val SCE_MYSQL_QUOTEDIDENTIFIER=17
val SCE_MYSQL_USER1=18 val SCE_MYSQL_USER1=18
val SCE_MYSQL_USER2=19 val SCE_MYSQL_USER2=19
val SCE_MYSQL_USER3=20 val SCE_MYSQL_USER3=20
val SCE_MYSQL_HIDDENCOMMAND=21
# Lexical state for SCLEX_PO # Lexical state for SCLEX_PO
lex Po=SCLEX_PO SCE_PO_ lex Po=SCLEX_PO SCE_PO_
val SCE_PO_DEFAULT=0 val SCE_PO_DEFAULT=0
@ -3544,26 +3687,3 @@ evt void IndicatorClick=2023(int modifiers, int position)
evt void IndicatorRelease=2024(int modifiers, int position) evt void IndicatorRelease=2024(int modifiers, int position)
evt void AutoCCancelled=2025(void) evt void AutoCCancelled=2025(void)
evt void AutoCCharDeleted=2026(void) evt void AutoCCharDeleted=2026(void)
cat Deprecated
# CARET_POLICY changed in 1.47
fun void SetCaretPolicy=2369(int caretPolicy, int caretSlop)
val CARET_CENTER=0x02
val CARET_XEVEN=0x08
val CARET_XJUMPS=0x10
# The old name for SCN_UPDATEUI
val SCN_CHECKBRACE=2007
evt void PosChanged=2012(int position)
# Box folding support
val SC_FOLDFLAG_BOX=0x0001
val SC_FOLDLEVELBOXHEADERFLAG=0x4000
val SC_FOLDLEVELBOXFOOTERFLAG=0x8000
val SC_FOLDLEVELCONTRACTED=0x10000
val SC_FOLDLEVELUNINDENT=0x20000
# SCLEX_HTML should be used in preference to these.
val SCLEX_ASP=29
val SCLEX_PHP=30

View File

@ -12,13 +12,14 @@ namespace Scintilla {
/** /**
*/ */
class WindowAccessor : public Accessor { class WindowAccessor : public Accessor {
// Private so WindowAccessor objects can not be copied // Private so WindowAccessor objects can not be copied
WindowAccessor(const WindowAccessor &source) : Accessor(), props(source.props) {} WindowAccessor(const WindowAccessor &source) : Accessor(), props(source.props) {}
WindowAccessor &operator=(const WindowAccessor &) { return *this; } WindowAccessor &operator=(const WindowAccessor &) { return *this; }
protected: protected:
WindowID id; WindowID id;
PropSet &props; PropertyGet &props;
int lenDoc; int lenDoc;
char styleBuf[bufferSize]; char styleBuf[bufferSize];
@ -30,7 +31,7 @@ protected:
bool InternalIsLeadByte(char ch); bool InternalIsLeadByte(char ch);
void Fill(int position); void Fill(int position);
public: public:
WindowAccessor(WindowID id_, PropSet &props_) : WindowAccessor(WindowID id_, PropertyGet &props_) :
Accessor(), id(id_), props(props_), Accessor(), id(id_), props(props_),
lenDoc(-1), validLen(0), chFlags(0), chWhile(0) { lenDoc(-1), validLen(0), chFlags(0), chWhile(0) {
} }

View File

@ -11,7 +11,7 @@
#include "Platform.h" #include "Platform.h"
#include "PropSet.h" #include "CharClassify.h"
#include "AutoComplete.h" #include "AutoComplete.h"
#ifdef SCI_NAMESPACE #ifdef SCI_NAMESPACE

View File

@ -256,9 +256,8 @@ PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn,
clickPlace = 0; clickPlace = 0;
if (val) if (val)
delete []val; delete []val;
val = 0;
val = new char[strlen(defn) + 1]; val = new char[strlen(defn) + 1];
if (!val)
return PRectangle();
strcpy(val, defn); strcpy(val, defn);
codePage = codePage_; codePage = codePage_;
Surface *surfaceMeasure = Surface::Allocate(); Surface *surfaceMeasure = Surface::Allocate();

View File

@ -21,7 +21,7 @@
using namespace Scintilla; using namespace Scintilla;
#endif #endif
LineVector::LineVector() : starts(256) { LineVector::LineVector() : starts(256), perLine(0) {
Init(); Init();
} }
@ -31,6 +31,9 @@ LineVector::~LineVector() {
void LineVector::Init() { void LineVector::Init() {
starts.DeleteAll(); starts.DeleteAll();
if (perLine) {
perLine->Init();
}
} }
void LineVector::SetPerLine(PerLine *pl) { void LineVector::SetPerLine(PerLine *pl) {
@ -59,7 +62,7 @@ void LineVector::RemoveLine(int line) {
} }
} }
int LineVector::LineFromPosition(int pos) { int LineVector::LineFromPosition(int pos) const {
return starts.PartitionFromPosition(pos); return starts.PartitionFromPosition(pos);
} }
@ -147,8 +150,6 @@ void UndoHistory::EnsureUndoRoom() {
// Run out of undo nodes so extend the array // Run out of undo nodes so extend the array
int lenActionsNew = lenActions * 2; int lenActionsNew = lenActions * 2;
Action *actionsNew = new Action[lenActionsNew]; Action *actionsNew = new Action[lenActionsNew];
if (!actionsNew)
return;
for (int act = 0; act <= currentAction; act++) for (int act = 0; act <= currentAction; act++)
actionsNew[act].Grab(&actions[act]); actionsNew[act].Grab(&actions[act]);
delete []actions; delete []actions;

View File

@ -16,6 +16,7 @@ namespace Scintilla {
class PerLine { class PerLine {
public: public:
virtual ~PerLine() {} virtual ~PerLine() {}
virtual void Init()=0;
virtual void InsertLine(int)=0; virtual void InsertLine(int)=0;
virtual void RemoveLine(int)=0; virtual void RemoveLine(int)=0;
}; };
@ -42,7 +43,7 @@ public:
int Lines() const { int Lines() const {
return starts.Partitions(); return starts.Partitions();
} }
int LineFromPosition(int pos); int LineFromPosition(int pos) const;
int LineStart(int line) const { int LineStart(int line) const {
return starts.PositionFromPartition(line); return starts.PositionFromPartition(line);
} }
@ -157,7 +158,7 @@ public:
void SetPerLine(PerLine *pl); void SetPerLine(PerLine *pl);
int Lines() const; int Lines() const;
int LineStart(int line) const; int LineStart(int line) const;
int LineFromPosition(int pos) { return lv.LineFromPosition(pos); } int LineFromPosition(int pos) const { return lv.LineFromPosition(pos); }
void InsertLine(int line, int position); void InsertLine(int line, int position);
void RemoveLine(int line); void RemoveLine(int line);
const char *InsertString(int position, const char *s, int insertLength, bool &startSequence); const char *InsertString(int position, const char *s, int insertLength, bool &startSequence);

View File

@ -5,6 +5,7 @@
// Copyright 2006 by Neil Hodgson <neilh@scintilla.org> // Copyright 2006 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed. // The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <ctype.h> #include <ctype.h>
#include "CharClassify.h" #include "CharClassify.h"
@ -41,3 +42,37 @@ void CharClassify::SetCharClasses(const unsigned char *chars, cc newCharClass) {
} }
} }
} }
int CompareCaseInsensitive(const char *a, const char *b) {
while (*a && *b) {
if (*a != *b) {
char upperA = MakeUpperCase(*a);
char upperB = MakeUpperCase(*b);
if (upperA != upperB)
return upperA - upperB;
}
a++;
b++;
}
// Either *a or *b is nul
return *a - *b;
}
int CompareNCaseInsensitive(const char *a, const char *b, size_t len) {
while (*a && *b && len) {
if (*a != *b) {
char upperA = MakeUpperCase(*a);
char upperB = MakeUpperCase(*b);
if (upperA != upperB)
return upperA - upperB;
}
a++;
b++;
len--;
}
if (len == 0)
return 0;
else
// Either *a or *b is nul
return *a - *b;
}

View File

@ -2,7 +2,7 @@
/** @file CharClassify.h /** @file CharClassify.h
** Character classifications used by Document and RESearch. ** Character classifications used by Document and RESearch.
**/ **/
// Copyright 2006 by Neil Hodgson <neilh@scintilla.org> // Copyright 2006-2009 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed. // The License.txt file describes the conditions under which this software may be distributed.
#ifndef CHARCLASSIFY_H #ifndef CHARCLASSIFY_H
@ -22,4 +22,16 @@ private:
enum { maxChar=256 }; enum { maxChar=256 };
unsigned char charClass[maxChar]; // not type cc to save space unsigned char charClass[maxChar]; // not type cc to save space
}; };
// These functions are implemented because each platform calls them something different.
int CompareCaseInsensitive(const char *a, const char *b);
int CompareNCaseInsensitive(const char *a, const char *b, size_t len);
inline char MakeUpperCase(char ch) {
if (ch < 'a' || ch > 'z')
return ch;
else
return static_cast<char>(ch - 'a' + 'A');
}
#endif #endif

View File

@ -100,6 +100,13 @@ Document::~Document() {
regex = 0; regex = 0;
} }
void Document::Init() {
for (int j=0; j<ldSize; j++) {
if (perLineData[j])
perLineData[j]->Init();
}
}
void Document::InsertLine(int line) { void Document::InsertLine(int line) {
for (int j=0; j<ldSize; j++) { for (int j=0; j<ldSize; j++) {
if (perLineData[j]) if (perLineData[j])
@ -202,15 +209,19 @@ int Document::LineEnd(int line) const {
} }
} }
int Document::LineFromPosition(int pos) { int Document::LineFromPosition(int pos) const {
return cb.LineFromPosition(pos); return cb.LineFromPosition(pos);
} }
int Document::LineEndPosition(int position) { int Document::LineEndPosition(int position) const {
return LineEnd(LineFromPosition(position)); return LineEnd(LineFromPosition(position));
} }
int Document::VCHomePosition(int position) { bool Document::IsLineEndPosition(int position) const {
return LineEnd(LineFromPosition(position)) == position;
}
int Document::VCHomePosition(int position) const {
int line = LineFromPosition(position); int line = LineFromPosition(position);
int startPosition = LineStart(line); int startPosition = LineStart(line);
int endLine = LineEnd(line); int endLine = LineEnd(line);
@ -750,10 +761,9 @@ void Document::SetLineIndentation(int line, int indent) {
CreateIndentation(linebuf, sizeof(linebuf), indent, tabInChars, !useTabs); CreateIndentation(linebuf, sizeof(linebuf), indent, tabInChars, !useTabs);
int thisLineStart = LineStart(line); int thisLineStart = LineStart(line);
int indentPos = GetLineIndentPosition(line); int indentPos = GetLineIndentPosition(line);
BeginUndoAction(); UndoGroup ug(this);
DeleteChars(thisLineStart, indentPos - thisLineStart); DeleteChars(thisLineStart, indentPos - thisLineStart);
InsertCString(thisLineStart, linebuf); InsertCString(thisLineStart, linebuf);
EndUndoAction();
} }
} }
@ -860,7 +870,7 @@ char *Document::TransformLineEnds(int *pLenOut, const char *s, size_t len, int e
} }
void Document::ConvertLineEnds(int eolModeSet) { void Document::ConvertLineEnds(int eolModeSet) {
BeginUndoAction(); UndoGroup ug(this);
for (int pos = 0; pos < Length(); pos++) { for (int pos = 0; pos < Length(); pos++) {
if (cb.CharAt(pos) == '\r') { if (cb.CharAt(pos) == '\r') {
@ -895,7 +905,6 @@ void Document::ConvertLineEnds(int eolModeSet) {
} }
} }
EndUndoAction();
} }
bool Document::IsWhiteLine(int line) const { bool Document::IsWhiteLine(int line) const {
@ -1058,16 +1067,6 @@ bool Document::IsWordAt(int start, int end) {
return IsWordStartAt(start) && IsWordEndAt(end); return IsWordStartAt(start) && IsWordEndAt(end);
} }
// The comparison and case changing functions here assume ASCII
// or extended ASCII such as the normal Windows code page.
static inline char MakeUpperCase(char ch) {
if (ch < 'a' || ch > 'z')
return ch;
else
return static_cast<char>(ch - 'a' + 'A');
}
static inline char MakeLowerCase(char ch) { static inline char MakeLowerCase(char ch) {
if (ch < 'A' || ch > 'Z') if (ch < 'A' || ch > 'Z')
return ch; return ch;
@ -1367,8 +1366,6 @@ bool Document::AddWatcher(DocWatcher *watcher, void *userData) {
return false; return false;
} }
WatcherWithUserData *pwNew = new WatcherWithUserData[lenWatchers + 1]; WatcherWithUserData *pwNew = new WatcherWithUserData[lenWatchers + 1];
if (!pwNew)
return false;
for (int j = 0; j < lenWatchers; j++) for (int j = 0; j < lenWatchers; j++)
pwNew[j] = watchers[j]; pwNew[j] = watchers[j];
pwNew[lenWatchers].watcher = watcher; pwNew[lenWatchers].watcher = watcher;
@ -1389,8 +1386,6 @@ bool Document::RemoveWatcher(DocWatcher *watcher, void *userData) {
lenWatchers = 0; lenWatchers = 0;
} else { } else {
WatcherWithUserData *pwNew = new WatcherWithUserData[lenWatchers]; WatcherWithUserData *pwNew = new WatcherWithUserData[lenWatchers];
if (!pwNew)
return false;
for (int j = 0; j < lenWatchers - 1; j++) { for (int j = 0; j < lenWatchers - 1; j++) {
pwNew[j] = (j < i) ? watchers[j] : watchers[j + 1]; pwNew[j] = (j < i) ? watchers[j] : watchers[j + 1];
} }
@ -1751,8 +1746,6 @@ const char *BuiltinRegex::SubstituteByPosition(Document* doc, const char *text,
} }
} }
substituted = new char[lenResult + 1]; substituted = new char[lenResult + 1];
if (!substituted)
return 0;
char *o = substituted; char *o = substituted;
for (int j = 0; j < *length; j++) { for (int j = 0; j < *length; j++) {
if (text[j] == '\\') { if (text[j] == '\\') {

View File

@ -175,10 +175,11 @@ public:
int AddRef(); int AddRef();
int Release(); int Release();
virtual void Init();
virtual void InsertLine(int line); virtual void InsertLine(int line);
virtual void RemoveLine(int line); virtual void RemoveLine(int line);
int LineFromPosition(int pos); int LineFromPosition(int pos) const;
int ClampPositionIntoDocument(int pos); int ClampPositionIntoDocument(int pos);
bool IsCrLf(int pos); bool IsCrLf(int pos);
int LenChar(int pos); int LenChar(int pos);
@ -237,8 +238,9 @@ public:
int LineFromHandle(int markerHandle); int LineFromHandle(int markerHandle);
int LineStart(int line) const; int LineStart(int line) const;
int LineEnd(int line) const; int LineEnd(int line) const;
int LineEndPosition(int position); int LineEndPosition(int position) const;
int VCHomePosition(int position); bool IsLineEndPosition(int position) const;
int VCHomePosition(int position) const;
int SetLevel(int line, int level); int SetLevel(int line, int level);
int GetLevel(int line); int GetLevel(int line);
@ -318,6 +320,27 @@ private:
void NotifyModified(DocModification mh); void NotifyModified(DocModification mh);
}; };
class UndoGroup {
Document *pdoc;
bool groupNeeded;
public:
UndoGroup(Document *pdoc_, bool groupNeeded_=true) :
pdoc(pdoc_), groupNeeded(groupNeeded_) {
if (groupNeeded) {
pdoc->BeginUndoAction();
}
}
~UndoGroup() {
if (groupNeeded) {
pdoc->EndUndoAction();
}
}
bool Needed() const {
return groupNeeded;
}
};
/** /**
* To optimise processing of document modifications by DocWatchers, a hint is passed indicating the * To optimise processing of document modifications by DocWatchers, a hint is passed indicating the
* scope of the change. * scope of the change.

View File

@ -14,6 +14,7 @@ class Document;
/** /**
*/ */
class DocumentAccessor : public Accessor { class DocumentAccessor : public Accessor {
// Private so DocumentAccessor objects can not be copied // Private so DocumentAccessor objects can not be copied
DocumentAccessor(const DocumentAccessor &source) : Accessor(), props(source.props) {} DocumentAccessor(const DocumentAccessor &source) : Accessor(), props(source.props) {}
@ -21,7 +22,7 @@ class DocumentAccessor : public Accessor {
protected: protected:
Document *pdoc; Document *pdoc;
PropSet &props; PropertyGet &props;
WindowID id; WindowID id;
int lenDoc; int lenDoc;
@ -37,7 +38,7 @@ protected:
void Fill(int position); void Fill(int position);
public: public:
DocumentAccessor(Document *pdoc_, PropSet &props_, WindowID id_=0) : DocumentAccessor(Document *pdoc_, PropertyGet &props_, WindowID id_=0) :
Accessor(), pdoc(pdoc_), props(props_), id(id_), Accessor(), pdoc(pdoc_), props(props_), id(id_),
lenDoc(-1), validLen(0), chFlags(0), chWhile(0), lenDoc(-1), validLen(0), chFlags(0), chWhile(0),
startSeg(0), startPosStyling(0), startSeg(0), startPosStyling(0),

File diff suppressed because it is too large Load Diff

View File

@ -78,15 +78,12 @@ public:
} }
void Copy(const char *s_, int len_, int codePage_, int characterSet_, bool rectangular_, bool lineCopy_) { void Copy(const char *s_, int len_, int codePage_, int characterSet_, bool rectangular_, bool lineCopy_) {
delete []s; delete []s;
s = 0;
s = new char[len_]; s = new char[len_];
if (s) {
len = len_; len = len_;
for (int i = 0; i < len_; i++) { for (int i = 0; i < len_; i++) {
s[i] = s_[i]; s[i] = s_[i];
} }
} else {
len = 0;
}
codePage = codePage_; codePage = codePage_;
characterSet = characterSet_; characterSet = characterSet_;
rectangular = rectangular_; rectangular = rectangular_;
@ -125,7 +122,6 @@ protected: // ScintillaBase subclass needs access to much of Editor
bool hasFocus; bool hasFocus;
bool hideSelection; bool hideSelection;
bool inOverstrike; bool inOverstrike;
int errorStatus;
bool mouseDownCaptures; bool mouseDownCaptures;
/** In bufferedDraw mode, graphics operations are drawn to a pixmap and then copied to /** In bufferedDraw mode, graphics operations are drawn to a pixmap and then copied to
@ -144,6 +140,11 @@ protected: // ScintillaBase subclass needs access to much of Editor
bool verticalScrollBarVisible; bool verticalScrollBarVisible;
bool endAtLastLine; bool endAtLastLine;
bool caretSticky; bool caretSticky;
bool multipleSelection;
bool additionalSelectionTyping;
bool additionalCaretsBlink;
int virtualSpaceOptions;
Surface *pixmapLine; Surface *pixmapLine;
Surface *pixmapSelMargin; Surface *pixmapSelMargin;
@ -172,13 +173,11 @@ protected: // ScintillaBase subclass needs access to much of Editor
Point ptMouseLast; Point ptMouseLast;
enum { ddNone, ddInitial, ddDragging } inDragDrop; enum { ddNone, ddInitial, ddDragging } inDragDrop;
bool dropWentOutside; bool dropWentOutside;
int posDrag; SelectionPosition posDrag;
int posDrop; SelectionPosition posDrop;
int lastXChosen; int lastXChosen;
int lineAnchor; int lineAnchor;
int originalAnchorPos; int originalAnchorPos;
int currentPos;
int anchor;
int targetStart; int targetStart;
int targetEnd; int targetEnd;
int searchFlags; int searchFlags;
@ -200,11 +199,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
int modEventMask; int modEventMask;
SelectionText drag; SelectionText drag;
enum selTypes { noSel, selStream, selRectangle, selLines }; Selection sel;
selTypes selType;
bool moveExtendsSelection;
int xStartSelect; ///< x position of start of rectangular selection
int xEndSelect; ///< x position of end of rectangular selection
bool primarySelection; bool primarySelection;
int caretXPolicy; int caretXPolicy;
@ -236,7 +231,8 @@ protected: // ScintillaBase subclass needs access to much of Editor
int wrapVisualFlags; int wrapVisualFlags;
int wrapVisualFlagsLocation; int wrapVisualFlagsLocation;
int wrapVisualStartIndent; int wrapVisualStartIndent;
int actualWrapVisualStartIndent; int wrapAddIndent; // This will be added to initial indent of line
int wrapIndentMode; // SC_WRAPINDENT_FIXED, _SAME, _INDENT
bool convertPastes; bool convertPastes;
@ -259,10 +255,14 @@ protected: // ScintillaBase subclass needs access to much of Editor
int LinesOnScreen(); int LinesOnScreen();
int LinesToScroll(); int LinesToScroll();
int MaxScrollPos(); int MaxScrollPos();
SelectionPosition ClampPositionIntoDocument(SelectionPosition sp) const;
Point LocationFromPosition(SelectionPosition pos);
Point LocationFromPosition(int pos); Point LocationFromPosition(int pos);
int XFromPosition(int pos); int XFromPosition(int pos);
int PositionFromLocation(Point pt); int XFromPosition(SelectionPosition sp);
int PositionFromLocationClose(Point pt); SelectionPosition SPositionFromLocation(Point pt, bool canReturnInvalid=false, bool charPosition=false, bool virtualSpace=true);
int PositionFromLocation(Point pt, bool canReturnInvalid=false, bool charPosition=false);
SelectionPosition SPositionFromLineX(int lineDoc, int x);
int PositionFromLineX(int line, int x); int PositionFromLineX(int line, int x);
int LineFromLocation(Point pt); int LineFromLocation(Point pt);
void SetTopLine(int topLineNew); void SetTopLine(int topLineNew);
@ -274,20 +274,30 @@ protected: // ScintillaBase subclass needs access to much of Editor
PRectangle RectangleFromRange(int start, int end); PRectangle RectangleFromRange(int start, int end);
void InvalidateRange(int start, int end); void InvalidateRange(int start, int end);
bool UserVirtualSpace() const {
return ((virtualSpaceOptions & SCVS_USERACCESSIBLE) != 0);
}
int CurrentPosition(); int CurrentPosition();
bool SelectionEmpty(); bool SelectionEmpty();
int SelectionStart(); SelectionPosition SelectionStart();
int SelectionEnd(); SelectionPosition SelectionEnd();
void SetRectangularRange(); void SetRectangularRange();
void InvalidateSelection(int currentPos_, int anchor_, bool invalidateWholeSelection); void InvalidateSelection(SelectionRange newMain, bool invalidateWholeSelection=false);
void SetSelection(SelectionPosition currentPos_, SelectionPosition anchor_);
void SetSelection(int currentPos_, int anchor_); void SetSelection(int currentPos_, int anchor_);
void SetSelection(SelectionPosition currentPos_);
void SetSelection(int currentPos_); void SetSelection(int currentPos_);
void SetEmptySelection(SelectionPosition currentPos_);
void SetEmptySelection(int currentPos_); void SetEmptySelection(int currentPos_);
bool RangeContainsProtected(int start, int end) const; bool RangeContainsProtected(int start, int end) const;
bool SelectionContainsProtected(); bool SelectionContainsProtected();
int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true); int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true) const;
int MovePositionTo(int newPos, selTypes sel=noSel, bool ensureVisible=true); SelectionPosition MovePositionOutsideChar(SelectionPosition pos, int moveDir, bool checkLineEnd=true) const;
int MovePositionSoVisible(int pos, int moveDir); int MovePositionTo(SelectionPosition newPos, Selection::selTypes sel=Selection::noSel, bool ensureVisible=true);
int MovePositionTo(int newPos, Selection::selTypes sel=Selection::noSel, bool ensureVisible=true);
SelectionPosition MovePositionSoVisible(SelectionPosition pos, int moveDir);
SelectionPosition MovePositionSoVisible(int pos, int moveDir);
Point PointMainCaret();
void SetLastXChosen(); void SetLastXChosen();
void ScrollTo(int line, bool moveThumb=true); void ScrollTo(int line, bool moveThumb=true);
@ -312,8 +322,8 @@ protected: // ScintillaBase subclass needs access to much of Editor
LineLayout *RetrieveLineLayout(int lineNumber); LineLayout *RetrieveLineLayout(int lineNumber);
void LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayout *ll, void LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayout *ll,
int width=LineLayout::wrapWidthInfinite); int width=LineLayout::wrapWidthInfinite);
ColourAllocated SelectionBackground(ViewStyle &vsDraw); ColourAllocated SelectionBackground(ViewStyle &vsDraw, bool main);
ColourAllocated TextBackground(ViewStyle &vsDraw, bool overrideBackground, ColourAllocated background, bool inSelection, bool inHotspot, int styleMain, int i, LineLayout *ll); ColourAllocated TextBackground(ViewStyle &vsDraw, bool overrideBackground, ColourAllocated background, int inSelection, bool inHotspot, int styleMain, int i, LineLayout *ll);
void DrawIndentGuide(Surface *surface, int lineVisible, int lineHeight, int start, PRectangle rcSegment, bool highlight); void DrawIndentGuide(Surface *surface, int lineVisible, int lineHeight, int start, PRectangle rcSegment, bool highlight);
void DrawWrapMarker(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourAllocated wrapColour); void DrawWrapMarker(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourAllocated wrapColour);
void DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, LineLayout *ll, void DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, LineLayout *ll,
@ -325,11 +335,14 @@ protected: // ScintillaBase subclass needs access to much of Editor
void DrawAnnotation(Surface *surface, ViewStyle &vsDraw, int line, int xStart, void DrawAnnotation(Surface *surface, ViewStyle &vsDraw, int line, int xStart,
PRectangle rcLine, LineLayout *ll, int subLine); PRectangle rcLine, LineLayout *ll, int subLine);
void DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVisible, int xStart, void DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVisible, int xStart,
PRectangle rcLine, LineLayout *ll, int subLine=0); PRectangle rcLine, LineLayout *ll, int subLine);
void DrawBlockCaret(Surface *surface, ViewStyle &vsDraw, LineLayout *ll, int subLine, int xStart, int offset, int posCaret, PRectangle rcCaret); void DrawBlockCaret(Surface *surface, ViewStyle &vsDraw, LineLayout *ll, int subLine,
int xStart, int offset, int posCaret, PRectangle rcCaret, ColourAllocated caretColour);
void DrawCarets(Surface *surface, ViewStyle &vsDraw, int line, int xStart,
PRectangle rcLine, LineLayout *ll, int subLine);
void RefreshPixMaps(Surface *surfaceWindow); void RefreshPixMaps(Surface *surfaceWindow);
void Paint(Surface *surfaceWindow, PRectangle rcArea); void Paint(Surface *surfaceWindow, PRectangle rcArea);
long FormatRange(bool draw, RangeToFormat *pfr); long FormatRange(bool draw, Sci_RangeToFormat *pfr);
int TextWidth(int style, const char *text); int TextWidth(int style, const char *text);
virtual void SetVerticalScrollPos() = 0; virtual void SetVerticalScrollPos() = 0;
@ -339,13 +352,15 @@ protected: // ScintillaBase subclass needs access to much of Editor
void SetScrollBars(); void SetScrollBars();
void ChangeSize(); void ChangeSize();
void FilterSelections();
int InsertSpace(int position, unsigned int spaces);
void AddChar(char ch); void AddChar(char ch);
virtual void AddCharUTF(char *s, unsigned int len, bool treatAsDBCS=false); virtual void AddCharUTF(char *s, unsigned int len, bool treatAsDBCS=false);
void ClearSelection(); void ClearSelection();
void ClearAll(); void ClearAll();
void ClearDocumentStyle(); void ClearDocumentStyle();
void Cut(); void Cut();
void PasteRectangular(int pos, const char *ptr, int len); void PasteRectangular(SelectionPosition pos, const char *ptr, int len);
virtual void Copy() = 0; virtual void Copy() = 0;
virtual void CopyAllowLine(); virtual void CopyAllowLine();
virtual bool CanPaste(); virtual bool CanPaste();
@ -364,7 +379,6 @@ protected: // ScintillaBase subclass needs access to much of Editor
virtual void NotifyParent(SCNotification scn) = 0; virtual void NotifyParent(SCNotification scn) = 0;
virtual void NotifyStyleToNeeded(int endStyleNeeded); virtual void NotifyStyleToNeeded(int endStyleNeeded);
void NotifyChar(int ch); void NotifyChar(int ch);
void NotifyMove(int position);
void NotifySavePoint(bool isSavePoint); void NotifySavePoint(bool isSavePoint);
void NotifyModifyAttempt(); void NotifyModifyAttempt();
virtual void NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt); virtual void NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt);
@ -387,14 +401,14 @@ protected: // ScintillaBase subclass needs access to much of Editor
void NotifyStyleNeeded(Document *doc, void *userData, int endPos); void NotifyStyleNeeded(Document *doc, void *userData, int endPos);
void NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lParam); void NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
void PageMove(int direction, selTypes sel=noSel, bool stuttered = false); void PageMove(int direction, Selection::selTypes sel=Selection::noSel, bool stuttered = false);
void ChangeCaseOfSelection(bool makeUpperCase); void ChangeCaseOfSelection(bool makeUpperCase);
void LineTranspose(); void LineTranspose();
void Duplicate(bool forLine); void Duplicate(bool forLine);
virtual void CancelModes(); virtual void CancelModes();
void NewLine(); void NewLine();
void CursorUpOrDown(int direction, selTypes sel=noSel); void CursorUpOrDown(int direction, Selection::selTypes sel=Selection::noSel);
void ParaUpOrDown(int direction, selTypes sel=noSel); void ParaUpOrDown(int direction, Selection::selTypes sel=Selection::noSel);
int StartEndDisplayLine(int pos, bool start); int StartEndDisplayLine(int pos, bool start);
virtual int KeyCommand(unsigned int iMessage); virtual int KeyCommand(unsigned int iMessage);
virtual int KeyDefault(int /* key */, int /*modifiers*/); virtual int KeyDefault(int /* key */, int /*modifiers*/);
@ -413,18 +427,16 @@ protected: // ScintillaBase subclass needs access to much of Editor
virtual void CopyToClipboard(const SelectionText &selectedText) = 0; virtual void CopyToClipboard(const SelectionText &selectedText) = 0;
char *CopyRange(int start, int end); char *CopyRange(int start, int end);
void CopySelectionFromRange(SelectionText *ss, bool allowLineCopy, int start, int end);
void CopySelectionRange(SelectionText *ss, bool allowLineCopy=false); void CopySelectionRange(SelectionText *ss, bool allowLineCopy=false);
void CopyRangeToClipboard(int start, int end); void CopyRangeToClipboard(int start, int end);
void CopyText(int length, const char *text); void CopyText(int length, const char *text);
void SetDragPosition(int newPos); void SetDragPosition(SelectionPosition newPos);
virtual void DisplayCursor(Window::Cursor c); virtual void DisplayCursor(Window::Cursor c);
virtual bool DragThreshold(Point ptStart, Point ptNow); virtual bool DragThreshold(Point ptStart, Point ptNow);
virtual void StartDrag(); virtual void StartDrag();
void DropAt(int position, const char *value, bool moving, bool rectangular); void DropAt(SelectionPosition position, const char *value, bool moving, bool rectangular);
/** PositionInSelection returns 0 if position in selection, -1 if position before selection, and 1 if after. /** PositionInSelection returns true if position in selection. */
* Before means either before any line of selection or before selection on its line, with a similar meaning to after. */ bool PositionInSelection(int pos);
int PositionInSelection(int pos);
bool PointInSelection(Point pt); bool PointInSelection(Point pt);
bool PointInSelMargin(Point pt); bool PointInSelMargin(Point pt);
void LineSelection(int lineCurrent_, int lineAnchor_); void LineSelection(int lineCurrent_, int lineAnchor_);
@ -479,6 +491,8 @@ public:
virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
// Public so scintilla_set_id can use it. // Public so scintilla_set_id can use it.
int ctrlID; int ctrlID;
// Public so COM methods for drag and drop can set it.
int errorStatus;
friend class AutoSurface; friend class AutoSurface;
friend class SelectionLineIterator; friend class SelectionLineIterator;
}; };

View File

@ -10,6 +10,8 @@
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#include <string>
#include "Platform.h" #include "Platform.h"
#include "Scintilla.h" #include "Scintilla.h"
@ -39,7 +41,7 @@ char **WordListsToStrings(WordList *val[]) {
dim++; dim++;
char **wls = new char * [dim + 1]; char **wls = new char * [dim + 1];
for (int i = 0;i < dim;i++) { for (int i = 0;i < dim;i++) {
SString words; std::string words;
words = ""; words = "";
for (int n = 0; n < val[i]->len; n++) { for (int n = 0; n < val[i]->len; n++) {
words += val[i]->words[n]; words += val[i]->words[n];

View File

@ -68,7 +68,7 @@ public:
void Release(); void Release();
LexerLibrary *next; LexerLibrary *next;
SString m_sModuleName; std::string m_sModuleName;
}; };
/// LexerManager manages external lexers, contains LexerLibrarys. /// LexerManager manages external lexers, contains LexerLibrarys.

View File

@ -23,6 +23,192 @@
using namespace Scintilla; using namespace Scintilla;
#endif #endif
/**
* Creates an array that points into each word in the string and puts \0 terminators
* after each word.
*/
static char **ArrayFromWordList(char *wordlist, int *len, bool onlyLineEnds = false) {
int prev = '\n';
int words = 0;
// For rapid determination of whether a character is a separator, build
// a look up table.
bool wordSeparator[256];
for (int i=0;i<256; i++) {
wordSeparator[i] = false;
}
wordSeparator['\r'] = true;
wordSeparator['\n'] = true;
if (!onlyLineEnds) {
wordSeparator[' '] = true;
wordSeparator['\t'] = true;
}
for (int j = 0; wordlist[j]; j++) {
int curr = static_cast<unsigned char>(wordlist[j]);
if (!wordSeparator[curr] && wordSeparator[prev])
words++;
prev = curr;
}
char **keywords = new char *[words + 1];
if (keywords) {
words = 0;
prev = '\0';
size_t slen = strlen(wordlist);
for (size_t k = 0; k < slen; k++) {
if (!wordSeparator[static_cast<unsigned char>(wordlist[k])]) {
if (!prev) {
keywords[words] = &wordlist[k];
words++;
}
} else {
wordlist[k] = '\0';
}
prev = wordlist[k];
}
keywords[words] = &wordlist[slen];
*len = words;
} else {
*len = 0;
}
return keywords;
}
void WordList::Clear() {
if (words) {
delete []list;
delete []words;
}
words = 0;
list = 0;
len = 0;
sorted = false;
}
void WordList::Set(const char *s) {
list = new char[strlen(s) + 1];
strcpy(list, s);
sorted = false;
words = ArrayFromWordList(list, &len, onlyLineEnds);
}
extern "C" int cmpString(const void *a1, const void *a2) {
// Can't work out the correct incantation to use modern casts here
return strcmp(*(char**)(a1), *(char**)(a2));
}
static void SortWordList(char **words, unsigned int len) {
qsort(reinterpret_cast<void*>(words), len, sizeof(*words),
cmpString);
}
bool WordList::InList(const char *s) {
if (0 == words)
return false;
if (!sorted) {
sorted = true;
SortWordList(words, len);
for (unsigned int k = 0; k < (sizeof(starts) / sizeof(starts[0])); k++)
starts[k] = -1;
for (int l = len - 1; l >= 0; l--) {
unsigned char indexChar = words[l][0];
starts[indexChar] = l;
}
}
unsigned char firstChar = s[0];
int j = starts[firstChar];
if (j >= 0) {
while ((unsigned char)words[j][0] == firstChar) {
if (s[1] == words[j][1]) {
const char *a = words[j] + 1;
const char *b = s + 1;
while (*a && *a == *b) {
a++;
b++;
}
if (!*a && !*b)
return true;
}
j++;
}
}
j = starts['^'];
if (j >= 0) {
while (words[j][0] == '^') {
const char *a = words[j] + 1;
const char *b = s;
while (*a && *a == *b) {
a++;
b++;
}
if (!*a)
return true;
j++;
}
}
return false;
}
/** similar to InList, but word s can be a substring of keyword.
* eg. the keyword define is defined as def~ine. This means the word must start
* with def to be a keyword, but also defi, defin and define are valid.
* The marker is ~ in this case.
*/
bool WordList::InListAbbreviated(const char *s, const char marker) {
if (0 == words)
return false;
if (!sorted) {
sorted = true;
SortWordList(words, len);
for (unsigned int k = 0; k < (sizeof(starts) / sizeof(starts[0])); k++)
starts[k] = -1;
for (int l = len - 1; l >= 0; l--) {
unsigned char indexChar = words[l][0];
starts[indexChar] = l;
}
}
unsigned char firstChar = s[0];
int j = starts[firstChar];
if (j >= 0) {
while (words[j][0] == firstChar) {
bool isSubword = false;
int start = 1;
if (words[j][1] == marker) {
isSubword = true;
start++;
}
if (s[1] == words[j][start]) {
const char *a = words[j] + start;
const char *b = s + 1;
while (*a && *a == *b) {
a++;
if (*a == marker) {
isSubword = true;
a++;
}
b++;
}
if ((!*a || isSubword) && !*b)
return true;
}
j++;
}
}
j = starts['^'];
if (j >= 0) {
while (words[j][0] == '^') {
const char *a = words[j] + 1;
const char *b = s;
while (*a && *a == *b) {
a++;
b++;
}
if (!*a)
return true;
j++;
}
}
return false;
}
const LexerModule *LexerModule::base = 0; const LexerModule *LexerModule::base = 0;
int LexerModule::nextLanguage = SCLEX_AUTOMATIC+1; int LexerModule::nextLanguage = SCLEX_AUTOMATIC+1;
@ -146,7 +332,6 @@ int Scintilla_LinkLexers() {
LINK_LEXER(lmAns1); LINK_LEXER(lmAns1);
LINK_LEXER(lmAPDL); LINK_LEXER(lmAPDL);
LINK_LEXER(lmAsm); LINK_LEXER(lmAsm);
LINK_LEXER(lmASP);
LINK_LEXER(lmASY); LINK_LEXER(lmASY);
LINK_LEXER(lmAU3); LINK_LEXER(lmAU3);
LINK_LEXER(lmAVE); LINK_LEXER(lmAVE);
@ -205,7 +390,6 @@ int Scintilla_LinkLexers() {
LINK_LEXER(lmPascal); LINK_LEXER(lmPascal);
LINK_LEXER(lmPB); LINK_LEXER(lmPB);
LINK_LEXER(lmPerl); LINK_LEXER(lmPerl);
LINK_LEXER(lmPHP);
LINK_LEXER(lmPHPSCRIPT); LINK_LEXER(lmPHPSCRIPT);
LINK_LEXER(lmPLM); LINK_LEXER(lmPLM);
LINK_LEXER(lmPo); LINK_LEXER(lmPo);

View File

@ -10,6 +10,8 @@
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <string>
#include "Platform.h" #include "Platform.h"
#include "Accessor.h" #include "Accessor.h"
@ -17,7 +19,6 @@
#include "PropSet.h" #include "PropSet.h"
#include "KeyWords.h" #include "KeyWords.h"
#include "SciLexer.h" #include "SciLexer.h"
#include "SString.h"
#ifdef SCI_NAMESPACE #ifdef SCI_NAMESPACE
using namespace Scintilla; using namespace Scintilla;
@ -62,8 +63,8 @@ static inline bool IsDelimiterCharacter(int ch);
static inline bool IsNumberStartCharacter(int ch); static inline bool IsNumberStartCharacter(int ch);
static inline bool IsNumberCharacter(int ch); static inline bool IsNumberCharacter(int ch);
static inline bool IsSeparatorOrDelimiterCharacter(int ch); static inline bool IsSeparatorOrDelimiterCharacter(int ch);
static bool IsValidIdentifier(const SString& identifier); static bool IsValidIdentifier(const std::string& identifier);
static bool IsValidNumber(const SString& number); static bool IsValidNumber(const std::string& number);
static inline bool IsWordStartCharacter(int ch); static inline bool IsWordStartCharacter(int ch);
static inline bool IsWordCharacter(int ch); static inline bool IsWordCharacter(int ch);
@ -117,7 +118,7 @@ static void ColouriseLabel(StyleContext& sc, WordList& keywords, bool& apostroph
sc.Forward(); sc.Forward();
sc.Forward(); sc.Forward();
SString identifier; std::string identifier;
while (!sc.atLineEnd && !IsSeparatorOrDelimiterCharacter(sc.ch)) { while (!sc.atLineEnd && !IsSeparatorOrDelimiterCharacter(sc.ch)) {
identifier += static_cast<char>(tolower(sc.ch)); identifier += static_cast<char>(tolower(sc.ch));
@ -144,7 +145,7 @@ static void ColouriseLabel(StyleContext& sc, WordList& keywords, bool& apostroph
static void ColouriseNumber(StyleContext& sc, bool& apostropheStartsAttribute) { static void ColouriseNumber(StyleContext& sc, bool& apostropheStartsAttribute) {
apostropheStartsAttribute = true; apostropheStartsAttribute = true;
SString number; std::string number;
sc.SetState(SCE_ADA_NUMBER); sc.SetState(SCE_ADA_NUMBER);
// Get all characters up to a delimiter or a separator, including points, but excluding // Get all characters up to a delimiter or a separator, including points, but excluding
@ -192,7 +193,7 @@ static void ColouriseWord(StyleContext& sc, WordList& keywords, bool& apostrophe
apostropheStartsAttribute = true; apostropheStartsAttribute = true;
sc.SetState(SCE_ADA_IDENTIFIER); sc.SetState(SCE_ADA_IDENTIFIER);
SString word; std::string word;
while (!sc.atLineEnd && !IsSeparatorOrDelimiterCharacter(sc.ch)) { while (!sc.atLineEnd && !IsSeparatorOrDelimiterCharacter(sc.ch)) {
word += static_cast<char>(tolower(sc.ch)); word += static_cast<char>(tolower(sc.ch));
@ -321,7 +322,7 @@ static inline bool IsSeparatorOrDelimiterCharacter(int ch) {
return IsASpace(ch) || IsDelimiterCharacter(ch); return IsASpace(ch) || IsDelimiterCharacter(ch);
} }
static bool IsValidIdentifier(const SString& identifier) { static bool IsValidIdentifier(const std::string& identifier) {
// First character can't be '_', so initialize the flag to true // First character can't be '_', so initialize the flag to true
bool lastWasUnderscore = true; bool lastWasUnderscore = true;
@ -355,8 +356,8 @@ static bool IsValidIdentifier(const SString& identifier) {
return true; return true;
} }
static bool IsValidNumber(const SString& number) { static bool IsValidNumber(const std::string& number) {
int hashPos = number.search("#"); size_t hashPos = number.find("#");
bool seenDot = false; bool seenDot = false;
size_t i = 0; size_t i = 0;
@ -366,7 +367,7 @@ static bool IsValidNumber(const SString& number) {
return false; // Just in case return false; // Just in case
// Decimal number // Decimal number
if (hashPos == -1) { if (hashPos == std::string::npos) {
bool canBeSpecial = false; bool canBeSpecial = false;
for (; i < length; i++) { for (; i < length; i++) {

View File

@ -474,6 +474,10 @@ static void FoldCppDoc(unsigned int startPos, int length, int initStyle,
lineCurrent++; lineCurrent++;
levelCurrent = levelNext; levelCurrent = levelNext;
levelMinCurrent = levelCurrent; levelMinCurrent = levelCurrent;
if (atEOL && (i == static_cast<unsigned int>(styler.Length()-1))) {
// There is an empty line at end of file so give it same level and empty
styler.SetLevel(lineCurrent, (levelCurrent | levelCurrent << 16) | SC_FOLDLEVELWHITEFLAG);
}
visibleChars = 0; visibleChars = 0;
} }
} }

View File

@ -2,7 +2,7 @@
/** @file LexCaml.cxx /** @file LexCaml.cxx
** Lexer for Objective Caml. ** Lexer for Objective Caml.
**/ **/
// Copyright 2005 by Robert Roessler <robertr@rftp.com> // Copyright 2005-2009 by Robert Roessler <robertr@rftp.com>
// The License.txt file describes the conditions under which this software may be distributed. // The License.txt file describes the conditions under which this software may be distributed.
/* Release History /* Release History
20050204 Initial release. 20050204 Initial release.
@ -15,6 +15,7 @@
20051125 Added 2nd "optional" keywords class. 20051125 Added 2nd "optional" keywords class.
20051129 Support "magic" (read-only) comments for RCaml. 20051129 Support "magic" (read-only) comments for RCaml.
20051204 Swtich to using StyleContext infrastructure. 20051204 Swtich to using StyleContext infrastructure.
20090629 Add full Standard ML '97 support.
*/ */
#include <stdlib.h> #include <stdlib.h>
@ -26,6 +27,7 @@
#include "Platform.h" #include "Platform.h"
#include "PropSet.h" #include "PropSet.h"
#include "PropSetSimple.h"
#include "Accessor.h" #include "Accessor.h"
#include "StyleContext.h" #include "StyleContext.h"
#include "KeyWords.h" #include "KeyWords.h"
@ -35,7 +37,6 @@
// Since the Microsoft __iscsym[f] funcs are not ANSI... // Since the Microsoft __iscsym[f] funcs are not ANSI...
inline int iscaml(int c) {return isalnum(c) || c == '_';} inline int iscaml(int c) {return isalnum(c) || c == '_';}
inline int iscamlf(int c) {return isalpha(c) || c == '_';} inline int iscamlf(int c) {return isalpha(c) || c == '_';}
inline int iscamld(int c) {return isdigit(c) || c == '_';}
static const int baseT[24] = { static const int baseT[24] = {
0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A - L */ 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A - L */
@ -143,7 +144,7 @@ static void InternalLexOrFold(int foldOrLex, unsigned int startPos, int length,
int initStyle, char *words[], WindowID window, char *props) int initStyle, char *words[], WindowID window, char *props)
{ {
// create and initialize a WindowAccessor (including contained PropSet) // create and initialize a WindowAccessor (including contained PropSet)
PropSet ps; PropSetSimple ps;
ps.SetMultiple(props); ps.SetMultiple(props);
WindowAccessor wa(window, ps); WindowAccessor wa(window, ps);
// create and initialize WordList(s) // create and initialize WordList(s)
@ -179,19 +180,21 @@ void ColouriseCamlDoc(
{ {
// initialize styler // initialize styler
StyleContext sc(startPos, length, initStyle, styler); StyleContext sc(startPos, length, initStyle, styler);
// set up [initial] state info (terminating states that shouldn't "bleed")
int nesting = 0;
if (sc.state < SCE_CAML_STRING)
sc.state = SCE_CAML_DEFAULT;
if (sc.state >= SCE_CAML_COMMENT)
nesting = (sc.state & 0x0f) - SCE_CAML_COMMENT;
int chBase = 0, chToken = 0, chLit = 0; int chBase = 0, chToken = 0, chLit = 0;
WordList& keywords = *keywordlists[0]; WordList& keywords = *keywordlists[0];
WordList& keywords2 = *keywordlists[1]; WordList& keywords2 = *keywordlists[1];
WordList& keywords3 = *keywordlists[2]; WordList& keywords3 = *keywordlists[2];
const bool isSML = keywords.InList("andalso");
const int useMagic = styler.GetPropertyInt("lexer.caml.magic", 0); const int useMagic = styler.GetPropertyInt("lexer.caml.magic", 0);
// set up [initial] state info (terminating states that shouldn't "bleed")
const int state_ = sc.state & 0x0f;
if (state_ <= SCE_CAML_CHAR
|| (isSML && state_ == SCE_CAML_STRING))
sc.state = SCE_CAML_DEFAULT;
int nesting = (state_ >= SCE_CAML_COMMENT)? (state_ - SCE_CAML_COMMENT): 0;
// foreach char in range... // foreach char in range...
while (sc.More()) { while (sc.More()) {
// set up [per-char] state info // set up [per-char] state info
@ -206,25 +209,38 @@ void ColouriseCamlDoc(
// it's wide open; what do we have? // it's wide open; what do we have?
if (iscamlf(sc.ch)) if (iscamlf(sc.ch))
state2 = SCE_CAML_IDENTIFIER; state2 = SCE_CAML_IDENTIFIER;
else if (sc.Match('`') && iscamlf(sc.chNext)) else if (!isSML && sc.Match('`') && iscamlf(sc.chNext))
state2 = SCE_CAML_TAGNAME; state2 = SCE_CAML_TAGNAME;
else if (sc.Match('#') && isdigit(sc.chNext)) else if (!isSML && sc.Match('#') && isdigit(sc.chNext))
state2 = SCE_CAML_LINENUM; state2 = SCE_CAML_LINENUM;
else if (isdigit(sc.ch)) { else if (isdigit(sc.ch)) {
// it's a number, assume base 10
state2 = SCE_CAML_NUMBER, chBase = 10; state2 = SCE_CAML_NUMBER, chBase = 10;
if (sc.Match('0') && strchr("bBoOxX", sc.chNext)) if (sc.Match('0')) {
// there MAY be a base specified...
const char* baseC = "bBoOxX";
if (isSML) {
if (sc.chNext == 'w')
sc.Forward(); // (consume SML "word" indicator)
baseC = "x";
}
// ... change to specified base AS REQUIRED
if (strchr(baseC, sc.chNext))
chBase = baseT[tolower(sc.chNext) - 'a'], sc.Forward(); chBase = baseT[tolower(sc.chNext) - 'a'], sc.Forward();
} else if (sc.Match('\'')) /* (char literal?) */ }
} else if (!isSML && sc.Match('\'')) // (Caml char literal?)
state2 = SCE_CAML_CHAR, chLit = 0; state2 = SCE_CAML_CHAR, chLit = 0;
else if (sc.Match('\"')) else if (isSML && sc.Match('#', '"')) // (SML char literal?)
state2 = SCE_CAML_CHAR, sc.Forward();
else if (sc.Match('"'))
state2 = SCE_CAML_STRING; state2 = SCE_CAML_STRING;
else if (sc.Match('(', '*')) else if (sc.Match('(', '*'))
state2 = SCE_CAML_COMMENT, state2 = SCE_CAML_COMMENT, sc.Forward(), sc.ch = ' '; // (*)...
sc.ch = ' ', // (make SURE "(*)" isn't seen as a closed comment)
sc.Forward();
else if (strchr("!?~" /* Caml "prefix-symbol" */ else if (strchr("!?~" /* Caml "prefix-symbol" */
"=<>@^|&+-*/$%" /* Caml "infix-symbol" */ "=<>@^|&+-*/$%" /* Caml "infix-symbol" */
"()[]{};,:.#", sc.ch)) /* Caml "bracket" or ;,:.# */ "()[]{};,:.#", sc.ch) // Caml "bracket" or ;,:.#
// SML "extra" ident chars
|| (isSML && (sc.Match('\\') || sc.Match('`'))))
state2 = SCE_CAML_OPERATOR; state2 = SCE_CAML_OPERATOR;
break; break;
@ -273,9 +289,12 @@ void ColouriseCamlDoc(
case SCE_CAML_OPERATOR: { case SCE_CAML_OPERATOR: {
// [try to] interpret as [additional] operator char // [try to] interpret as [additional] operator char
const char* o = 0; const char* o = 0;
if (iscaml(sc.ch) || isspace(sc.ch) /* ident or whitespace */ if (iscaml(sc.ch) || isspace(sc.ch) // ident or whitespace
|| (o = strchr(")]};,\'\"`#", sc.ch),o)/* "termination" chars */ || (o = strchr(")]};,\'\"#", sc.ch),o) // "termination" chars
|| !strchr("!$%&*+-./:<=>?@^|~", sc.ch)/* "operator" chars */) { || (!isSML && sc.Match('`')) // Caml extra term char
|| (!strchr("!$%&*+-./:<=>?@^|~", sc.ch)// "operator" chars
// SML extra ident chars
&& !(isSML && (sc.Match('\\') || sc.Match('`'))))) {
// check for INCLUSIVE termination // check for INCLUSIVE termination
if (o && strchr(")]};,", sc.ch)) { if (o && strchr(")]};,", sc.ch)) {
if ((sc.Match(')') && sc.chPrev == '(') if ((sc.Match(')') && sc.chPrev == '(')
@ -292,24 +311,27 @@ void ColouriseCamlDoc(
case SCE_CAML_NUMBER: case SCE_CAML_NUMBER:
// [try to] interpret as [additional] numeric literal char // [try to] interpret as [additional] numeric literal char
// N.B. - improperly accepts "extra" digits in base 2 or 8 literals if ((!isSML && sc.Match('_')) || IsADigit(sc.ch, chBase))
if (iscamld(sc.ch) || IsADigit(sc.ch, chBase))
break; break;
// how about an integer suffix? // how about an integer suffix?
if ((sc.Match('l') || sc.Match('L') || sc.Match('n')) if (!isSML && (sc.Match('l') || sc.Match('L') || sc.Match('n'))
&& (iscamld(sc.chPrev) || IsADigit(sc.chPrev, chBase))) && (sc.chPrev == '_' || IsADigit(sc.chPrev, chBase)))
break; break;
// or a floating-point literal? // or a floating-point literal?
if (chBase == 10) { if (chBase == 10) {
// with a decimal point? // with a decimal point?
if (sc.Match('.') && iscamld(sc.chPrev)) if (sc.Match('.')
&& ((!isSML && sc.chPrev == '_')
|| IsADigit(sc.chPrev, chBase)))
break; break;
// with an exponent? (I) // with an exponent? (I)
if ((sc.Match('e') || sc.Match('E')) if ((sc.Match('e') || sc.Match('E'))
&& (iscamld(sc.chPrev) || sc.chPrev == '.')) && ((!isSML && (sc.chPrev == '.' || sc.chPrev == '_'))
|| IsADigit(sc.chPrev, chBase)))
break; break;
// with an exponent? (II) // with an exponent? (II)
if ((sc.Match('+') || sc.Match('-')) if (((!isSML && (sc.Match('+') || sc.Match('-')))
|| (isSML && sc.Match('~')))
&& (sc.chPrev == 'e' || sc.chPrev == 'E')) && (sc.chPrev == 'e' || sc.chPrev == 'E'))
break; break;
} }
@ -318,13 +340,15 @@ void ColouriseCamlDoc(
break; break;
case SCE_CAML_CHAR: case SCE_CAML_CHAR:
if (!isSML) {
// [try to] interpret as [additional] char literal char // [try to] interpret as [additional] char literal char
if (sc.Match('\\')) { if (sc.Match('\\')) {
chLit = 1; // (definitely IS a char literal) chLit = 1; // (definitely IS a char literal)
if (sc.chPrev == '\\') if (sc.chPrev == '\\')
sc.ch = ' '; // (so termination test isn't fooled) sc.ch = ' '; // (...\\')
// should we be terminating - one way or another? // should we be terminating - one way or another?
} else if ((sc.Match('\'') && sc.chPrev != '\\') || sc.atLineEnd) { } else if ((sc.Match('\'') && sc.chPrev != '\\')
|| sc.atLineEnd) {
state2 = SCE_CAML_DEFAULT; state2 = SCE_CAML_DEFAULT;
if (sc.Match('\'')) if (sc.Match('\''))
chColor++; chColor++;
@ -334,13 +358,38 @@ void ColouriseCamlDoc(
} else if (chLit < 1 && sc.currentPos - chToken >= 2) } else if (chLit < 1 && sc.currentPos - chToken >= 2)
sc.ChangeState(SCE_CAML_IDENTIFIER), advance = false; sc.ChangeState(SCE_CAML_IDENTIFIER), advance = false;
break; break;
}/* else
// fall through for SML char literal (handle like string) */
case SCE_CAML_STRING: case SCE_CAML_STRING:
// [try to] interpret as [additional] string literal char // [try to] interpret as [additional] [SML char/] string literal char
if (sc.Match('\\') && sc.chPrev == '\\') if (isSML && sc.Match('\\') && sc.chPrev != '\\' && isspace(sc.chNext))
sc.ch = ' '; // (so '\\' doesn't cause us trouble) state2 = SCE_CAML_WHITE;
else if (sc.Match('\"') && sc.chPrev != '\\') else if (sc.Match('\\') && sc.chPrev == '\\')
state2 = SCE_CAML_DEFAULT, chColor++; sc.ch = ' '; // (...\\")
// should we be terminating - one way or another?
else if ((sc.Match('"') && sc.chPrev != '\\')
|| (isSML && sc.atLineEnd)) {
state2 = SCE_CAML_DEFAULT;
if (sc.Match('"'))
chColor++;
}
break;
case SCE_CAML_WHITE:
// [try to] interpret as [additional] SML embedded whitespace char
if (sc.Match('\\')) {
// style this puppy NOW...
state2 = SCE_CAML_STRING, sc.ch = ' ' /* (...\") */, chColor++,
styler.ColourTo(chColor, SCE_CAML_WHITE), styler.Flush();
// ... then backtrack to determine original SML literal type
int p = chColor - 2;
for (; p >= 0 && styler.StyleAt(p) == SCE_CAML_WHITE; p--) ;
if (p >= 0)
state2 = static_cast<int>(styler.StyleAt(p));
// take care of state change NOW
sc.ChangeState(state2), state2 = -1;
}
break; break;
case SCE_CAML_COMMENT: case SCE_CAML_COMMENT:
@ -350,8 +399,7 @@ void ColouriseCamlDoc(
// we're IN a comment - does this start a NESTED comment? // we're IN a comment - does this start a NESTED comment?
if (sc.Match('(', '*')) if (sc.Match('(', '*'))
state2 = sc.state + 1, chToken = sc.currentPos, state2 = sc.state + 1, chToken = sc.currentPos,
sc.ch = ' ', // (make SURE "(*)" isn't seen as a closed comment) sc.Forward(), sc.ch = ' ' /* (*)... */, nesting++;
sc.Forward(), nesting++;
// [try to] interpret as [additional] comment char // [try to] interpret as [additional] comment char
else if (sc.Match(')') && sc.chPrev == '*') { else if (sc.Match(')') && sc.chPrev == '*') {
if (nesting) if (nesting)
@ -366,7 +414,7 @@ void ColouriseCamlDoc(
break; break;
} }
// handle state change and char coloring as required // handle state change and char coloring AS REQUIRED
if (state2 >= 0) if (state2 >= 0)
styler.ColourTo(chColor, sc.state), sc.ChangeState(state2); styler.ColourTo(chColor, sc.state), sc.ChangeState(state2);
// move to next char UNLESS re-scanning current char // move to next char UNLESS re-scanning current char

View File

@ -13,6 +13,7 @@
#include "Platform.h" #include "Platform.h"
#include "CharClassify.h"
#include "PropSet.h" #include "PropSet.h"
#include "Accessor.h" #include "Accessor.h"
#include "KeyWords.h" #include "KeyWords.h"

View File

@ -25,20 +25,20 @@
using namespace Scintilla; using namespace Scintilla;
#endif #endif
/*/ Nested comments require keeping the value of the nesting level for every /* Nested comments require keeping the value of the nesting level for every
position in the document. But since scintilla always styles line by line, position in the document. But since scintilla always styles line by line,
we only need to store one value per line. The non-negative number indicates we only need to store one value per line. The non-negative number indicates
nesting level at the end of the line. nesting level at the end of the line.
/*/ */
// We use custom qualifiers since it is not clear what D allows. // Underscore, letter, digit and universal alphas from C99 Appendix D.
static bool IsWordStart(int ch) { static bool IsWordStart(int ch) {
return isascii(ch) && (isalpha(ch) || ch == '_'); return (isascii(ch) && (isalpha(ch) || ch == '_')) || !isascii(ch);
} }
static bool IsWord(int ch) { static bool IsWord(int ch) {
return isascii(ch) && (isalnum(ch) || ch == '_'); return (isascii(ch) && (isalnum(ch) || ch == '_')) || !isascii(ch);
} }
static bool IsDoxygen(int ch) { static bool IsDoxygen(int ch) {
@ -51,14 +51,21 @@ static bool IsDoxygen(int ch) {
return false; return false;
} }
static bool IsStringSuffix(int ch) {
return ch == 'c' || ch == 'w' || ch == 'd';
}
static void ColouriseDoc(unsigned int startPos, int length, int initStyle, static void ColouriseDoc(unsigned int startPos, int length, int initStyle,
WordList *keywordlists[], Accessor &styler, bool caseSensitive) { WordList *keywordlists[], Accessor &styler, bool caseSensitive) {
WordList &keywords = *keywordlists[0]; WordList &keywords = *keywordlists[0];
WordList &keywords2 = *keywordlists[1]; WordList &keywords2 = *keywordlists[1];
WordList &keywords3 = *keywordlists[2]; WordList &keywords3 = *keywordlists[2]; //doxygen
WordList &keywords4 = *keywordlists[3]; WordList &keywords4 = *keywordlists[3];
WordList &keywords5 = *keywordlists[4];
WordList &keywords6 = *keywordlists[5];
WordList &keywords7 = *keywordlists[6];
int styleBeforeDCKeyword = SCE_D_DEFAULT; int styleBeforeDCKeyword = SCE_D_DEFAULT;
@ -66,30 +73,16 @@ static void ColouriseDoc(unsigned int startPos, int length, int initStyle,
int curLine = styler.GetLine(startPos); int curLine = styler.GetLine(startPos);
int curNcLevel = curLine > 0? styler.GetLineState(curLine-1): 0; int curNcLevel = curLine > 0? styler.GetLineState(curLine-1): 0;
bool numFloat = false; // Float literals have '+' and '-' signs
bool numHex = false;
for (; sc.More(); sc.Forward()) { for (; sc.More(); sc.Forward()) {
if (sc.atLineStart) { if (sc.atLineStart) {
if (sc.state == SCE_D_STRING) {
// Prevent SCE_D_STRINGEOL from leaking back to previous line which
// ends with a line continuation by locking in the state upto this position.
sc.SetState(SCE_D_STRING);
}
curLine = styler.GetLine(sc.currentPos); curLine = styler.GetLine(sc.currentPos);
styler.SetLineState(curLine, curNcLevel); styler.SetLineState(curLine, curNcLevel);
} }
// Handle line continuation generically.
if (sc.ch == '\\') {
if (sc.chNext == '\n' || sc.chNext == '\r') {
sc.Forward();
if (sc.ch == '\r' && sc.chNext == '\n') {
sc.Forward();
}
continue;
}
}
// Determine if the current state should terminate. // Determine if the current state should terminate.
switch (sc.state) { switch (sc.state) {
case SCE_D_OPERATOR: case SCE_D_OPERATOR:
@ -97,7 +90,18 @@ static void ColouriseDoc(unsigned int startPos, int length, int initStyle,
break; break;
case SCE_D_NUMBER: case SCE_D_NUMBER:
// We accept almost anything because of hex. and number suffixes // We accept almost anything because of hex. and number suffixes
if (!IsWord(sc.ch) && sc.ch != '.') { if (isascii(sc.ch) && (isalnum(sc.ch) || sc.ch == '_')) {
continue;
} else if (sc.ch == '.' && sc.chNext != '.' && !numFloat) {
// Don't parse 0..2 as number.
numFloat=true;
continue;
} else if ( ( sc.ch == '-' || sc.ch == '+' ) && ( /*sign and*/
( !numHex && ( sc.chPrev == 'e' || sc.chPrev == 'E' ) ) || /*decimal or*/
( sc.chPrev == 'p' || sc.chPrev == 'P' ) ) ) { /*hex*/
// Parse exponent sign in float literals: 2e+10 0x2e+10
continue;
} else {
sc.SetState(SCE_D_DEFAULT); sc.SetState(SCE_D_DEFAULT);
} }
break; break;
@ -115,6 +119,12 @@ static void ColouriseDoc(unsigned int startPos, int length, int initStyle,
sc.ChangeState(SCE_D_WORD2); sc.ChangeState(SCE_D_WORD2);
} else if (keywords4.InList(s)) { } else if (keywords4.InList(s)) {
sc.ChangeState(SCE_D_TYPEDEF); sc.ChangeState(SCE_D_TYPEDEF);
} else if (keywords5.InList(s)) {
sc.ChangeState(SCE_D_WORD5);
} else if (keywords6.InList(s)) {
sc.ChangeState(SCE_D_WORD6);
} else if (keywords7.InList(s)) {
sc.ChangeState(SCE_D_WORD7);
} }
sc.SetState(SCE_D_DEFAULT); sc.SetState(SCE_D_DEFAULT);
} }
@ -181,8 +191,7 @@ static void ColouriseDoc(unsigned int startPos, int length, int initStyle,
if (curNcLevel == 0) { if (curNcLevel == 0) {
sc.ForwardSetState(SCE_D_DEFAULT); sc.ForwardSetState(SCE_D_DEFAULT);
} }
} } else if (sc.Match('/','+')) {
else if (sc.Match('/','+')) {
curNcLevel += 1; curNcLevel += 1;
curLine = styler.GetLine(sc.currentPos); curLine = styler.GetLine(sc.currentPos);
styler.SetLineState(curLine, curNcLevel); styler.SetLineState(curLine, curNcLevel);
@ -190,13 +199,13 @@ static void ColouriseDoc(unsigned int startPos, int length, int initStyle,
} }
break; break;
case SCE_D_STRING: case SCE_D_STRING:
if (sc.atLineEnd) { if (sc.ch == '\\') {
sc.ChangeState(SCE_D_STRINGEOL); if (sc.chNext == '"' || sc.chNext == '\\') {
} else if (sc.ch == '\\') {
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
sc.Forward(); sc.Forward();
} }
} else if (sc.ch == '\"') { } else if (sc.ch == '"') {
if(IsStringSuffix(sc.chNext))
sc.Forward();
sc.ForwardSetState(SCE_D_DEFAULT); sc.ForwardSetState(SCE_D_DEFAULT);
} }
break; break;
@ -204,10 +213,11 @@ static void ColouriseDoc(unsigned int startPos, int length, int initStyle,
if (sc.atLineEnd) { if (sc.atLineEnd) {
sc.ChangeState(SCE_D_STRINGEOL); sc.ChangeState(SCE_D_STRINGEOL);
} else if (sc.ch == '\\') { } else if (sc.ch == '\\') {
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { if (sc.chNext == '\'' || sc.chNext == '\\') {
sc.Forward(); sc.Forward();
} }
} else if (sc.ch == '\'') { } else if (sc.ch == '\'') {
// Char has no suffixes
sc.ForwardSetState(SCE_D_DEFAULT); sc.ForwardSetState(SCE_D_DEFAULT);
} }
break; break;
@ -216,13 +226,35 @@ static void ColouriseDoc(unsigned int startPos, int length, int initStyle,
sc.SetState(SCE_D_DEFAULT); sc.SetState(SCE_D_DEFAULT);
} }
break; break;
case SCE_D_STRINGB:
if (sc.ch == '`') {
if(IsStringSuffix(sc.chNext))
sc.Forward();
sc.ForwardSetState(SCE_D_DEFAULT);
}
break;
case SCE_D_STRINGR:
if (sc.ch == '"') {
if(IsStringSuffix(sc.chNext))
sc.Forward();
sc.ForwardSetState(SCE_D_DEFAULT);
}
break;
} }
// Determine if a new state should be entered. // Determine if a new state should be entered.
if (sc.state == SCE_D_DEFAULT) { if (sc.state == SCE_D_DEFAULT) {
if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
sc.SetState(SCE_D_NUMBER); sc.SetState(SCE_D_NUMBER);
} else if (IsWordStart(sc.ch)) { numFloat = sc.ch == '.';
// Remember hex literal
numHex = sc.ch == '0' && ( sc.chNext == 'x' || sc.chNext == 'X' );
} else if ( (sc.ch == 'r' || sc.ch == 'x' || sc.ch == 'q')
&& sc.chNext == '"' ) {
// Limited support for hex and delimited strings: parse as r""
sc.SetState(SCE_D_STRINGR);
sc.Forward();
} else if (IsWordStart(sc.ch) || sc.ch == '$') {
sc.SetState(SCE_D_IDENTIFIER); sc.SetState(SCE_D_IDENTIFIER);
} else if (sc.Match('/','+')) { } else if (sc.Match('/','+')) {
curNcLevel += 1; curNcLevel += 1;
@ -243,12 +275,15 @@ static void ColouriseDoc(unsigned int startPos, int length, int initStyle,
sc.SetState(SCE_D_COMMENTLINEDOC); sc.SetState(SCE_D_COMMENTLINEDOC);
else else
sc.SetState(SCE_D_COMMENTLINE); sc.SetState(SCE_D_COMMENTLINE);
} else if (sc.ch == '\"') { } else if (sc.ch == '"') {
sc.SetState(SCE_D_STRING); sc.SetState(SCE_D_STRING);
} else if (sc.ch == '\'') { } else if (sc.ch == '\'') {
sc.SetState(SCE_D_CHARACTER); sc.SetState(SCE_D_CHARACTER);
} else if (sc.ch == '`') {
sc.SetState(SCE_D_STRINGB);
} else if (isoperator(static_cast<char>(sc.ch))) { } else if (isoperator(static_cast<char>(sc.ch))) {
sc.SetState(SCE_D_OPERATOR); sc.SetState(SCE_D_OPERATOR);
if (sc.ch == '.' && sc.chNext == '.') sc.Forward(); // Range operator
} }
} }
} }
@ -350,6 +385,9 @@ static const char * const dWordLists[] = {
"Secondary keywords and identifiers", "Secondary keywords and identifiers",
"Documentation comment keywords", "Documentation comment keywords",
"Type definitions and aliases", "Type definitions and aliases",
"Keywords 5",
"Keywords 6",
"Keywords 7",
0, 0,
}; };

View File

@ -1,10 +1,8 @@
// Scintilla source code edit control // Scintilla source code edit control
/** @file LexCrontab.cxx /** @file LexForth.cxx
** Lexer to use with extended crontab files used by a powerful ** Lexer for FORTH
** Windows scheduler/event monitor/automation manager nnCron.
** (http://nemtsev.eserv.ru/)
**/ **/
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org> // Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed. // The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h> #include <stdlib.h>
@ -17,6 +15,7 @@
#include "PropSet.h" #include "PropSet.h"
#include "Accessor.h" #include "Accessor.h"
#include "StyleContext.h"
#include "KeyWords.h" #include "KeyWords.h"
#include "Scintilla.h" #include "Scintilla.h"
#include "SciLexer.h" #include "SciLexer.h"
@ -25,100 +24,29 @@
using namespace Scintilla; using namespace Scintilla;
#endif #endif
bool is_whitespace(int ch){ static inline bool IsAWordChar(int ch) {
return ch == '\n' || ch == '\r' || ch == '\t' || ch == ' '; return (ch < 0x80) && (isalnum(ch) || ch == '.' ||
ch == '_' || ch == '?' || ch == '"' || ch == '@' ||
ch == '!' || ch == '[' || ch == ']' || ch == '/' ||
ch == '+' || ch == '-' || ch == '*' || ch == '<' ||
ch == '>' || ch == '=' || ch == ';' || ch == '(' ||
ch == ')' );
} }
bool is_blank(int ch){ static inline bool IsAWordStart(int ch) {
return ch == '\t' || ch == ' '; return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.');
}
//#define FORTH_DEBUG
#ifdef FORTH_DEBUG
static FILE *f_debug;
#define log(x) fputs(f_debug,x);
#else
#define log(x)
#endif
#define STATE_LOCALE
#define BL ' '
static Accessor *st;
static int cur_pos,pos1,pos2,pos0,lengthDoc;
char *buffer;
char getChar(bool is_bl){
char ch=st->SafeGetCharAt(cur_pos);
if(is_bl) if(is_whitespace(ch)) ch=BL;
return ch;
} }
char getCharBL(){ static inline bool IsANumChar(int ch) {
char ch=st->SafeGetCharAt(cur_pos); return (ch < 0x80) && (isxdigit(ch) || ch == '.' || ch == 'e' || ch == 'E' );
return ch;
}
bool is_eol(char ch){
return ch=='\n' || ch=='\r';
} }
int parse(char ch, bool skip_eol){ static inline bool IsASpaceChar(int ch) {
// pos1 - start pos of word return (ch < 0x80) && isspace(ch);
// pos2 - pos after of word
// pos0 - start pos
char c=0;
int len;
bool is_bl=ch==BL;
pos0=pos1=pos2=cur_pos;
for(;cur_pos<lengthDoc && (c=getChar(is_bl))==ch; cur_pos++){
if(is_eol(c) && !skip_eol){
pos2=pos1;
return 0;
}
}
pos1=cur_pos;
pos2=pos1;
if(cur_pos==lengthDoc) return 0;
for(len=0;cur_pos<lengthDoc && (c=getChar(is_bl))!=ch; cur_pos++){
if(is_eol(c) && !skip_eol) break;
pos2++;
buffer[len++]=c;
}
if(c==ch) pos2--;
buffer[len]='\0';
#ifdef FORTH_DEBUG
fprintf(f_debug,"parse: %c %s\n",ch,buffer);
#endif
return len;
} }
bool _is_number(char *s,int base){ static void ColouriseForthDoc(unsigned int startPos, int length, int initStyle, WordList *keywordLists[],
for(;*s;s++){ Accessor &styler) {
int digit=((int)*s)-(int)'0';
#ifdef FORTH_DEBUG
fprintf(f_debug,"digit: %c %d\n",*s,digit);
#endif
if(digit>9 && base>10) digit-=7;
if(digit<0) return false;
if(digit>=base) return false;
}
return true;
}
bool is_number(char *s){
if(strncmp(s,"0x",2)==0) return _is_number(s+2,16);
return _is_number(s,10);
}
static void ColouriseForthDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler)
{
st=&styler;
cur_pos=startPos;
lengthDoc = startPos + length;
buffer = new char[length];
#ifdef FORTH_DEBUG
f_debug=fopen("c:\\sci.log","at");
#endif
WordList &control = *keywordLists[0]; WordList &control = *keywordLists[0];
WordList &keyword = *keywordLists[1]; WordList &keyword = *keywordLists[1];
@ -127,212 +55,106 @@ static void ColouriseForthDoc(unsigned int startPos, int length, int, WordList *
WordList &preword2 = *keywordLists[4]; WordList &preword2 = *keywordLists[4];
WordList &strings = *keywordLists[5]; WordList &strings = *keywordLists[5];
// go through all provided text segment StyleContext sc(startPos, length, initStyle, styler);
// using the hand-written state machine shown below
styler.StartAt(startPos);
styler.StartSegment(startPos);
while(parse(BL,true)!=0){
if(pos0!=pos1){
styler.ColourTo(pos0,SCE_FORTH_DEFAULT);
styler.ColourTo(pos1-1,SCE_FORTH_DEFAULT);
}
if(strcmp("\\",buffer)==0){
styler.ColourTo(pos1,SCE_FORTH_COMMENT);
parse(1,false);
styler.ColourTo(pos2,SCE_FORTH_COMMENT);
}else if(strcmp("(",buffer)==0){
styler.ColourTo(pos1,SCE_FORTH_COMMENT);
parse(')',true);
if(cur_pos<lengthDoc) cur_pos++;
styler.ColourTo(cur_pos,SCE_FORTH_COMMENT);
}else if(strcmp("[",buffer)==0){
styler.ColourTo(pos1,SCE_FORTH_STRING);
parse(']',true);
if(cur_pos<lengthDoc) cur_pos++;
styler.ColourTo(cur_pos,SCE_FORTH_STRING);
}else if(strcmp("{",buffer)==0){
styler.ColourTo(pos1,SCE_FORTH_LOCALE);
parse('}',false);
if(cur_pos<lengthDoc) cur_pos++;
styler.ColourTo(cur_pos,SCE_FORTH_LOCALE);
}else if(strings.InList(buffer)) {
styler.ColourTo(pos1,SCE_FORTH_STRING);
parse('"',false);
if(cur_pos<lengthDoc) cur_pos++;
styler.ColourTo(cur_pos,SCE_FORTH_STRING);
}else if(control.InList(buffer)) {
styler.ColourTo(pos1,SCE_FORTH_CONTROL);
styler.ColourTo(pos2,SCE_FORTH_CONTROL);
}else if(keyword.InList(buffer)) {
styler.ColourTo(pos1,SCE_FORTH_KEYWORD);
styler.ColourTo(pos2,SCE_FORTH_KEYWORD);
}else if(defword.InList(buffer)) {
styler.ColourTo(pos1,SCE_FORTH_KEYWORD);
styler.ColourTo(pos2,SCE_FORTH_KEYWORD);
parse(BL,false);
styler.ColourTo(pos1-1,SCE_FORTH_DEFAULT);
styler.ColourTo(pos1,SCE_FORTH_DEFWORD);
styler.ColourTo(pos2,SCE_FORTH_DEFWORD);
}else if(preword1.InList(buffer)) {
styler.ColourTo(pos1,SCE_FORTH_PREWORD1);
parse(BL,false);
styler.ColourTo(pos2,SCE_FORTH_PREWORD1);
}else if(preword2.InList(buffer)) {
styler.ColourTo(pos1,SCE_FORTH_PREWORD2);
parse(BL,false);
styler.ColourTo(pos2,SCE_FORTH_PREWORD2);
parse(BL,false);
styler.ColourTo(pos1,SCE_FORTH_STRING);
styler.ColourTo(pos2,SCE_FORTH_STRING);
}else if(is_number(buffer)){
styler.ColourTo(pos1,SCE_FORTH_NUMBER);
styler.ColourTo(pos2,SCE_FORTH_NUMBER);
}
}
#ifdef FORTH_DEBUG
fclose(f_debug);
#endif
delete []buffer;
return;
/*
if(control.InList(buffer)) {
styler.ColourTo(i,SCE_FORTH_CONTROL);
} else if(keyword.InList(buffer)) {
styler.ColourTo(i-1,SCE_FORTH_KEYWORD );
} else if(defword.InList(buffer)) {
styler.ColourTo(i-1,SCE_FORTH_DEFWORD );
// prev_state=SCE_FORTH_DEFWORD
} else if(preword1.InList(buffer)) {
styler.ColourTo(i-1,SCE_FORTH_PREWORD1 );
// state=SCE_FORTH_PREWORD1;
} else if(preword2.InList(buffer)) {
styler.ColourTo(i-1,SCE_FORTH_PREWORD2 );
} else {
styler.ColourTo(i-1,SCE_FORTH_DEFAULT);
}
*/
/*
chPrev=' ';
for (int i = startPos; i < lengthDoc; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
if(i!=startPos) chPrev=styler.SafeGetCharAt(i - 1);
if (styler.IsLeadByte(ch)) { for (; sc.More(); sc.Forward())
chNext = styler.SafeGetCharAt(i + 2); {
i++; // Determine if the current state should terminate.
continue; if (sc.state == SCE_FORTH_COMMENT) {
if (sc.atLineEnd) {
sc.SetState(SCE_FORTH_DEFAULT);
}
}else if (sc.state == SCE_FORTH_COMMENT_ML) {
if (sc.ch == ')') {
sc.ForwardSetState(SCE_FORTH_DEFAULT);
}
}else if (sc.state == SCE_FORTH_IDENTIFIER || sc.state == SCE_FORTH_NUMBER) {
// handle numbers here too, because what we thought was a number might
// turn out to be a keyword e.g. 2DUP
if (IsASpaceChar(sc.ch) ) {
char s[100];
sc.GetCurrentLowered(s, sizeof(s));
int newState = sc.state == SCE_FORTH_NUMBER ? SCE_FORTH_NUMBER : SCE_FORTH_DEFAULT;
if (control.InList(s)) {
sc.ChangeState(SCE_FORTH_CONTROL);
} else if (keyword.InList(s)) {
sc.ChangeState(SCE_FORTH_KEYWORD);
} else if (defword.InList(s)) {
sc.ChangeState(SCE_FORTH_DEFWORD);
} else if (preword1.InList(s)) {
sc.ChangeState(SCE_FORTH_PREWORD1);
} else if (preword2.InList(s)) {
sc.ChangeState(SCE_FORTH_PREWORD2);
} else if (strings.InList(s)) {
sc.ChangeState(SCE_FORTH_STRING);
newState = SCE_FORTH_STRING;
}
sc.SetState(newState);
}
if (sc.state == SCE_FORTH_NUMBER) {
if (IsASpaceChar(sc.ch)) {
sc.SetState(SCE_FORTH_DEFAULT);
} else if (!IsANumChar(sc.ch)) {
sc.ChangeState(SCE_FORTH_IDENTIFIER);
}
}
}else if (sc.state == SCE_FORTH_STRING) {
if (sc.ch == '\"') {
sc.ForwardSetState(SCE_FORTH_DEFAULT);
}
}else if (sc.state == SCE_FORTH_LOCALE) {
if (sc.ch == '}') {
sc.ForwardSetState(SCE_FORTH_DEFAULT);
}
}else if (sc.state == SCE_FORTH_DEFWORD) {
if (IsASpaceChar(sc.ch)) {
sc.SetState(SCE_FORTH_DEFAULT);
} }
#ifdef FORTH_DEBUG
fprintf(f_debug,"%c %d ",ch,state);
#endif
switch(state) {
case SCE_FORTH_DEFAULT:
if(is_whitespace(ch)) {
// whitespace is simply ignored here...
styler.ColourTo(i,SCE_FORTH_DEFAULT);
break;
} else if( ch == '\\' && is_blank(chNext)) {
// signals the start of an one line comment...
state = SCE_FORTH_COMMENT;
styler.ColourTo(i,SCE_FORTH_COMMENT);
} else if( is_whitespace(chPrev) && ch == '(' && is_whitespace(chNext)) {
// signals the start of a plain comment...
state = SCE_FORTH_COMMENT_ML;
styler.ColourTo(i,SCE_FORTH_COMMENT_ML);
} else if( isdigit(ch) ) {
// signals the start of a number
bufferCount = 0;
buffer[bufferCount++] = ch;
state = SCE_FORTH_NUMBER;
} else if( !is_whitespace(ch)) {
// signals the start of an identifier
bufferCount = 0;
buffer[bufferCount++] = ch;
state = SCE_FORTH_IDENTIFIER;
} else {
// style it the default style..
styler.ColourTo(i,SCE_FORTH_DEFAULT);
} }
break;
case SCE_FORTH_COMMENT: // Determine if a new state should be entered.
// if we find a newline here, if (sc.state == SCE_FORTH_DEFAULT) {
// we simply go to default state if (sc.ch == '\\'){
// else continue to work on it... sc.SetState(SCE_FORTH_COMMENT);
if( ch == '\n' || ch == '\r' ) { } else if (sc.ch == '(' &&
state = SCE_FORTH_DEFAULT; (sc.atLineStart || IsASpaceChar(sc.chPrev)) &&
} else { (sc.atLineEnd || IsASpaceChar(sc.chNext))) {
styler.ColourTo(i,SCE_FORTH_COMMENT); sc.SetState(SCE_FORTH_COMMENT_ML);
} else if ( (sc.ch == '$' && (isascii(sc.chNext) && isxdigit(sc.chNext))) ) {
// number starting with $ is a hex number
sc.SetState(SCE_FORTH_NUMBER);
while(sc.More() && isascii(sc.chNext) && isxdigit(sc.chNext))
sc.Forward();
} else if ( (sc.ch == '%' && (isascii(sc.chNext) && (sc.chNext == '0' || sc.chNext == '1'))) ) {
// number starting with % is binary
sc.SetState(SCE_FORTH_NUMBER);
while(sc.More() && isascii(sc.chNext) && (sc.chNext == '0' || sc.chNext == '1'))
sc.Forward();
} else if ( isascii(sc.ch) &&
(isxdigit(sc.ch) || ((sc.ch == '.' || sc.ch == '-') && isascii(sc.chNext) && isxdigit(sc.chNext)) )
){
sc.SetState(SCE_FORTH_NUMBER);
} else if (IsAWordStart(sc.ch)) {
sc.SetState(SCE_FORTH_IDENTIFIER);
} else if (sc.ch == '{') {
sc.SetState(SCE_FORTH_LOCALE);
} else if (sc.ch == ':' && isascii(sc.chNext) && isspace(sc.chNext)) {
// highlight word definitions e.g. : GCD ( n n -- n ) ..... ;
// ^ ^^^
sc.SetState(SCE_FORTH_DEFWORD);
while(sc.More() && isascii(sc.chNext) && isspace(sc.chNext))
sc.Forward();
} else if (sc.ch == ';' &&
(sc.atLineStart || IsASpaceChar(sc.chPrev)) &&
(sc.atLineEnd || IsASpaceChar(sc.chNext)) ) {
// mark the ';' that ends a word
sc.SetState(SCE_FORTH_DEFWORD);
sc.ForwardSetState(SCE_FORTH_DEFAULT);
}
} }
break;
case SCE_FORTH_COMMENT_ML:
if( ch == ')') {
state = SCE_FORTH_DEFAULT;
} else {
styler.ColourTo(i+1,SCE_FORTH_COMMENT_ML);
} }
break; sc.Complete();
case SCE_FORTH_IDENTIFIER:
// stay in CONF_IDENTIFIER state until we find a non-alphanumeric
if( !is_whitespace(ch) ) {
buffer[bufferCount++] = ch;
} else {
state = SCE_FORTH_DEFAULT;
buffer[bufferCount] = '\0';
#ifdef FORTH_DEBUG
fprintf(f_debug,"\nid %s\n",buffer);
#endif
// check if the buffer contains a keyword,
// and highlight it if it is a keyword...
// switch(prev_state)
// case SCE_FORTH_DEFAULT:
if(control.InList(buffer)) {
styler.ColourTo(i,SCE_FORTH_CONTROL);
} else if(keyword.InList(buffer)) {
styler.ColourTo(i-1,SCE_FORTH_KEYWORD );
} else if(defword.InList(buffer)) {
styler.ColourTo(i-1,SCE_FORTH_DEFWORD );
// prev_state=SCE_FORTH_DEFWORD
} else if(preword1.InList(buffer)) {
styler.ColourTo(i-1,SCE_FORTH_PREWORD1 );
// state=SCE_FORTH_PREWORD1;
} else if(preword2.InList(buffer)) {
styler.ColourTo(i-1,SCE_FORTH_PREWORD2 );
} else {
styler.ColourTo(i-1,SCE_FORTH_DEFAULT);
}
// break;
// case
// push back the faulty character
chNext = styler[i--];
}
break;
case SCE_FORTH_NUMBER:
// stay in CONF_NUMBER state until we find a non-numeric
if( isdigit(ch) ) {
buffer[bufferCount++] = ch;
} else {
state = SCE_FORTH_DEFAULT;
buffer[bufferCount] = '\0';
// Colourize here... (normal number)
styler.ColourTo(i-1,SCE_FORTH_NUMBER);
// push back a character
chNext = styler[i--];
}
break;
}
}
#ifdef FORTH_DEBUG
fclose(f_debug);
#endif
delete []buffer;
*/
} }
static void FoldForthDoc(unsigned int, int, int, WordList *[], static void FoldForthDoc(unsigned int, int, int, WordList *[],
@ -349,4 +171,6 @@ static const char * const forthWordLists[] = {
0, 0,
}; };
LexerModule lmForth(SCLEX_FORTH, ColouriseForthDoc, "forth",FoldForthDoc,forthWordLists); LexerModule lmForth(SCLEX_FORTH, ColouriseForthDoc, "forth", FoldForthDoc, forthWordLists);

View File

@ -231,6 +231,7 @@ def RegenerateAll():
# Find all the lexer source code files # Find all the lexer source code files
lexFilePaths = glob.glob(root + "scintilla/src/Lex*.cxx") lexFilePaths = glob.glob(root + "scintilla/src/Lex*.cxx")
sortListInsensitive(lexFilePaths)
lexFiles = [os.path.basename(f)[:-4] for f in lexFilePaths] lexFiles = [os.path.basename(f)[:-4] for f in lexFilePaths]
print(lexFiles) print(lexFiles)
lexerModules = [] lexerModules = []
@ -261,6 +262,7 @@ def RegenerateAll():
otherProps = ["abbrev.properties", "Embedded.properties", "SciTEGlobal.properties", "SciTE.properties"] otherProps = ["abbrev.properties", "Embedded.properties", "SciTEGlobal.properties", "SciTE.properties"]
if os.path.exists(root + "scite"): if os.path.exists(root + "scite"):
propFilePaths = glob.glob(root + "scite/src/*.properties") propFilePaths = glob.glob(root + "scite/src/*.properties")
sortListInsensitive(propFilePaths)
propFiles = [os.path.basename(f) for f in propFilePaths if os.path.basename(f) not in otherProps] propFiles = [os.path.basename(f) for f in propFilePaths if os.path.basename(f) not in otherProps]
sortListInsensitive(propFiles) sortListInsensitive(propFiles)
print(propFiles) print(propFiles)

View File

@ -1147,6 +1147,9 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
} }
if (ch != '#' && !(isascii(ch) && isalnum(ch)) // Should check that '#' follows '&', but it is unlikely anyway... if (ch != '#' && !(isascii(ch) && isalnum(ch)) // Should check that '#' follows '&', but it is unlikely anyway...
&& ch != '.' && ch != '-' && ch != '_' && ch != ':') { // valid in XML && ch != '.' && ch != '-' && ch != '_' && ch != ':') { // valid in XML
if (!isascii(ch)) // Possibly start of a multibyte character so don't allow this byte to be in entity style
styler.ColourTo(i-1, SCE_H_TAGUNKNOWN);
else
styler.ColourTo(i, SCE_H_TAGUNKNOWN); styler.ColourTo(i, SCE_H_TAGUNKNOWN);
state = SCE_H_DEFAULT; state = SCE_H_DEFAULT;
} }
@ -1912,299 +1915,6 @@ static void ColouriseHTMLDoc(unsigned int startPos, int length, int initStyle, W
ColouriseHyperTextDoc(startPos, length, initStyle, keywordlists, styler, false); ColouriseHyperTextDoc(startPos, length, initStyle, keywordlists, styler, false);
} }
static bool isASPScript(int state) {
return
(state >= SCE_HJA_START && state <= SCE_HJA_REGEX) ||
(state >= SCE_HBA_START && state <= SCE_HBA_STRINGEOL) ||
(state >= SCE_HPA_DEFAULT && state <= SCE_HPA_IDENTIFIER);
}
static void ColouriseHBAPiece(StyleContext &sc, WordList *keywordlists[]) {
WordList &keywordsVBS = *keywordlists[2];
if (sc.state == SCE_HBA_WORD) {
if (!IsAWordChar(sc.ch)) {
char s[100];
sc.GetCurrentLowered(s, sizeof(s));
if (keywordsVBS.InList(s)) {
if (strcmp(s, "rem") == 0) {
sc.ChangeState(SCE_HBA_COMMENTLINE);
if (sc.atLineEnd) {
sc.SetState(SCE_HBA_DEFAULT);
}
} else {
sc.SetState(SCE_HBA_DEFAULT);
}
} else {
sc.ChangeState(SCE_HBA_IDENTIFIER);
sc.SetState(SCE_HBA_DEFAULT);
}
}
} else if (sc.state == SCE_HBA_NUMBER) {
if (!IsAWordChar(sc.ch)) {
sc.SetState(SCE_HBA_DEFAULT);
}
} else if (sc.state == SCE_HBA_STRING) {
if (sc.ch == '\"') {
sc.ForwardSetState(SCE_HBA_DEFAULT);
} else if (sc.ch == '\r' || sc.ch == '\n') {
sc.ChangeState(SCE_HBA_STRINGEOL);
sc.ForwardSetState(SCE_HBA_DEFAULT);
}
} else if (sc.state == SCE_HBA_COMMENTLINE) {
if (sc.ch == '\r' || sc.ch == '\n') {
sc.SetState(SCE_HBA_DEFAULT);
}
}
if (sc.state == SCE_HBA_DEFAULT) {
if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
sc.SetState(SCE_HBA_NUMBER);
} else if (IsAWordStart(sc.ch)) {
sc.SetState(SCE_HBA_WORD);
} else if (sc.ch == '\'') {
sc.SetState(SCE_HBA_COMMENTLINE);
} else if (sc.ch == '\"') {
sc.SetState(SCE_HBA_STRING);
}
}
}
static void ColouriseHTMLPiece(StyleContext &sc, WordList *keywordlists[]) {
WordList &keywordsTags = *keywordlists[0];
if (sc.state == SCE_H_COMMENT) {
if (sc.Match("-->")) {
sc.Forward();
sc.Forward();
sc.ForwardSetState(SCE_H_DEFAULT);
}
} else if (sc.state == SCE_H_ENTITY) {
if (sc.ch == ';') {
sc.ForwardSetState(SCE_H_DEFAULT);
} else if (sc.ch != '#' && (sc.ch < 0x80) && !isalnum(sc.ch) // Should check that '#' follows '&', but it is unlikely anyway...
&& sc.ch != '.' && sc.ch != '-' && sc.ch != '_' && sc.ch != ':') { // valid in XML
sc.ChangeState(SCE_H_TAGUNKNOWN);
sc.SetState(SCE_H_DEFAULT);
}
} else if (sc.state == SCE_H_TAGUNKNOWN) {
if (!ishtmlwordchar(sc.ch) && !((sc.ch == '/') && (sc.chPrev == '<')) && sc.ch != '[') {
char s[100];
sc.GetCurrentLowered(s, sizeof(s));
if (s[1] == '/') {
if (keywordsTags.InList(s + 2)) {
sc.ChangeState(SCE_H_TAG);
}
} else {
if (keywordsTags.InList(s + 1)) {
sc.ChangeState(SCE_H_TAG);
}
}
if (sc.ch == '>') {
sc.ForwardSetState(SCE_H_DEFAULT);
} else if (sc.Match('/', '>')) {
sc.SetState(SCE_H_TAGEND);
sc.Forward();
sc.ForwardSetState(SCE_H_DEFAULT);
} else {
sc.SetState(SCE_H_OTHER);
}
}
} else if (sc.state == SCE_H_ATTRIBUTE) {
if (!ishtmlwordchar(sc.ch)) {
char s[100];
sc.GetCurrentLowered(s, sizeof(s));
if (!keywordsTags.InList(s)) {
sc.ChangeState(SCE_H_ATTRIBUTEUNKNOWN);
}
sc.SetState(SCE_H_OTHER);
}
} else if (sc.state == SCE_H_OTHER) {
if (sc.ch == '>') {
sc.SetState(SCE_H_TAG);
sc.ForwardSetState(SCE_H_DEFAULT);
} else if (sc.Match('/', '>')) {
sc.SetState(SCE_H_TAG);
sc.Forward();
sc.ForwardSetState(SCE_H_DEFAULT);
} else if (sc.chPrev == '=') {
sc.SetState(SCE_H_VALUE);
}
} else if (sc.state == SCE_H_DOUBLESTRING) {
if (sc.ch == '\"') {
sc.ForwardSetState(SCE_H_OTHER);
}
} else if (sc.state == SCE_H_SINGLESTRING) {
if (sc.ch == '\'') {
sc.ForwardSetState(SCE_H_OTHER);
}
} else if (sc.state == SCE_H_NUMBER) {
if (!IsADigit(sc.ch)) {
sc.SetState(SCE_H_OTHER);
}
}
if (sc.state == SCE_H_DEFAULT) {
if (sc.ch == '<') {
if (sc.Match("<!--"))
sc.SetState(SCE_H_COMMENT);
else
sc.SetState(SCE_H_TAGUNKNOWN);
} else if (sc.ch == '&') {
sc.SetState(SCE_H_ENTITY);
}
} else if ((sc.state == SCE_H_OTHER) || (sc.state == SCE_H_VALUE)) {
if (sc.ch == '\"' && sc.chPrev == '=') {
sc.SetState(SCE_H_DOUBLESTRING);
} else if (sc.ch == '\'' && sc.chPrev == '=') {
sc.SetState(SCE_H_SINGLESTRING);
} else if (IsADigit(sc.ch)) {
sc.SetState(SCE_H_NUMBER);
} else if (sc.ch == '>') {
sc.SetState(SCE_H_TAG);
sc.ForwardSetState(SCE_H_DEFAULT);
} else if (ishtmlwordchar(sc.ch)) {
sc.SetState(SCE_H_ATTRIBUTE);
}
}
}
static void ColouriseASPPiece(StyleContext &sc, WordList *keywordlists[]) {
// Possibly exit current state to either SCE_H_DEFAULT or SCE_HBA_DEFAULT
if ((sc.state == SCE_H_ASPAT || isASPScript(sc.state)) && sc.Match('%', '>')) {
sc.SetState(SCE_H_ASP);
sc.Forward();
sc.ForwardSetState(SCE_H_DEFAULT);
}
// Handle some ASP script
if (sc.state >= SCE_HBA_START && sc.state <= SCE_HBA_STRINGEOL) {
ColouriseHBAPiece(sc, keywordlists);
} else if (sc.state >= SCE_H_DEFAULT && sc.state <= SCE_H_SGML_BLOCK_DEFAULT) {
ColouriseHTMLPiece(sc, keywordlists);
}
// Enter new sc.state
if ((sc.state == SCE_H_DEFAULT) || (sc.state == SCE_H_TAGUNKNOWN)) {
if (sc.Match('<', '%')) {
if (sc.state == SCE_H_TAGUNKNOWN)
sc.ChangeState(SCE_H_ASP);
else
sc.SetState(SCE_H_ASP);
sc.Forward();
sc.Forward();
if (sc.ch == '@') {
sc.ForwardSetState(SCE_H_ASPAT);
} else {
if (sc.ch == '=') {
sc.Forward();
}
sc.SetState(SCE_HBA_DEFAULT);
}
}
}
}
static void ColouriseASPDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
Accessor &styler) {
// Lexer for HTML requires more lexical states (8 bits worth) than most lexers
StyleContext sc(startPos, length, initStyle, styler, static_cast<char>(STYLE_MAX));
for (; sc.More(); sc.Forward()) {
ColouriseASPPiece(sc, keywordlists);
}
sc.Complete();
}
static void ColourisePHPPiece(StyleContext &sc, WordList *keywordlists[]) {
// Possibly exit current state to either SCE_H_DEFAULT or SCE_HBA_DEFAULT
if (sc.state >= SCE_HPHP_DEFAULT && sc.state <= SCE_HPHP_OPERATOR) {
if (!isPHPStringState(sc.state) &&
(sc.state != SCE_HPHP_COMMENT) &&
(sc.Match('?', '>'))) {
sc.SetState(SCE_H_QUESTION);
sc.Forward();
sc.ForwardSetState(SCE_H_DEFAULT);
}
}
if (sc.state >= SCE_H_DEFAULT && sc.state <= SCE_H_SGML_BLOCK_DEFAULT) {
ColouriseHTMLPiece(sc, keywordlists);
}
// Handle some PHP script
if (sc.state == SCE_HPHP_WORD) {
if (!IsPhpWordChar(static_cast<char>(sc.ch))) {
sc.SetState(SCE_HPHP_DEFAULT);
}
} else if (sc.state == SCE_HPHP_COMMENTLINE) {
if (sc.ch == '\r' || sc.ch == '\n') {
sc.SetState(SCE_HPHP_DEFAULT);
}
} else if (sc.state == SCE_HPHP_COMMENT) {
if (sc.Match('*', '/')) {
sc.Forward();
sc.Forward();
sc.SetState(SCE_HPHP_DEFAULT);
}
} else if (sc.state == SCE_HPHP_HSTRING) {
if (sc.ch == '\"') {
sc.ForwardSetState(SCE_HPHP_DEFAULT);
}
} else if (sc.state == SCE_HPHP_SIMPLESTRING) {
if (sc.ch == '\'') {
sc.ForwardSetState(SCE_HPHP_DEFAULT);
}
} else if (sc.state == SCE_HPHP_VARIABLE) {
if (!IsPhpWordChar(static_cast<char>(sc.ch))) {
sc.SetState(SCE_HPHP_DEFAULT);
}
} else if (sc.state == SCE_HPHP_OPERATOR) {
sc.SetState(SCE_HPHP_DEFAULT);
}
// Enter new sc.state
if ((sc.state == SCE_H_DEFAULT) || (sc.state == SCE_H_TAGUNKNOWN)) {
if (sc.Match("<?php")) {
sc.SetState(SCE_H_QUESTION);
sc.Forward();
sc.Forward();
sc.Forward();
sc.Forward();
sc.Forward();
sc.SetState(SCE_HPHP_DEFAULT);
}
}
if (sc.state == SCE_HPHP_DEFAULT) {
if (IsPhpWordStart(static_cast<char>(sc.ch))) {
sc.SetState(SCE_HPHP_WORD);
} else if (sc.ch == '#') {
sc.SetState(SCE_HPHP_COMMENTLINE);
} else if (sc.Match("<!--")) {
sc.SetState(SCE_HPHP_COMMENTLINE);
} else if (sc.Match('/', '/')) {
sc.SetState(SCE_HPHP_COMMENTLINE);
} else if (sc.Match('/', '*')) {
sc.SetState(SCE_HPHP_COMMENT);
} else if (sc.ch == '\"') {
sc.SetState(SCE_HPHP_HSTRING);
} else if (sc.ch == '\'') {
sc.SetState(SCE_HPHP_SIMPLESTRING);
} else if (sc.ch == '$' && IsPhpWordStart(static_cast<char>(sc.chNext))) {
sc.SetState(SCE_HPHP_VARIABLE);
} else if (IsOperator(static_cast<char>(sc.ch))) {
sc.SetState(SCE_HPHP_OPERATOR);
}
}
}
static void ColourisePHPDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
Accessor &styler) {
// Lexer for HTML requires more lexical states (8 bits worth) than most lexers
StyleContext sc(startPos, length, initStyle, styler, static_cast<char>(STYLE_MAX));
for (; sc.More(); sc.Forward()) {
ColourisePHPPiece(sc, keywordlists);
}
sc.Complete();
}
static void ColourisePHPScriptDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], static void ColourisePHPScriptDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
Accessor &styler) { Accessor &styler) {
if (startPos == 0) if (startPos == 0)
@ -2234,7 +1944,4 @@ static const char * const phpscriptWordListDesc[] = {
LexerModule lmHTML(SCLEX_HTML, ColouriseHTMLDoc, "hypertext", 0, htmlWordListDesc, 8); LexerModule lmHTML(SCLEX_HTML, ColouriseHTMLDoc, "hypertext", 0, htmlWordListDesc, 8);
LexerModule lmXML(SCLEX_XML, ColouriseXMLDoc, "xml", 0, htmlWordListDesc, 8); LexerModule lmXML(SCLEX_XML, ColouriseXMLDoc, "xml", 0, htmlWordListDesc, 8);
// SCLEX_ASP and SCLEX_PHP should not be used in new code: use SCLEX_HTML instead.
LexerModule lmASP(SCLEX_ASP, ColouriseASPDoc, "asp", 0, htmlWordListDesc, 8);
LexerModule lmPHP(SCLEX_PHP, ColourisePHPDoc, "php", 0, htmlWordListDesc, 8);
LexerModule lmPHPSCRIPT(SCLEX_PHPSCRIPT, ColourisePHPScriptDoc, "phpscript", 0, phpscriptWordListDesc, 8); LexerModule lmPHPSCRIPT(SCLEX_PHPSCRIPT, ColourisePHPScriptDoc, "phpscript", 0, phpscriptWordListDesc, 8);

View File

@ -25,6 +25,7 @@
#include "Platform.h" #include "Platform.h"
#include "PropSet.h" #include "PropSet.h"
#include "PropSetSimple.h"
#include "Accessor.h" #include "Accessor.h"
#include "StyleContext.h" #include "StyleContext.h"
#include "KeyWords.h" #include "KeyWords.h"
@ -225,7 +226,7 @@ static const char* LexerName = "haskell";
void EXT_LEXER_DECL Lex(unsigned int lexer, unsigned int startPos, int length, int initStyle, void EXT_LEXER_DECL Lex(unsigned int lexer, unsigned int startPos, int length, int initStyle,
char *words[], WindowID window, char *props) char *words[], WindowID window, char *props)
{ {
PropSet ps; PropSetSimple ps;
ps.SetMultiple(props); ps.SetMultiple(props);
WindowAccessor wa(window, ps); WindowAccessor wa(window, ps);

View File

@ -13,6 +13,7 @@
#include "Platform.h" #include "Platform.h"
#include "CharClassify.h"
#include "PropSet.h" #include "PropSet.h"
#include "Accessor.h" #include "Accessor.h"
#include "StyleContext.h" #include "StyleContext.h"

View File

@ -32,7 +32,7 @@ using namespace Scintilla;
static inline bool isLispoperator(char ch) { static inline bool isLispoperator(char ch) {
if (isascii(ch) && isalnum(ch)) if (isascii(ch) && isalnum(ch))
return false; return false;
if (ch == '\'' || ch == '`' || ch == '(' || ch == ')' ) if (ch == '\'' || ch == '`' || ch == '(' || ch == ')' || ch == '[' || ch == ']' || ch == '{' || ch == '}')
return true; return true;
return false; return false;
} }
@ -100,6 +100,9 @@ static void ColouriseLispDoc(unsigned int startPos, int length, int initStyle, W
styler.ColourTo(i - 1, state); styler.ColourTo(i - 1, state);
radix = -1; radix = -1;
state = SCE_LISP_MACRO_DISPATCH; state = SCE_LISP_MACRO_DISPATCH;
} else if (ch == ':' && isLispwordstart(chNext)) {
styler.ColourTo(i - 1, state);
state = SCE_LISP_SYMBOL;
} else if (isLispwordstart(ch)) { } else if (isLispwordstart(ch)) {
styler.ColourTo(i - 1, state); styler.ColourTo(i - 1, state);
state = SCE_LISP_IDENTIFIER; state = SCE_LISP_IDENTIFIER;
@ -243,9 +246,9 @@ static void FoldLispDoc(unsigned int startPos, int length, int /* initStyle */,
styleNext = styler.StyleAt(i + 1); styleNext = styler.StyleAt(i + 1);
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
if (style == SCE_LISP_OPERATOR) { if (style == SCE_LISP_OPERATOR) {
if (ch == '(') { if (ch == '(' || ch == '[' || ch == '{') {
levelCurrent++; levelCurrent++;
} else if (ch == ')') { } else if (ch == ')' || ch == ']' || ch == '}') {
levelCurrent--; levelCurrent--;
} }
} }

View File

@ -11,6 +11,9 @@
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
#include <stdlib.h> #include <stdlib.h>
#include <string>
#include "Platform.h" #include "Platform.h"
#include "PropSet.h" #include "PropSet.h"
@ -18,13 +21,12 @@
#include "KeyWords.h" #include "KeyWords.h"
#include "Scintilla.h" #include "Scintilla.h"
#include "SciLexer.h" #include "SciLexer.h"
#include "SString.h"
#ifdef SCI_NAMESPACE #ifdef SCI_NAMESPACE
using namespace Scintilla; using namespace Scintilla;
#endif #endif
static int GetLotLineState(SString &line) { static int GetLotLineState(std::string &line) {
if (line.length()) { if (line.length()) {
// Most of the time the first non-blank character in line determines that line's type // Most of the time the first non-blank character in line determines that line's type
// Now finds the first non-blank character // Now finds the first non-blank character
@ -54,13 +56,13 @@ static int GetLotLineState(SString &line) {
default: // Any other line default: // Any other line
// Checks for message at the end of lot file // Checks for message at the end of lot file
if (line.contains("PASSED")) { if (line.find("PASSED") != std::string::npos) {
return SCE_LOT_PASS; return SCE_LOT_PASS;
} }
else if (line.contains("FAILED")) { else if (line.find("FAILED") != std::string::npos) {
return SCE_LOT_FAIL; return SCE_LOT_FAIL;
} }
else if (line.contains("ABORTED")) { else if (line.find("ABORTED") != std::string::npos) {
return SCE_LOT_ABORT; return SCE_LOT_ABORT;
} }
else { else {
@ -78,8 +80,8 @@ static void ColourizeLotDoc(unsigned int startPos, int length, int, WordList *[]
styler.StartSegment(startPos); styler.StartSegment(startPos);
bool atLineStart = true;// Arms the 'at line start' flag bool atLineStart = true;// Arms the 'at line start' flag
char chNext = styler.SafeGetCharAt(startPos); char chNext = styler.SafeGetCharAt(startPos);
SString line(""); std::string line("");
line.setsizegrowth(256); // Lot lines are less than 256 chars long most of the time. This should avoid reallocations line.reserve(256); // Lot lines are less than 256 chars long most of the time. This should avoid reallocations
// Styles LOT document // Styles LOT document
unsigned int i; // Declared here because it's used after the for loop unsigned int i; // Declared here because it's used after the for loop

View File

@ -62,7 +62,7 @@ static inline bool IsAlphaSym(int ch) {
* \return True if ch is a character, False otherwise * \return True if ch is a character, False otherwise
*/ */
static inline bool IsAlNum(int ch) { static inline bool IsAlNum(int ch) {
return ((ch > '0' && ch < '9') || IsAlpha(ch)); return ((ch >= '0' && ch <= '9') || IsAlpha(ch));
} }
/** /**

View File

@ -1,11 +1,14 @@
// Scintilla source code edit control /**
/** @file LexMySQL.cxx * Scintilla source code edit control
** Lexer for MySQL * @file LexMySQL.cxx
**/ * Lexer for MySQL
// Adopted from LexSQL.cxx by Anders Karlsson <anders@mysql.com> *
// Original work by Neil Hodgson <neilh@scintilla.org> * Improved by Mike Lischke <mike.lischke@sun.com>
// Copyright 1998-2005 by Neil Hodgson <neilh@scintilla.org> * Adopted from LexSQL.cxx by Anders Karlsson <anders@mysql.com>
// The License.txt file describes the conditions under which this software may be distributed. * Original work by Neil Hodgson <neilh@scintilla.org>
* Copyright 1998-2005 by Neil Hodgson <neilh@scintilla.org>
* The License.txt file describes the conditions under which this software may be distributed.
*/
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -49,287 +52,432 @@ static inline bool IsANumberChar(int ch) {
ch == '.' || ch == '-' || ch == '+'); ch == '.' || ch == '-' || ch == '+');
} }
//--------------------------------------------------------------------------------------------------
/**
* Check if the current content context represent a keyword and set the context state if so.
*/
static void CheckForKeyword(StyleContext& sc, WordList* keywordlists[])
{
int length = sc.LengthCurrent() + 1; // +1 for the next char
char* s = new char[length];
sc.GetCurrentLowered(s, length);
if (keywordlists[0]->InList(s))
sc.ChangeState(SCE_MYSQL_MAJORKEYWORD);
else
if (keywordlists[1]->InList(s))
sc.ChangeState(SCE_MYSQL_KEYWORD);
else
if (keywordlists[2]->InList(s))
sc.ChangeState(SCE_MYSQL_DATABASEOBJECT);
else
if (keywordlists[3]->InList(s))
sc.ChangeState(SCE_MYSQL_FUNCTION);
else
if (keywordlists[5]->InList(s))
sc.ChangeState(SCE_MYSQL_PROCEDUREKEYWORD);
else
if (keywordlists[6]->InList(s))
sc.ChangeState(SCE_MYSQL_USER1);
else
if (keywordlists[7]->InList(s))
sc.ChangeState(SCE_MYSQL_USER2);
else
if (keywordlists[8]->InList(s))
sc.ChangeState(SCE_MYSQL_USER3);
delete [] s;
}
//--------------------------------------------------------------------------------------------------
static void ColouriseMySQLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], static void ColouriseMySQLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
Accessor &styler) { Accessor &styler)
{
WordList &major_keywords = *keywordlists[0];
WordList &keywords = *keywordlists[1];
WordList &database_objects = *keywordlists[2];
WordList &functions = *keywordlists[3];
WordList &system_variables = *keywordlists[4];
WordList &procedure_keywords = *keywordlists[5];
WordList &kw_user1 = *keywordlists[6];
WordList &kw_user2 = *keywordlists[7];
WordList &kw_user3 = *keywordlists[8];
StyleContext sc(startPos, length, initStyle, styler); StyleContext sc(startPos, length, initStyle, styler);
for (; sc.More(); sc.Forward()) { for (; sc.More(); sc.Forward())
{
// Determine if the current state should terminate. // Determine if the current state should terminate.
switch (sc.state) { switch (sc.state)
{
case SCE_MYSQL_OPERATOR: case SCE_MYSQL_OPERATOR:
sc.SetState(SCE_MYSQL_DEFAULT); sc.SetState(SCE_MYSQL_DEFAULT);
break; break;
case SCE_MYSQL_NUMBER: case SCE_MYSQL_NUMBER:
// We stop the number definition on non-numerical non-dot non-eE non-sign char // We stop the number definition on non-numerical non-dot non-eE non-sign char.
if (!IsANumberChar(sc.ch)) { if (!IsANumberChar(sc.ch))
sc.SetState(SCE_MYSQL_DEFAULT); sc.SetState(SCE_MYSQL_DEFAULT);
}
break; break;
case SCE_MYSQL_IDENTIFIER: case SCE_MYSQL_IDENTIFIER:
if (!IsAWordChar(sc.ch)) { // Switch from identifier to keyword state and open a new state for the new char.
int nextState = SCE_MYSQL_DEFAULT; if (!IsAWordChar(sc.ch))
char s[1000]; {
sc.GetCurrentLowered(s, sizeof(s)); CheckForKeyword(sc, keywordlists);
if (major_keywords.InList(s)) {
sc.ChangeState(SCE_MYSQL_MAJORKEYWORD); // Additional check for function keywords needed.
} else if (keywords.InList(s)) { // A function name must be followed by an opening parenthesis.
sc.ChangeState(SCE_MYSQL_KEYWORD); if (sc.state == SCE_MYSQL_FUNCTION && sc.ch != '(')
} else if (database_objects.InList(s)) { sc.ChangeState(SCE_MYSQL_DEFAULT);
sc.ChangeState(SCE_MYSQL_DATABASEOBJECT);
} else if (functions.InList(s)) { sc.SetState(SCE_MYSQL_DEFAULT);
sc.ChangeState(SCE_MYSQL_FUNCTION);
} else if (procedure_keywords.InList(s)) {
sc.ChangeState(SCE_MYSQL_PROCEDUREKEYWORD);
} else if (kw_user1.InList(s)) {
sc.ChangeState(SCE_MYSQL_USER1);
} else if (kw_user2.InList(s)) {
sc.ChangeState(SCE_MYSQL_USER2);
} else if (kw_user3.InList(s)) {
sc.ChangeState(SCE_MYSQL_USER3);
}
sc.SetState(nextState);
} }
break; break;
case SCE_MYSQL_VARIABLE: case SCE_MYSQL_VARIABLE:
if (!IsAWordChar(sc.ch)) { if (!IsAWordChar(sc.ch))
sc.SetState(SCE_MYSQL_DEFAULT); sc.SetState(SCE_MYSQL_DEFAULT);
}
break; break;
case SCE_MYSQL_SYSTEMVARIABLE: case SCE_MYSQL_SYSTEMVARIABLE:
if (!IsAWordChar(sc.ch)) { if (!IsAWordChar(sc.ch))
char s[1000]; {
sc.GetCurrentLowered(s, sizeof(s)); int length = sc.LengthCurrent() + 1;
// Check for known system variables here. char* s = new char[length];
if (system_variables.InList(&s[2])) { sc.GetCurrentLowered(s, length);
// Check for known system variables here.
if (keywordlists[4]->InList(&s[2]))
sc.ChangeState(SCE_MYSQL_KNOWNSYSTEMVARIABLE); sc.ChangeState(SCE_MYSQL_KNOWNSYSTEMVARIABLE);
} delete [] s;
sc.SetState(SCE_MYSQL_DEFAULT); sc.SetState(SCE_MYSQL_DEFAULT);
} }
break; break;
case SCE_MYSQL_QUOTEDIDENTIFIER: case SCE_MYSQL_QUOTEDIDENTIFIER:
if (sc.ch == 0x60) { if (sc.ch == '`')
if (sc.chNext == 0x60) { {
if (sc.chNext == '`')
sc.Forward(); // Ignore it sc.Forward(); // Ignore it
} else { else
sc.ForwardSetState(SCE_MYSQL_DEFAULT); sc.ForwardSetState(SCE_MYSQL_DEFAULT);
} }
}
break; break;
case SCE_MYSQL_COMMENT: case SCE_MYSQL_COMMENT:
if (sc.Match('*', '/')) { case SCE_MYSQL_HIDDENCOMMAND:
if (sc.Match('*', '/'))
{
sc.Forward(); sc.Forward();
sc.ForwardSetState(SCE_MYSQL_DEFAULT); sc.ForwardSetState(SCE_MYSQL_DEFAULT);
} }
break; break;
case SCE_MYSQL_COMMENTLINE: case SCE_MYSQL_COMMENTLINE:
if (sc.atLineStart) { if (sc.atLineStart)
sc.SetState(SCE_MYSQL_DEFAULT); sc.SetState(SCE_MYSQL_DEFAULT);
}
break; break;
case SCE_MYSQL_SQSTRING: case SCE_MYSQL_SQSTRING:
if (sc.ch == '\\') { if (sc.ch == '\\')
// Escape sequence sc.Forward(); // Escape sequence
else
if (sc.ch == '\'')
{
// End of single quoted string reached?
if (sc.chNext == '\'')
sc.Forward(); sc.Forward();
} else if (sc.ch == '\'') { else
if (sc.chNext == '\'') {
sc.Forward();
} else {
sc.ChangeState(SCE_MYSQL_STRING);
sc.ForwardSetState(SCE_MYSQL_DEFAULT); sc.ForwardSetState(SCE_MYSQL_DEFAULT);
} }
}
break; break;
case SCE_MYSQL_DQSTRING: case SCE_MYSQL_DQSTRING:
if (sc.ch == '\\') { if (sc.ch == '\\')
// Escape sequence sc.Forward(); // Escape sequence
else
if (sc.ch == '\"')
{
// End of single quoted string reached?
if (sc.chNext == '\"')
sc.Forward(); sc.Forward();
} else if (sc.ch == '\"') { else
if (sc.chNext == '\"') {
sc.Forward();
} else {
sc.ChangeState(SCE_MYSQL_STRING);
sc.ForwardSetState(SCE_MYSQL_DEFAULT); sc.ForwardSetState(SCE_MYSQL_DEFAULT);
} }
}
break; break;
} }
// Determine if a new state should be entered. // Determine if a new state should be entered.
if (sc.state == SCE_MYSQL_DEFAULT) { if (sc.state == SCE_MYSQL_DEFAULT)
if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { {
sc.SetState(SCE_MYSQL_NUMBER); switch (sc.ch)
} else if (IsAWordStart(sc.ch)) { {
sc.SetState(SCE_MYSQL_IDENTIFIER); case '@':
// Note that the order of SYSTEMVARIABLE and VARIABLE is important here. if (sc.chNext == '@')
} else if (sc.ch == 0x40 && sc.chNext == 0x40) { {
sc.SetState(SCE_MYSQL_SYSTEMVARIABLE); sc.SetState(SCE_MYSQL_SYSTEMVARIABLE);
sc.Forward(); // Skip past the second at-sign. sc.Forward(2); // Skip past @@.
} else if (sc.ch == 0x40) { }
else
if (IsAWordStart(sc.ch))
{
sc.SetState(SCE_MYSQL_VARIABLE); sc.SetState(SCE_MYSQL_VARIABLE);
} else if (sc.ch == 0x60) { sc.Forward(); // Skip past @.
}
else
sc.SetState(SCE_MYSQL_OPERATOR);
break;
case '`':
sc.SetState(SCE_MYSQL_QUOTEDIDENTIFIER); sc.SetState(SCE_MYSQL_QUOTEDIDENTIFIER);
} else if (sc.Match('/', '*')) { break;
sc.SetState(SCE_MYSQL_COMMENT); case '#':
sc.Forward(); // Eat the * so it isn't used for the end of the comment
} else if (sc.Match('-', '-') || sc.Match('#')) {
sc.SetState(SCE_MYSQL_COMMENTLINE); sc.SetState(SCE_MYSQL_COMMENTLINE);
} else if (sc.ch == '\'') { break;
case '\'':
sc.SetState(SCE_MYSQL_SQSTRING); sc.SetState(SCE_MYSQL_SQSTRING);
} else if (sc.ch == '\"') { break;
case '\"':
sc.SetState(SCE_MYSQL_DQSTRING); sc.SetState(SCE_MYSQL_DQSTRING);
} else if (isoperator(static_cast<char>(sc.ch))) { break;
default:
if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext)))
sc.SetState(SCE_MYSQL_NUMBER);
else
if (IsAWordStart(sc.ch))
sc.SetState(SCE_MYSQL_IDENTIFIER);
else
if (sc.Match('/', '*'))
{
sc.SetState(SCE_MYSQL_COMMENT);
// Skip comment introducer and check for hidden command.
sc.Forward(2);
if (sc.ch == '!')
{
sc.ChangeState(SCE_MYSQL_HIDDENCOMMAND);
sc.Forward();
}
}
else
if (sc.Match("--"))
{
// Special MySQL single line comment.
sc.SetState(SCE_MYSQL_COMMENTLINE);
sc.Forward(2);
// Check the third character too. It must be a space or EOL.
if (sc.ch != ' ' && sc.ch != '\n' && sc.ch != '\r')
sc.ChangeState(SCE_MYSQL_OPERATOR);
}
else
if (isoperator(static_cast<char>(sc.ch)))
sc.SetState(SCE_MYSQL_OPERATOR); sc.SetState(SCE_MYSQL_OPERATOR);
} }
} }
} }
// Do a final check for keywords if we currently have an identifier, to highlight them
// also at the end of a line.
if (sc.state == SCE_MYSQL_IDENTIFIER)
{
CheckForKeyword(sc, keywordlists);
// Additional check for function keywords needed.
// A function name must be followed by an opening parenthesis.
if (sc.state == SCE_MYSQL_FUNCTION && sc.ch != '(')
sc.ChangeState(SCE_MYSQL_DEFAULT);
}
sc.Complete(); sc.Complete();
} }
static bool IsStreamCommentStyle(int style) { //--------------------------------------------------------------------------------------------------
/**
* Helper function to determine if we have a foldable comment currently.
*/
static bool IsStreamCommentStyle(int style)
{
return style == SCE_MYSQL_COMMENT; return style == SCE_MYSQL_COMMENT;
} }
//--------------------------------------------------------------------------------------------------
/**
* Code copied from StyleContext and modified to work here. Should go into Accessor as a
* companion to Match()...
*/
bool MatchIgnoreCase(Accessor &styler, int currentPos, const char *s)
{
for (int n = 0; *s; n++)
{
if (*s != tolower(styler.SafeGetCharAt(currentPos + n)))
return false;
s++;
}
return true;
}
//--------------------------------------------------------------------------------------------------
// Store both the current line's fold level and the next lines in the // Store both the current line's fold level and the next lines in the
// level store to make it easy to pick up with each increment. // level store to make it easy to pick up with each increment.
static void FoldMySQLDoc(unsigned int startPos, int length, int initStyle, static void FoldMySQLDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler)
WordList *[], Accessor &styler) { {
bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
bool foldOnlyBegin = styler.GetPropertyInt("fold.sql.only.begin", 0) != 0; bool foldOnlyBegin = styler.GetPropertyInt("fold.sql.only.begin", 0) != 0;
unsigned int endPos = startPos + length;
int visibleChars = 0; int visibleChars = 0;
int lineCurrent = styler.GetLine(startPos); int lineCurrent = styler.GetLine(startPos);
int levelCurrent = SC_FOLDLEVELBASE; int levelCurrent = SC_FOLDLEVELBASE;
if (lineCurrent > 0) { if (lineCurrent > 0)
levelCurrent = styler.LevelAt(lineCurrent - 1) >> 16; levelCurrent = styler.LevelAt(lineCurrent - 1) >> 16;
}
int levelNext = levelCurrent; int levelNext = levelCurrent;
char chNext = styler[startPos];
int styleNext = styler.StyleAt(startPos); int styleNext = styler.StyleAt(startPos);
int style = initStyle; int style = initStyle;
bool endFound = false; bool endFound = false;
bool whenFound = false; bool whenFound = false;
bool elseFound = false; bool elseFound = false;
for (unsigned int i = startPos; i < endPos; i++) {
char ch = chNext; char nextChar = styler.SafeGetCharAt(startPos);
chNext = styler.SafeGetCharAt(i + 1); for (unsigned int i = startPos; length > 0; i++, length--)
{
int stylePrev = style; int stylePrev = style;
style = styleNext; style = styleNext;
styleNext = styler.StyleAt(i + 1); styleNext = styler.StyleAt(i + 1);
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
if (foldComment && IsStreamCommentStyle(style)) { char currentChar = nextChar;
if (!IsStreamCommentStyle(stylePrev)) { nextChar = styler.SafeGetCharAt(i + 1);
bool atEOL = (currentChar == '\r' && nextChar != '\n') || (currentChar == '\n');
switch (style)
{
case SCE_MYSQL_COMMENT:
if (foldComment)
{
// Multiline comment style /* .. */.
if (IsStreamCommentStyle(style))
{
// Increase level if we just start a foldable comment.
if (!IsStreamCommentStyle(stylePrev))
levelNext++; levelNext++;
} else if (!IsStreamCommentStyle(styleNext) && !atEOL) { else
// Comments don't end at end of line and the next character may be unstyled. // If we are in the middle of a foldable comment check if it ends now.
// Don't end at the line end, though.
if (!IsStreamCommentStyle(styleNext) && !atEOL)
levelNext--; levelNext--;
} }
} }
if (foldComment && (style == SCE_MYSQL_COMMENTLINE)) { break;
case SCE_MYSQL_COMMENTLINE:
if (foldComment)
{
// Not really a standard, but we add support for single line comments
// with special curly braces syntax as foldable comments too.
// MySQL needs -- comments to be followed by space or control char // MySQL needs -- comments to be followed by space or control char
if ((ch == '-') && (chNext == '-')) { if (styler.Match(startPos, "--"))
{
char chNext2 = styler.SafeGetCharAt(i + 2); char chNext2 = styler.SafeGetCharAt(i + 2);
char chNext3 = styler.SafeGetCharAt(i + 3); char chNext3 = styler.SafeGetCharAt(i + 3);
if (chNext2 == '{' || chNext3 == '{') { if (chNext2 == '{' || chNext3 == '{')
levelNext++; levelNext++;
} else if (chNext2 == '}' || chNext3 == '}') { else
if (chNext2 == '}' || chNext3 == '}')
levelNext--; levelNext--;
} }
} }
}
if (style == SCE_MYSQL_OPERATOR) {
if (ch == '(') {
levelNext++;
} else if (ch == ')') {
levelNext--;
}
}
// Style new keywords here.
if ((style == SCE_MYSQL_MAJORKEYWORD && stylePrev != SCE_MYSQL_MAJORKEYWORD)
|| (style == SCE_MYSQL_KEYWORD && stylePrev != SCE_MYSQL_KEYWORD)
|| (style == SCE_MYSQL_PROCEDUREKEYWORD && stylePrev != SCE_MYSQL_PROCEDUREKEYWORD)) {
const int MAX_KW_LEN = 6; // Maximum length of folding keywords
char s[MAX_KW_LEN + 2];
unsigned int j = 0;
for (; j < MAX_KW_LEN + 1; j++) {
if (!iswordchar(styler[i + j])) {
break; break;
} case SCE_MYSQL_HIDDENCOMMAND:
s[j] = static_cast<char>(tolower(styler[i + j])); if (style != stylePrev)
} levelNext++;
if (j == MAX_KW_LEN + 1) { else
// Keyword too long, don't test it if (style != styleNext)
s[0] = '\0'; levelNext--;
} else { break;
s[j] = '\0'; case SCE_MYSQL_OPERATOR:
} if (currentChar == '(')
if (!foldOnlyBegin && endFound && (strcmp(s, "if") == 0 || strcmp(s, "while") == 0 || strcmp(s, "loop") == 0)) { levelNext++;
else
if (currentChar == ')')
levelNext--;
break;
case SCE_MYSQL_MAJORKEYWORD:
case SCE_MYSQL_KEYWORD:
case SCE_MYSQL_FUNCTION:
case SCE_MYSQL_PROCEDUREKEYWORD:
// Reserved and other keywords.
if (style != stylePrev)
{
bool beginFound = MatchIgnoreCase(styler, startPos, "begin");
bool ifFound = MatchIgnoreCase(styler, startPos, "if");
bool thenFound = MatchIgnoreCase(styler, startPos, "then");
bool whileFound = MatchIgnoreCase(styler, startPos, "while");
bool loopFound = MatchIgnoreCase(styler, startPos, "loop");
bool repeatFound = MatchIgnoreCase(styler, startPos, "repeat");
if (!foldOnlyBegin && endFound && (ifFound || whileFound || loopFound))
{
endFound = false; endFound = false;
levelNext--; levelNext--;
if (levelNext < SC_FOLDLEVELBASE) { if (levelNext < SC_FOLDLEVELBASE)
levelNext = SC_FOLDLEVELBASE; levelNext = SC_FOLDLEVELBASE;
// Note that "else" is special here. It may or may not be followed by an "if .. then",
// but in any case the level stays the same. When followed by an "if .. then" the level
// will be increased later, if not, then at eol.
} }
// Note that else is special here. It may or may be followed by an if then, but in aly case the level stays the else
// same. When followed by a if .. then, the level will be increased later, if not, at eol. if (!foldOnlyBegin && MatchIgnoreCase(styler, startPos, "else"))
} else if (!foldOnlyBegin && strcmp(s, "else") == 0) { {
levelNext--; levelNext--;
elseFound = true; elseFound = true;
} else if (!foldOnlyBegin && strcmp(s, "then") == 0) { }
if(whenFound) { else
if (!foldOnlyBegin && thenFound)
{
if (whenFound)
whenFound = false; whenFound = false;
} else { else
levelNext++; levelNext++;
} }
} else if (strcmp(s, "if") == 0) { else
if (ifFound)
elseFound = false; elseFound = false;
} else if (strcmp(s, "when") == 0) { else
if (MatchIgnoreCase(styler, startPos, "when"))
whenFound = true; whenFound = true;
} else if (strcmp(s, "begin") == 0) { else
{
if (beginFound)
levelNext++; levelNext++;
} else if (!foldOnlyBegin && (strcmp(s, "loop") == 0 || strcmp(s, "repeat") == 0 else
|| strcmp(s, "while") == 0)) { if (!foldOnlyBegin && (loopFound || repeatFound || whileFound))
if(endFound) { {
if (endFound)
endFound = false; endFound = false;
} else { else
levelNext++; levelNext++;
} }
} else if (strcmp(s, "end") == 0) { else
// Multiple END in a row are counted multiple times! if (MatchIgnoreCase(styler, startPos, "end"))
if (endFound) { {
// Multiple "end" in a row are counted multiple times!
if (endFound)
{
levelNext--; levelNext--;
if (levelNext < SC_FOLDLEVELBASE) { if (levelNext < SC_FOLDLEVELBASE)
levelNext = SC_FOLDLEVELBASE; levelNext = SC_FOLDLEVELBASE;
} }
}
endFound = true; endFound = true;
whenFound = false; whenFound = false;
} }
} }
// Handle this for a trailing end withiut an if / while etc, as in the case of a begin. }
if (endFound) { break;
}
// Handle the case of a trailing end without an if / while etc, as in the case of a begin.
if (endFound)
{
endFound = false; endFound = false;
levelNext--; levelNext--;
if (levelNext < SC_FOLDLEVELBASE) { if (levelNext < SC_FOLDLEVELBASE)
levelNext = SC_FOLDLEVELBASE; levelNext = SC_FOLDLEVELBASE;
} }
}
if (atEOL) { if (atEOL)
if(elseFound) {
if (elseFound)
{
levelNext++; levelNext++;
elseFound = false; elseFound = false;
}
int levelUse = levelCurrent; int levelUse = levelCurrent;
int lev = levelUse | levelNext << 16; int lev = levelUse | levelNext << 16;
@ -337,21 +485,23 @@ static void FoldMySQLDoc(unsigned int startPos, int length, int initStyle,
lev |= SC_FOLDLEVELWHITEFLAG; lev |= SC_FOLDLEVELWHITEFLAG;
if (levelUse < levelNext) if (levelUse < levelNext)
lev |= SC_FOLDLEVELHEADERFLAG; lev |= SC_FOLDLEVELHEADERFLAG;
if (lev != styler.LevelAt(lineCurrent)) { if (lev != styler.LevelAt(lineCurrent))
styler.SetLevel(lineCurrent, lev); styler.SetLevel(lineCurrent, lev);
}
lineCurrent++; lineCurrent++;
levelCurrent = levelNext; levelCurrent = levelNext;
visibleChars = 0; visibleChars = 0;
endFound = false; endFound = false;
whenFound = false; whenFound = false;
} }
if (!isspacechar(ch)) {
if (!isspacechar(currentChar))
visibleChars++; visibleChars++;
} }
}
} }
//--------------------------------------------------------------------------------------------------
static const char * const mysqlWordListDesc[] = { static const char * const mysqlWordListDesc[] = {
"Major Keywords", "Major Keywords",
"Keywords", "Keywords",
@ -361,7 +511,8 @@ static const char * const mysqlWordListDesc[] = {
"Procedure keywords", "Procedure keywords",
"User Keywords 1", "User Keywords 1",
"User Keywords 2", "User Keywords 2",
"User Keywords 3" "User Keywords 3",
0
}; };
LexerModule lmMySQL(SCLEX_MYSQL, ColouriseMySQLDoc, "mysql", FoldMySQLDoc, mysqlWordListDesc); LexerModule lmMySQL(SCLEX_MYSQL, ColouriseMySQLDoc, "mysql", FoldMySQLDoc, mysqlWordListDesc);

View File

@ -13,6 +13,7 @@
#include "Platform.h" #include "Platform.h"
#include "CharClassify.h"
#include "PropSet.h" #include "PropSet.h"
#include "Accessor.h" #include "Accessor.h"
#include "KeyWords.h" #include "KeyWords.h"

View File

@ -424,9 +424,9 @@ static bool IsCommentLine(int line, Accessor &styler) {
return true; return true;
} }
static void FoldBoxObjCDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
Accessor &styler) {
static void FoldObjCDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
Accessor &styler) {
WordList &keywords4 = *keywordlists[3]; WordList &keywords4 = *keywordlists[3];
bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
@ -439,7 +439,6 @@ static void FoldBoxObjCDoc(unsigned int startPos, int length, int initStyle, Wor
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
int levelCurrent = levelPrev; int levelCurrent = levelPrev;
int levelPrevPrev; int levelPrevPrev;
int levelFlags = 0;
int levelUnindent = 0; int levelUnindent = 0;
char chNext = styler[startPos]; char chNext = styler[startPos];
int styleNext = styler.StyleAt(startPos); int styleNext = styler.StyleAt(startPos);
@ -468,18 +467,6 @@ static void FoldBoxObjCDoc(unsigned int startPos, int length, int initStyle, Wor
levelCurrent--; levelCurrent--;
} }
} }
/*
if (foldComment && (style == SCE_C_COMMENTLINE)) {
if ((ch == '/') && (chNext == '/')) {
char chNext2 = styler.SafeGetCharAt(i + 2);
if (chNext2 == '{') {
levelCurrent++;
} else if (chNext2 == '}') {
levelCurrent--;
}
}
}
*/
if (foldPreprocessor && (style == SCE_C_PREPROCESSOR)) { if (foldPreprocessor && (style == SCE_C_PREPROCESSOR)) {
if (ch == '#') { if (ch == '#') {
unsigned int j = i + 1; unsigned int j = i + 1;
@ -533,40 +520,28 @@ static void FoldBoxObjCDoc(unsigned int startPos, int length, int initStyle, Wor
/* Check for fold header keyword at beginning of word */ /* Check for fold header keyword at beginning of word */
if ((style == SCE_C_WORD || style == SCE_C_COMMENT || style == SCE_C_COMMENTLINE) if ((style == SCE_C_WORD || style == SCE_C_COMMENT || style == SCE_C_COMMENTLINE)
&& && (style != stylePrev)) {
(style != stylePrev)) {
if (matchKeyword(i, keywords4, styler, KEYWORD_BOXHEADER)) { if (matchKeyword(i, keywords4, styler, KEYWORD_BOXHEADER)) {
int line; int line;
/* Loop backwards all empty or comment lines */ // Loop backwards all empty or comment lines
for (line = lineCurrent - 1; for (line = lineCurrent - 1;
line >= 0 line >= 0
&& &&
levelCurrent == (styler.LevelAt(line) & SC_FOLDLEVELNUMBERMASK) levelCurrent == (styler.LevelAt(line) & SC_FOLDLEVELNUMBERMASK)
&& &&
(styler.LevelAt(line) & SC_FOLDLEVELBOXFOOTERFLAG) == 0
&&
IsCommentLine(line, styler); IsCommentLine(line, styler);
line--) { line--) {
/* just loop backwards */; // just loop backwards;
} }
line++; line++;
/* Set Box header flag (if the previous line has no footer line) */
if ((styler.LevelAt(line) & SC_FOLDLEVELBOXFOOTERFLAG) == 0) {
if (line == lineCurrent) { if (line == lineCurrent) {
/* in current line */ // in current line
levelFlags |= SC_FOLDLEVELBOXHEADERFLAG;
} else { } else {
/* at top of all preceding comment lines */ // at top of all preceding comment lines
styler.SetLevel(line, styler.LevelAt(line) styler.SetLevel(line, styler.LevelAt(line));
| SC_FOLDLEVELBOXHEADERFLAG);
}
}
}
} }
if (matchKeyword(i, keywords4, styler, KEYWORD_FOLDCONTRACTED)) { }
levelFlags |= SC_FOLDLEVELCONTRACTED;
} }
if (atEOL) { if (atEOL) {
@ -581,32 +556,15 @@ static void FoldBoxObjCDoc(unsigned int startPos, int length, int initStyle, Wor
lev = levelPrev; lev = levelPrev;
if (visibleChars == 0 && foldCompact) if (visibleChars == 0 && foldCompact)
lev |= SC_FOLDLEVELWHITEFLAG; lev |= SC_FOLDLEVELWHITEFLAG;
// Produce additional footer line (e.g. after closed if)
if (visibleChars == 0
&&
(levelPrev < levelPrevPrev))
lev |= SC_FOLDLEVELBOXFOOTERFLAG;
// Produce footer line at line before (special handling for '} else {' // Produce footer line at line before (special handling for '} else {'
if (levelPrev < levelPrevPrev) { if (levelPrev < levelPrevPrev) {
styler.SetLevel(lineCurrent - 1, styler.SetLevel(lineCurrent - 1, styler.LevelAt(lineCurrent - 1));
styler.LevelAt(lineCurrent - 1) | SC_FOLDLEVELBOXFOOTERFLAG);
} }
// Mark the fold header (the line that is always visible) // Mark the fold header (the line that is always visible)
if ((levelCurrent > levelPrev) && (visibleChars > 0)) if ((levelCurrent > levelPrev) && (visibleChars > 0))
lev |= SC_FOLDLEVELHEADERFLAG; lev |= SC_FOLDLEVELHEADERFLAG;
// Show a footer line at end of fold
if (levelCurrent < levelPrev)
lev |= SC_FOLDLEVELBOXFOOTERFLAG;
/* Show a footer line at the end of each procedure (level == SC_FOLDLEVELBASE) */
if ((levelPrev == SC_FOLDLEVELBASE)
&&
(levelPrevPrev > SC_FOLDLEVELBASE)
&&
(visibleChars == 0)) {
lev |= SC_FOLDLEVELBOXFOOTERFLAG;
}
lev |= levelFlags;
if (lev != styler.LevelAt(lineCurrent)) { if (lev != styler.LevelAt(lineCurrent)) {
styler.SetLevel(lineCurrent, lev); styler.SetLevel(lineCurrent, lev);
} }
@ -616,7 +574,6 @@ static void FoldBoxObjCDoc(unsigned int startPos, int length, int initStyle, Wor
levelPrev = levelCurrent; levelPrev = levelCurrent;
levelUnindent = 0; levelUnindent = 0;
visibleChars = 0; visibleChars = 0;
levelFlags = 0;
firstLine = false; firstLine = false;
} }
@ -628,115 +585,6 @@ static void FoldBoxObjCDoc(unsigned int startPos, int length, int initStyle, Wor
styler.SetLevel(lineCurrent, levelPrev | flagsNext); styler.SetLevel(lineCurrent, levelPrev | flagsNext);
} }
static void FoldNoBoxObjCDoc(unsigned int startPos, int length, int initStyle,
Accessor &styler) {
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
bool foldPreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0;
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
unsigned int endPos = startPos + length;
int visibleChars = 0;
int lineCurrent = styler.GetLine(startPos);
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
int levelCurrent = levelPrev;
char chNext = styler[startPos];
int styleNext = styler.StyleAt(startPos);
int style = initStyle;
for (unsigned int i = startPos; i < endPos; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
int stylePrev = style;
style = styleNext;
styleNext = styler.StyleAt(i + 1);
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
if (foldComment && IsStreamCommentStyle(style)) {
if (!IsStreamCommentStyle(stylePrev)) {
levelCurrent++;
} else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
// Comments don't end at end of line and the next character may be unstyled.
levelCurrent--;
}
}
/*if (foldComment && (style == SCE_C_COMMENTLINE)) {
if ((ch == '/') && (chNext == '/')) {
char chNext2 = styler.SafeGetCharAt(i + 2);
if (chNext2 == '{') {
levelCurrent++;
} else if (chNext2 == '}') {
levelCurrent--;
}
}
}*/
if (foldPreprocessor && (style == SCE_C_PREPROCESSOR)) {
if (ch == '#') {
unsigned int j = i + 1;
while ((j < endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) {
j++;
}
if (styler.Match(j, "region") || styler.Match(j, "if")) {
levelCurrent++;
} else if (styler.Match(j, "end")) {
levelCurrent--;
}
}
}
if (style == SCE_C_OPERATOR) {
if (ch == '{') {
levelCurrent++;
} else if (ch == '}') {
levelCurrent--;
}
}
if (style == SCE_OBJC_DIRECTIVE)
{
if (ch == '@')
{
unsigned int j = i + 1;
if (styler.Match(j, "interface") || styler.Match(j, "implementation") || styler.Match(j, "protocol"))
{
levelCurrent++;
}
else if (styler.Match(j, "end"))
{
levelCurrent--;
}
}
}
if (atEOL) {
int lev = levelPrev;
if (visibleChars == 0 && foldCompact)
lev |= SC_FOLDLEVELWHITEFLAG;
if ((levelCurrent > levelPrev) && (visibleChars > 0))
lev |= SC_FOLDLEVELHEADERFLAG;
if (lev != styler.LevelAt(lineCurrent)) {
styler.SetLevel(lineCurrent, lev);
}
lineCurrent++;
levelPrev = levelCurrent;
visibleChars = 0;
}
if (!isspacechar(ch))
visibleChars++;
}
// Fill in the real level of the next line, keeping the current flags as they will be filled in later
int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
}
static void FoldObjCDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
Accessor &styler) {
int foldFlags = styler.GetPropertyInt("fold.flags") ;
bool foldBox = ((foldFlags & SC_FOLDFLAG_BOX) == SC_FOLDFLAG_BOX);
if (foldBox) {
FoldBoxObjCDoc(startPos, length, initStyle, keywordlists, styler);
} else {
FoldNoBoxObjCDoc(startPos, length, initStyle, styler);
}
}
static const char * const cppWordLists[] = { static const char * const cppWordLists[] = {
"Primary keywords and identifiers", "Primary keywords and identifiers",
"Secondary keywords and identifiers", "Secondary keywords and identifiers",
@ -750,12 +598,4 @@ static void ColouriseObjCDocSensitive(unsigned int startPos, int length, int ini
ColouriseObjCDoc(startPos, length, initStyle, keywordlists, styler, true); ColouriseObjCDoc(startPos, length, initStyle, keywordlists, styler, true);
} }
/*
static void ColouriseCppDocInsensitive(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
Accessor &styler) {
ColouriseCppDoc(startPos, length, initStyle, keywordlists, styler, false);
}
*/
LexerModule lmObjC(SCLEX_OBJC, ColouriseObjCDocSensitive, "cpp", FoldObjCDoc, cppWordLists); LexerModule lmObjC(SCLEX_OBJC, ColouriseObjCDocSensitive, "cpp", FoldObjCDoc, cppWordLists);
//LexerModule lmCPPNoCase(SCLEX_CPPNOCASE, ColouriseCppDocInsensitive, "cppnocase", FoldCppDoc, cppWordLists);
//LexerModule lmTCL(SCLEX_TCL, ColouriseCppDocSensitive, "tcl", FoldCppDoc, cppWordLists);

View File

@ -14,6 +14,7 @@
#include "Platform.h" #include "Platform.h"
#include "CharClassify.h"
#include "PropSet.h" #include "PropSet.h"
#include "Accessor.h" #include "Accessor.h"
#include "KeyWords.h" #include "KeyWords.h"
@ -213,6 +214,7 @@ static void ColouriseBatchLine(
// No need to Reset Offset // No need to Reset Offset
// Check for Special Keyword in list, External Command / Program, or Default Text // Check for Special Keyword in list, External Command / Program, or Default Text
} else if ((wordBuffer[0] != '%') && } else if ((wordBuffer[0] != '%') &&
(wordBuffer[0] != '!') &&
(!IsBOperator(wordBuffer[0])) && (!IsBOperator(wordBuffer[0])) &&
(continueProcessing)) { (continueProcessing)) {
// Check for Special Keyword // Check for Special Keyword
@ -249,6 +251,7 @@ static void ColouriseBatchLine(
// Read up to %, Operator or Separator // Read up to %, Operator or Separator
while ((wbo < wbl) && while ((wbo < wbl) &&
(wordBuffer[wbo] != '%') && (wordBuffer[wbo] != '%') &&
(wordBuffer[wbo] != '!') &&
(!IsBOperator(wordBuffer[wbo])) && (!IsBOperator(wordBuffer[wbo])) &&
(!IsBSeparator(wordBuffer[wbo]))) { (!IsBSeparator(wordBuffer[wbo]))) {
wbo++; wbo++;
@ -298,6 +301,7 @@ static void ColouriseBatchLine(
// Read up to %, Operator or Separator // Read up to %, Operator or Separator
while ((wbo < wbl) && while ((wbo < wbl) &&
(wordBuffer[wbo] != '%') && (wordBuffer[wbo] != '%') &&
(wordBuffer[wbo] != '!') &&
(!IsBOperator(wordBuffer[wbo])) && (!IsBOperator(wordBuffer[wbo])) &&
(!IsBSeparator(wordBuffer[wbo]))) { (!IsBSeparator(wordBuffer[wbo]))) {
wbo++; wbo++;
@ -370,6 +374,29 @@ static void ColouriseBatchLine(
// Reset Offset to re-process remainder of word // Reset Offset to re-process remainder of word
offset -= (wbl - 3); offset -= (wbl - 3);
} }
// Check for Environment Variable (!x...!)
} else if (wordBuffer[0] == '!') {
// Colorize Default Text
styler.ColourTo(startLine + offset - 1 - wbl, SCE_BAT_DEFAULT);
wbo++;
// Search to end of word for second ! (can be a long path)
while ((wbo < wbl) &&
(wordBuffer[wbo] != '!') &&
(!IsBOperator(wordBuffer[wbo])) &&
(!IsBSeparator(wordBuffer[wbo]))) {
wbo++;
}
if (wordBuffer[wbo] == '!') {
wbo++;
// Check for External Command / Program
if (cmdLoc == offset - wbl) {
cmdLoc = offset - (wbl - wbo);
}
// Colorize Environment Variable
styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_IDENTIFIER);
// Reset Offset to re-process remainder of word
offset -= (wbl - wbo);
}
// Check for Operator // Check for Operator
} else if (IsBOperator(wordBuffer[0])) { } else if (IsBOperator(wordBuffer[0])) {
// Colorize Default Text // Colorize Default Text
@ -417,6 +444,7 @@ static void ColouriseBatchLine(
// Read up to %, Operator or Separator // Read up to %, Operator or Separator
while ((wbo < wbl) && while ((wbo < wbl) &&
(wordBuffer[wbo] != '%') && (wordBuffer[wbo] != '%') &&
(wordBuffer[wbo] != '!') &&
(!IsBOperator(wordBuffer[wbo])) && (!IsBOperator(wordBuffer[wbo])) &&
(!IsBSeparator(wordBuffer[wbo]))) { (!IsBSeparator(wordBuffer[wbo]))) {
wbo++; wbo++;

View File

@ -414,7 +414,7 @@ static unsigned int SkipWhiteSpace(unsigned int currentPos, unsigned int endPos,
} }
static void ClassifyPascalWordFoldPoint(int &levelCurrent, int &lineFoldStateCurrent, static void ClassifyPascalWordFoldPoint(int &levelCurrent, int &lineFoldStateCurrent,
unsigned int startPos, unsigned int endPos, int startPos, unsigned int endPos,
unsigned int lastStart, unsigned int currentPos, Accessor &styler) { unsigned int lastStart, unsigned int currentPos, Accessor &styler) {
char s[100]; char s[100];
GetRangeLowered(lastStart, currentPos, styler, s, sizeof(s)); GetRangeLowered(lastStart, currentPos, styler, s, sizeof(s));
@ -471,7 +471,7 @@ static void ClassifyPascalWordFoldPoint(int &levelCurrent, int &lineFoldStateCur
} else if (strcmp(s, "interface") == 0) { } else if (strcmp(s, "interface") == 0) {
// "interface" keyword requires special handling... // "interface" keyword requires special handling...
bool ignoreKeyword = true; bool ignoreKeyword = true;
unsigned int j = lastStart - 1; int j = lastStart - 1;
char ch = styler.SafeGetCharAt(j); char ch = styler.SafeGetCharAt(j);
while ((j >= startPos) && (IsASpaceOrTab(ch) || ch == '\r' || ch == '\n' || while ((j >= startPos) && (IsASpaceOrTab(ch) || ch == '\r' || ch == '\n' ||
IsStreamCommentStyle(styler.StyleAt(j)))) { IsStreamCommentStyle(styler.StyleAt(j)))) {

View File

@ -963,6 +963,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
bool hereDocSpace = false; // for: SCALAR [whitespace] '<<' bool hereDocSpace = false; // for: SCALAR [whitespace] '<<'
unsigned int bk = (sc.currentPos > 0) ? sc.currentPos - 1: 0; unsigned int bk = (sc.currentPos > 0) ? sc.currentPos - 1: 0;
unsigned int bkend; unsigned int bkend;
sc.Complete();
styler.Flush(); styler.Flush();
if (styler.StyleAt(bk) == SCE_PL_DEFAULT) if (styler.StyleAt(bk) == SCE_PL_DEFAULT)
hereDocSpace = true; hereDocSpace = true;
@ -1142,6 +1143,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
} }
backFlag = BACK_NONE; backFlag = BACK_NONE;
} else if (sc.ch == '(' && sc.currentPos > 0) { // '(' or subroutine prototype } else if (sc.ch == '(' && sc.currentPos > 0) { // '(' or subroutine prototype
sc.Complete();
if (styleCheckSubPrototype(styler, sc.currentPos - 1)) { if (styleCheckSubPrototype(styler, sc.currentPos - 1)) {
sc.SetState(SCE_PL_SUB_PROTOTYPE); sc.SetState(SCE_PL_SUB_PROTOTYPE);
backFlag = BACK_NONE; backFlag = BACK_NONE;

View File

@ -416,6 +416,8 @@ static void FoldPyDoc(unsigned int startPos, int length, int /*initStyle - unuse
// This option enables folding multi-line quoted strings when using the Python lexer. // This option enables folding multi-line quoted strings when using the Python lexer.
const bool foldQuotes = styler.GetPropertyInt("fold.quotes.python") != 0; const bool foldQuotes = styler.GetPropertyInt("fold.quotes.python") != 0;
const bool foldCompact = styler.GetPropertyInt("fold.compact") != 0;
// Backtrack to previous non-blank line so we can determine indent level // Backtrack to previous non-blank line so we can determine indent level
// for any white space lines (needed esp. within triple quoted strings) // for any white space lines (needed esp. within triple quoted strings)
// and so we can fix any preceding fold level (which is why we go back // and so we can fix any preceding fold level (which is why we go back
@ -514,12 +516,21 @@ static void FoldPyDoc(unsigned int startPos, int length, int /*initStyle - unuse
while (--skipLine > lineCurrent) { while (--skipLine > lineCurrent) {
int skipLineIndent = styler.IndentAmount(skipLine, &spaceFlags, NULL); int skipLineIndent = styler.IndentAmount(skipLine, &spaceFlags, NULL);
if (foldCompact) {
if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > levelAfterComments) if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > levelAfterComments)
skipLevel = levelBeforeComments; skipLevel = levelBeforeComments;
int whiteFlag = skipLineIndent & SC_FOLDLEVELWHITEFLAG; int whiteFlag = skipLineIndent & SC_FOLDLEVELWHITEFLAG;
styler.SetLevel(skipLine, skipLevel | whiteFlag); styler.SetLevel(skipLine, skipLevel | whiteFlag);
} else {
if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > levelAfterComments &&
!(skipLineIndent & SC_FOLDLEVELWHITEFLAG) &&
!IsCommentLine(skipLine, styler))
skipLevel = levelBeforeComments;
styler.SetLevel(skipLine, skipLevel);
}
} }
// Set fold header on non-quote/non-comment line // Set fold header on non-quote/non-comment line

View File

@ -3,6 +3,7 @@
** Lexer for SML. ** Lexer for SML.
**/ **/
// Copyright 2009 by James Moffatt and Yuzhou Xin // Copyright 2009 by James Moffatt and Yuzhou Xin
// Modified from LexCaml.cxx by Robert Roessler <robertr@rftp.com> Copyright 2005
// The License.txt file describes the conditions under which this software may be distributed. // The License.txt file describes the conditions under which this software may be distributed.

View File

@ -10,6 +10,8 @@
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <string>
#include "Platform.h" #include "Platform.h"
#include "Accessor.h" #include "Accessor.h"
@ -17,7 +19,6 @@
#include "PropSet.h" #include "PropSet.h"
#include "KeyWords.h" #include "KeyWords.h"
#include "SciLexer.h" #include "SciLexer.h"
#include "SString.h"
#ifdef SCI_NAMESPACE #ifdef SCI_NAMESPACE
using namespace Scintilla; using namespace Scintilla;
@ -75,7 +76,7 @@ static void ColouriseDelimiter(StyleContext& sc, bool& apostropheStartsAttribute
static void ColouriseNumber(StyleContext& sc, bool& apostropheStartsAttribute) { static void ColouriseNumber(StyleContext& sc, bool& apostropheStartsAttribute) {
apostropheStartsAttribute = true; apostropheStartsAttribute = true;
SString number; std::string number;
sc.SetState(SCE_SPICE_NUMBER); sc.SetState(SCE_SPICE_NUMBER);
// Get all characters up to a delimiter or a separator, including points, but excluding // Get all characters up to a delimiter or a separator, including points, but excluding
// double points (ranges). // double points (ranges).
@ -104,7 +105,7 @@ static void ColouriseWhiteSpace(StyleContext& sc, bool& ) {
static void ColouriseWord(StyleContext& sc, WordList& keywords, WordList& keywords2, WordList& keywords3, bool& apostropheStartsAttribute) { static void ColouriseWord(StyleContext& sc, WordList& keywords, WordList& keywords2, WordList& keywords3, bool& apostropheStartsAttribute) {
apostropheStartsAttribute = true; apostropheStartsAttribute = true;
sc.SetState(SCE_SPICE_IDENTIFIER); sc.SetState(SCE_SPICE_IDENTIFIER);
SString word; std::string word;
while (!sc.atLineEnd && !IsSeparatorOrDelimiterCharacter(sc.ch)) { while (!sc.atLineEnd && !IsSeparatorOrDelimiterCharacter(sc.ch)) {
word += static_cast<char>(tolower(sc.ch)); word += static_cast<char>(tolower(sc.ch));
sc.Forward(); sc.Forward();

View File

@ -31,6 +31,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include "KeyWords.h" #include "KeyWords.h"
#include "Scintilla.h" #include "Scintilla.h"
#include "SciLexer.h" #include "SciLexer.h"
#include "CharClassify.h"
#define KEYWORD_BOXHEADER 1 #define KEYWORD_BOXHEADER 1
#define KEYWORD_FOLDCONTRACTED 2 #define KEYWORD_FOLDCONTRACTED 2
@ -55,6 +56,7 @@ static int cmpString(const void *a1, const void *a2) {
static int cmpStringNoCase(const void *a1, const void *a2) { static int cmpStringNoCase(const void *a1, const void *a2) {
// Can't work out the correct incantation to use modern casts here // Can't work out the correct incantation to use modern casts here
return CompareCaseInsensitive(*(char**)(a1), *(char**)(a2)); return CompareCaseInsensitive(*(char**)(a1), *(char**)(a2));
} }

View File

@ -154,7 +154,8 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
rcSmall.bottom = rc.bottom - 2; rcSmall.bottom = rc.bottom - 2;
surface->RectangleDraw(rcSmall, fore.allocated, back.allocated); surface->RectangleDraw(rcSmall, fore.allocated, back.allocated);
} else if (markType == SC_MARK_EMPTY || markType == SC_MARK_BACKGROUND) { } else if (markType == SC_MARK_EMPTY || markType == SC_MARK_BACKGROUND ||
markType == SC_MARK_UNDERLINE || markType == SC_MARK_AVAILABLE) {
// An invisible marker so don't draw anything // An invisible marker so don't draw anything
} else if (markType == SC_MARK_VLINE) { } else if (markType == SC_MARK_VLINE) {

View File

@ -153,7 +153,7 @@ public:
return pos; return pos;
} }
int PartitionFromPosition(int pos) { int PartitionFromPosition(int pos) const {
if (body->Length() <= 1) if (body->Length() <= 1)
return 0; return 0;
if (pos >= (PositionFromPartition(body->Length()-1))) if (pos >= (PositionFromPartition(body->Length()-1)))

View File

@ -125,6 +125,10 @@ void MarkerHandleSet::CombineWith(MarkerHandleSet *other) {
} }
LineMarkers::~LineMarkers() { LineMarkers::~LineMarkers() {
Init();
}
void LineMarkers::Init() {
for (int line = 0; line < markers.Length(); line++) { for (int line = 0; line < markers.Length(); line++) {
delete markers[line]; delete markers[line];
markers[line] = 0; markers[line] = 0;
@ -184,11 +188,14 @@ int LineMarkers::AddMark(int line, int markerNum, int lines) {
// No existing markers so allocate one element per line // No existing markers so allocate one element per line
markers.InsertValue(0, lines, 0); markers.InsertValue(0, lines, 0);
} }
if (line >= markers.Length()) {
return -1;
}
if (!markers[line]) { if (!markers[line]) {
// Need new structure to hold marker handle // Need new structure to hold marker handle
markers[line] = new MarkerHandleSet(); markers[line] = new MarkerHandleSet();
if (!markers[line]) if (!markers[line])
return - 1; return -1;
} }
markers[line]->InsertHandle(handleCurrent, markerNum); markers[line]->InsertHandle(handleCurrent, markerNum);
@ -227,6 +234,10 @@ void LineMarkers::DeleteMarkFromHandle(int markerHandle) {
LineLevels::~LineLevels() { LineLevels::~LineLevels() {
} }
void LineLevels::Init() {
levels.DeleteAll();
}
void LineLevels::InsertLine(int line) { void LineLevels::InsertLine(int line) {
if (levels.Length()) { if (levels.Length()) {
int level = SC_FOLDLEVELBASE; int level = SC_FOLDLEVELBASE;
@ -243,7 +254,9 @@ void LineLevels::RemoveLine(int line) {
// to line before to avoid a temporary disappearence causing expansion. // to line before to avoid a temporary disappearence causing expansion.
int firstHeader = levels[line] & SC_FOLDLEVELHEADERFLAG; int firstHeader = levels[line] & SC_FOLDLEVELHEADERFLAG;
levels.Delete(line); levels.Delete(line);
if (line > 0) if (line == levels.Length()-1) // Last line loses the header flag
levels[line-1] &= ~SC_FOLDLEVELHEADERFLAG;
else if (line > 0)
levels[line-1] |= firstHeader; levels[line-1] |= firstHeader;
} }
} }
@ -281,6 +294,10 @@ int LineLevels::GetLevel(int line) {
LineState::~LineState() { LineState::~LineState() {
} }
void LineState::Init() {
lineStates.DeleteAll();
}
void LineState::InsertLine(int line) { void LineState::InsertLine(int line) {
if (lineStates.Length()) { if (lineStates.Length()) {
lineStates.EnsureLength(line); lineStates.EnsureLength(line);
@ -339,6 +356,10 @@ LineAnnotation::~LineAnnotation() {
ClearAll(); ClearAll();
} }
void LineAnnotation::Init() {
ClearAll();
}
void LineAnnotation::InsertLine(int line) { void LineAnnotation::InsertLine(int line) {
if (annotations.Length()) { if (annotations.Length()) {
annotations.Insert(line, 0); annotations.Insert(line, 0);

View File

@ -49,6 +49,7 @@ public:
LineMarkers() : handleCurrent(0) { LineMarkers() : handleCurrent(0) {
} }
virtual ~LineMarkers(); virtual ~LineMarkers();
virtual void Init();
virtual void InsertLine(int line); virtual void InsertLine(int line);
virtual void RemoveLine(int line); virtual void RemoveLine(int line);
@ -64,6 +65,7 @@ class LineLevels : public PerLine {
SplitVector<int> levels; SplitVector<int> levels;
public: public:
virtual ~LineLevels(); virtual ~LineLevels();
virtual void Init();
virtual void InsertLine(int line); virtual void InsertLine(int line);
virtual void RemoveLine(int line); virtual void RemoveLine(int line);
@ -79,6 +81,7 @@ public:
LineState() { LineState() {
} }
virtual ~LineState(); virtual ~LineState();
virtual void Init();
virtual void InsertLine(int line); virtual void InsertLine(int line);
virtual void RemoveLine(int line); virtual void RemoveLine(int line);
@ -93,6 +96,7 @@ public:
LineAnnotation() { LineAnnotation() {
} }
virtual ~LineAnnotation(); virtual ~LineAnnotation();
virtual void Init();
virtual void InsertLine(int line); virtual void InsertLine(int line);
virtual void RemoveLine(int line); virtual void RemoveLine(int line);

View File

@ -10,6 +10,8 @@
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
#include <vector>
#include "Platform.h" #include "Platform.h"
#include "Scintilla.h" #include "Scintilla.h"
@ -28,6 +30,7 @@
#include "CharClassify.h" #include "CharClassify.h"
#include "Decoration.h" #include "Decoration.h"
#include "Document.h" #include "Document.h"
#include "Selection.h"
#include "PositionCache.h" #include "PositionCache.h"
#ifdef SCI_NAMESPACE #ifdef SCI_NAMESPACE
@ -46,11 +49,11 @@ LineLayout::LineLayout(int maxLineLength_) :
inCache(false), inCache(false),
maxLineLength(-1), maxLineLength(-1),
numCharsInLine(0), numCharsInLine(0),
numCharsBeforeEOL(0),
validity(llInvalid), validity(llInvalid),
xHighlightGuide(0), xHighlightGuide(0),
highlightColumn(0), highlightColumn(0),
selStart(0), psel(NULL),
selEnd(0),
containsCaret(false), containsCaret(false),
edgeColumn(0), edgeColumn(0),
chars(0), chars(0),
@ -61,7 +64,8 @@ LineLayout::LineLayout(int maxLineLength_) :
hsStart(0), hsStart(0),
hsEnd(0), hsEnd(0),
widthLine(wrapWidthInfinite), widthLine(wrapWidthInfinite),
lines(1) { lines(1),
wrapIndent(0) {
Resize(maxLineLength_); Resize(maxLineLength_);
} }
@ -114,12 +118,7 @@ int LineLayout::LineLastVisible(int line) const {
if (line < 0) { if (line < 0) {
return 0; return 0;
} else if ((line >= lines-1) || !lineStarts) { } else if ((line >= lines-1) || !lineStarts) {
int startLine = LineStart(line); return numCharsBeforeEOL;
int endLine = numCharsInLine;
while ((endLine > startLine) && IsEOLChar(chars[endLine-1])) {
endLine--;
}
return endLine;
} else { } else {
return lineStarts[line+1]; return lineStarts[line+1];
} }
@ -134,8 +133,6 @@ void LineLayout::SetLineStart(int line, int start) {
if ((line >= lenLineStarts) && (line != 0)) { if ((line >= lenLineStarts) && (line != 0)) {
int newMaxLines = line + 20; int newMaxLines = line + 20;
int *newLineStarts = new int[newMaxLines]; int *newLineStarts = new int[newMaxLines];
if (!newLineStarts)
return;
for (int i = 0; i < newMaxLines; i++) { for (int i = 0; i < newMaxLines; i++) {
if (i < lenLineStarts) if (i < lenLineStarts)
newLineStarts[i] = lineStarts[i]; newLineStarts[i] = lineStarts[i];
@ -200,6 +197,10 @@ int LineLayout::FindBefore(int x, int lower, int upper) const {
return lower; return lower;
} }
int LineLayout::EndLineStyle() const {
return styles[numCharsBeforeEOL > 0 ? numCharsBeforeEOL-1 : 0];
}
LineLayoutCache::LineLayoutCache() : LineLayoutCache::LineLayoutCache() :
level(0), length(0), size(0), cache(0), level(0), length(0), size(0), cache(0),
allInvalidated(false), styleClock(-1), useCount(0) { allInvalidated(false), styleClock(-1), useCount(0) {
@ -411,9 +412,13 @@ BreakFinder::BreakFinder(LineLayout *ll_, int lineStart_, int lineEnd_, int posL
nextBreak--; nextBreak--;
} }
if (ll->selStart != ll->selEnd) { SelectionSegment segmentLine(SelectionPosition(posLineStart), SelectionPosition(posLineStart + lineEnd));
Insert(ll->selStart - posLineStart - 1); for (size_t r=0; r<ll->psel->Count(); r++) {
Insert(ll->selEnd - posLineStart - 1); SelectionSegment portion = ll->psel->Range(r).Intersect(segmentLine);
if (portion.start.IsValid())
Insert(portion.start.Position() - posLineStart - 1);
if (portion.end.IsValid())
Insert(portion.end.Position() - posLineStart - 1);
} }
Insert(ll->edgeColumn - 1); Insert(ll->edgeColumn - 1);
@ -440,6 +445,10 @@ int BreakFinder::First() {
return nextBreak; return nextBreak;
} }
static bool IsTrailByte(int ch) {
return (ch >= 0x80) && (ch < (0x80 + 0x40));
}
int BreakFinder::Next() { int BreakFinder::Next() {
if (subBreak == -1) { if (subBreak == -1) {
int prev = nextBreak; int prev = nextBreak;
@ -472,15 +481,20 @@ int BreakFinder::Next() {
} else { } else {
int lastGoodBreak = -1; int lastGoodBreak = -1;
int lastOKBreak = -1; int lastOKBreak = -1;
int lastUTF8Break = -1;
int j; int j;
for (j = subBreak + 1; j <= nextBreak; j++) { for (j = subBreak + 1; j <= nextBreak; j++) {
if (IsSpaceOrTab(ll->chars[j - 1]) && !IsSpaceOrTab(ll->chars[j])) { if (IsSpaceOrTab(ll->chars[j - 1]) && !IsSpaceOrTab(ll->chars[j])) {
lastGoodBreak = j; lastGoodBreak = j;
} }
if (ll->chars[j] < 'A') { if (static_cast<unsigned char>(ll->chars[j]) < 'A') {
lastOKBreak = j; lastOKBreak = j;
} }
if (((j - subBreak) >= lengthEachSubdivision) && ((lastGoodBreak >= 0) || (lastOKBreak >= 0))) { if (utf8 && !IsTrailByte(static_cast<unsigned char>(ll->chars[j]))) {
lastUTF8Break = j;
}
if (((j - subBreak) >= lengthEachSubdivision) &&
((lastGoodBreak >= 0) || (lastOKBreak >= 0) || (lastUTF8Break >= 0))) {
break; break;
} }
} }
@ -488,6 +502,8 @@ int BreakFinder::Next() {
subBreak = lastGoodBreak; subBreak = lastGoodBreak;
} else if (lastOKBreak >= 0) { } else if (lastOKBreak >= 0) {
subBreak = lastOKBreak; subBreak = lastOKBreak;
} else if (lastUTF8Break >= 0) {
subBreak = lastUTF8Break;
} else { } else {
subBreak = nextBreak; subBreak = nextBreak;
} }

View File

@ -2,7 +2,7 @@
/** @file PositionCache.h /** @file PositionCache.h
** Classes for caching layout information. ** Classes for caching layout information.
**/ **/
// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org> // Copyright 1998-2009 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed. // The License.txt file describes the conditions under which this software may be distributed.
#ifndef POSITIONCACHE_H #ifndef POSITIONCACHE_H
@ -30,11 +30,11 @@ public:
enum { wrapWidthInfinite = 0x7ffffff }; enum { wrapWidthInfinite = 0x7ffffff };
int maxLineLength; int maxLineLength;
int numCharsInLine; int numCharsInLine;
int numCharsBeforeEOL;
enum validLevel { llInvalid, llCheckTextAndStyle, llPositions, llLines } validity; enum validLevel { llInvalid, llCheckTextAndStyle, llPositions, llLines } validity;
int xHighlightGuide; int xHighlightGuide;
bool highlightColumn; bool highlightColumn;
int selStart; Selection *psel;
int selEnd;
bool containsCaret; bool containsCaret;
int edgeColumn; int edgeColumn;
char *chars; char *chars;
@ -51,6 +51,7 @@ public:
// Wrapped line support // Wrapped line support
int widthLine; int widthLine;
int lines; int lines;
int wrapIndent; // In pixels
LineLayout(int maxLineLength_); LineLayout(int maxLineLength_);
virtual ~LineLayout(); virtual ~LineLayout();
@ -65,6 +66,7 @@ public:
char bracesMatchStyle, int xHighlight); char bracesMatchStyle, int xHighlight);
void RestoreBracesHighlight(Range rangeLine, Position braces[]); void RestoreBracesHighlight(Range rangeLine, Position braces[]);
int FindBefore(int x, int lower, int upper) const; int FindBefore(int x, int lower, int upper) const;
int EndLineStyle() const;
}; };
/** /**

View File

@ -11,370 +11,53 @@
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#ifdef _MSC_VER
// Visual C++ doesn't like unreachable code or long decorated names in its own headers.
#pragma warning(disable: 4018 4100 4245 4511 4512 4663 4702 4786)
#endif
#include <string>
#include <map>
#include "Platform.h" #include "Platform.h"
#include "PropSet.h" #include "PropSet.h"
#include "PropSetSimple.h"
#ifdef SCI_NAMESPACE #ifdef SCI_NAMESPACE
using namespace Scintilla; using namespace Scintilla;
#endif #endif
// The comparison and case changing functions here assume ASCII typedef std::map<std::string, std::string> mapss;
// or extended ASCII such as the normal Windows code page.
static inline char MakeUpperCase(char ch) { PropSetSimple::PropSetSimple() {
if (ch < 'a' || ch > 'z') mapss *props = new mapss;
return ch; impl = static_cast<void *>(props);
else
return static_cast<char>(ch - 'a' + 'A');
} }
static inline bool IsLetter(char ch) { PropSetSimple::~PropSetSimple() {
return ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')); mapss *props = static_cast<mapss *>(impl);
delete props;
impl = 0;
} }
inline bool IsASpace(unsigned int ch) { void PropSetSimple::Set(const char *key, const char *val, int lenKey, int lenVal) {
return (ch == ' ') || ((ch >= 0x09) && (ch <= 0x0d)); mapss *props = static_cast<mapss *>(impl);
}
int CompareCaseInsensitive(const char *a, const char *b) {
while (*a && *b) {
if (*a != *b) {
char upperA = MakeUpperCase(*a);
char upperB = MakeUpperCase(*b);
if (upperA != upperB)
return upperA - upperB;
}
a++;
b++;
}
// Either *a or *b is nul
return *a - *b;
}
int CompareNCaseInsensitive(const char *a, const char *b, size_t len) {
while (*a && *b && len) {
if (*a != *b) {
char upperA = MakeUpperCase(*a);
char upperB = MakeUpperCase(*b);
if (upperA != upperB)
return upperA - upperB;
}
a++;
b++;
len--;
}
if (len == 0)
return 0;
else
// Either *a or *b is nul
return *a - *b;
}
bool EqualCaseInsensitive(const char *a, const char *b) {
return 0 == CompareCaseInsensitive(a, b);
}
// Since the CaseInsensitive functions declared in SString
// are implemented here, I will for now put the non-inline
// implementations of the SString members here as well, so
// that I can quickly see what effect this has.
SString::SString(int i) : sizeGrowth(sizeGrowthDefault) {
char number[32];
sprintf(number, "%0d", i);
s = StringAllocate(number);
sSize = sLen = (s) ? strlen(s) : 0;
}
SString::SString(double d, int precision) : sizeGrowth(sizeGrowthDefault) {
char number[32];
sprintf(number, "%.*f", precision, d);
s = StringAllocate(number);
sSize = sLen = (s) ? strlen(s) : 0;
}
bool SString::grow(lenpos_t lenNew) {
while (sizeGrowth * 6 < lenNew) {
sizeGrowth *= 2;
}
char *sNew = new char[lenNew + sizeGrowth + 1];
if (sNew) {
if (s) {
memcpy(sNew, s, sLen);
delete []s;
}
s = sNew;
s[sLen] = '\0';
sSize = lenNew + sizeGrowth;
}
return sNew != 0;
}
SString &SString::assign(const char *sOther, lenpos_t sSize_) {
if (!sOther) {
sSize_ = 0;
} else if (sSize_ == measure_length) {
sSize_ = strlen(sOther);
}
if (sSize > 0 && sSize_ <= sSize) { // Does not allocate new buffer if the current is big enough
if (s && sSize_) {
memcpy(s, sOther, sSize_);
}
s[sSize_] = '\0';
sLen = sSize_;
} else {
delete []s;
s = StringAllocate(sOther, sSize_);
if (s) {
sSize = sSize_; // Allow buffer bigger than real string, thus providing space to grow
sLen = sSize_;
} else {
sSize = sLen = 0;
}
}
return *this;
}
bool SString::operator==(const SString &sOther) const {
if ((s == 0) && (sOther.s == 0))
return true;
if ((s == 0) || (sOther.s == 0))
return false;
return strcmp(s, sOther.s) == 0;
}
bool SString::operator==(const char *sOther) const {
if ((s == 0) && (sOther == 0))
return true;
if ((s == 0) || (sOther == 0))
return false;
return strcmp(s, sOther) == 0;
}
SString SString::substr(lenpos_t subPos, lenpos_t subLen) const {
if (subPos >= sLen) {
return SString(); // return a null string if start index is out of bounds
}
if ((subLen == measure_length) || (subPos + subLen > sLen)) {
subLen = sLen - subPos; // can't substr past end of source string
}
return SString(s, subPos, subPos + subLen);
}
SString &SString::lowercase(lenpos_t subPos, lenpos_t subLen) {
if ((subLen == measure_length) || (subPos + subLen > sLen)) {
subLen = sLen - subPos; // don't apply past end of string
}
for (lenpos_t i = subPos; i < subPos + subLen; i++) {
if (s[i] < 'A' || s[i] > 'Z')
continue;
else
s[i] = static_cast<char>(s[i] - 'A' + 'a');
}
return *this;
}
SString &SString::uppercase(lenpos_t subPos, lenpos_t subLen) {
if ((subLen == measure_length) || (subPos + subLen > sLen)) {
subLen = sLen - subPos; // don't apply past end of string
}
for (lenpos_t i = subPos; i < subPos + subLen; i++) {
if (s[i] < 'a' || s[i] > 'z')
continue;
else
s[i] = static_cast<char>(s[i] - 'a' + 'A');
}
return *this;
}
SString &SString::append(const char *sOther, lenpos_t sLenOther, char sep) {
if (!sOther) {
return *this;
}
if (sLenOther == measure_length) {
sLenOther = strlen(sOther);
}
int lenSep = 0;
if (sLen && sep) { // Only add a separator if not empty
lenSep = 1;
}
lenpos_t lenNew = sLen + sLenOther + lenSep;
// Conservative about growing the buffer: don't do it, unless really needed
if ((lenNew < sSize) || (grow(lenNew))) {
if (lenSep) {
s[sLen] = sep;
sLen++;
}
memcpy(&s[sLen], sOther, sLenOther);
sLen += sLenOther;
s[sLen] = '\0';
}
return *this;
}
SString &SString::insert(lenpos_t pos, const char *sOther, lenpos_t sLenOther) {
if (!sOther || pos > sLen) {
return *this;
}
if (sLenOther == measure_length) {
sLenOther = strlen(sOther);
}
lenpos_t lenNew = sLen + sLenOther;
// Conservative about growing the buffer: don't do it, unless really needed
if ((lenNew < sSize) || grow(lenNew)) {
lenpos_t moveChars = sLen - pos + 1;
for (lenpos_t i = moveChars; i > 0; i--) {
s[pos + sLenOther + i - 1] = s[pos + i - 1];
}
memcpy(s + pos, sOther, sLenOther);
sLen = lenNew;
}
return *this;
}
/**
* Remove @a len characters from the @a pos position, included.
* Characters at pos + len and beyond replace characters at pos.
* If @a len is 0, or greater than the length of the string
* starting at @a pos, the string is just truncated at @a pos.
*/
void SString::remove(lenpos_t pos, lenpos_t len) {
if (pos >= sLen) {
return;
}
if (len < 1 || pos + len >= sLen) {
s[pos] = '\0';
sLen = pos;
} else {
for (lenpos_t i = pos; i < sLen - len + 1; i++) {
s[i] = s[i+len];
}
sLen -= len;
}
}
bool SString::startswith(const char *prefix) {
lenpos_t lenPrefix = strlen(prefix);
if (lenPrefix > sLen) {
return false;
}
return strncmp(s, prefix, lenPrefix) == 0;
}
bool SString::endswith(const char *suffix) {
lenpos_t lenSuffix = strlen(suffix);
if (lenSuffix > sLen) {
return false;
}
return strncmp(s + sLen - lenSuffix, suffix, lenSuffix) == 0;
}
int SString::search(const char *sFind, lenpos_t start) const {
if (start < sLen) {
const char *sFound = strstr(s + start, sFind);
if (sFound) {
return sFound - s;
}
}
return -1;
}
int SString::substitute(char chFind, char chReplace) {
int c = 0;
char *t = s;
while (t) {
t = strchr(t, chFind);
if (t) {
*t = chReplace;
t++;
c++;
}
}
return c;
}
int SString::substitute(const char *sFind, const char *sReplace) {
int c = 0;
lenpos_t lenFind = strlen(sFind);
lenpos_t lenReplace = strlen(sReplace);
int posFound = search(sFind);
while (posFound >= 0) {
remove(posFound, lenFind);
insert(posFound, sReplace, lenReplace);
posFound = search(sFind, posFound + lenReplace);
c++;
}
return c;
}
char *SContainer::StringAllocate(lenpos_t len) {
if (len != measure_length) {
return new char[len + 1];
} else {
return 0;
}
}
char *SContainer::StringAllocate(const char *s, lenpos_t len) {
if (s == 0) {
return 0;
}
if (len == measure_length) {
len = strlen(s);
}
char *sNew = new char[len + 1];
if (sNew) {
memcpy(sNew, s, len);
sNew[len] = '\0';
}
return sNew;
}
// End SString functions
PropSet::PropSet() {
superPS = 0;
for (int root = 0; root < hashRoots; root++)
props[root] = 0;
}
PropSet::~PropSet() {
superPS = 0;
Clear();
}
void PropSet::Set(const char *key, const char *val, int lenKey, int lenVal) {
if (!*key) // Empty keys are not supported if (!*key) // Empty keys are not supported
return; return;
if (lenKey == -1) if (lenKey == -1)
lenKey = static_cast<int>(strlen(key)); lenKey = static_cast<int>(strlen(key));
if (lenVal == -1) if (lenVal == -1)
lenVal = static_cast<int>(strlen(val)); lenVal = static_cast<int>(strlen(val));
unsigned int hash = HashString(key, lenKey); (*props)[std::string(key, lenKey)] = std::string(val, lenVal);
for (Property *p = props[hash % hashRoots]; p; p = p->next) {
if ((hash == p->hash) &&
((strlen(p->key) == static_cast<unsigned int>(lenKey)) &&
(0 == strncmp(p->key, key, lenKey)))) {
// Replace current value
delete [](p->val);
p->val = StringDup(val, lenVal);
return;
}
}
// Not found
Property *pNew = new Property;
if (pNew) {
pNew->hash = hash;
pNew->key = StringDup(key, lenKey);
pNew->val = StringDup(val, lenVal);
pNew->next = props[hash % hashRoots];
props[hash % hashRoots] = pNew;
}
} }
void PropSet::Set(const char *keyVal) { static bool IsASpaceCharacter(unsigned int ch) {
while (IsASpace(*keyVal)) return (ch == ' ') || ((ch >= 0x09) && (ch <= 0x0d));
}
void PropSetSimple::Set(const char *keyVal) {
while (IsASpaceCharacter(*keyVal))
keyVal++; keyVal++;
const char *endVal = keyVal; const char *endVal = keyVal;
while (*endVal && (*endVal != '\n')) while (*endVal && (*endVal != '\n'))
@ -387,34 +70,7 @@ void PropSet::Set(const char *keyVal) {
} }
} }
void PropSet::Unset(const char *key, int lenKey) { void PropSetSimple::SetMultiple(const char *s) {
if (!*key) // Empty keys are not supported
return;
if (lenKey == -1)
lenKey = static_cast<int>(strlen(key));
unsigned int hash = HashString(key, lenKey);
Property *pPrev = NULL;
for (Property *p = props[hash % hashRoots]; p; p = p->next) {
if ((hash == p->hash) &&
((strlen(p->key) == static_cast<unsigned int>(lenKey)) &&
(0 == strncmp(p->key, key, lenKey)))) {
if (pPrev)
pPrev->next = p->next;
else
props[hash % hashRoots] = p->next;
if (p == enumnext)
enumnext = p->next; // Not that anyone should mix enum and Set / Unset.
delete [](p->key);
delete [](p->val);
delete p;
return;
} else {
pPrev = p;
}
}
}
void PropSet::SetMultiple(const char *s) {
const char *eol = strchr(s, '\n'); const char *eol = strchr(s, '\n');
while (eol) { while (eol) {
Set(s); Set(s);
@ -424,16 +80,11 @@ void PropSet::SetMultiple(const char *s) {
Set(s); Set(s);
} }
SString PropSet::Get(const char *key) const { const char *PropSetSimple::Get(const char *key) const {
unsigned int hash = HashString(key, strlen(key)); mapss *props = static_cast<mapss *>(impl);
for (Property *p = props[hash % hashRoots]; p; p = p->next) { mapss::const_iterator keyPos = props->find(std::string(key));
if ((hash == p->hash) && (0 == strcmp(p->key, key))) { if (keyPos != props->end()) {
return p->val; return keyPos->second.c_str();
}
}
if (superPS) {
// Failed here, so try in base property set
return superPS->Get(key);
} else { } else {
return ""; return "";
} }
@ -456,300 +107,70 @@ struct VarChain {
const VarChain *link; const VarChain *link;
}; };
static int ExpandAllInPlace(const PropSet &props, SString &withVars, int maxExpands, const VarChain &blankVars = VarChain()) { static int ExpandAllInPlace(const PropSetSimple &props, std::string &withVars, int maxExpands, const VarChain &blankVars) {
int varStart = withVars.search("$("); size_t varStart = withVars.find("$(");
while ((varStart >= 0) && (maxExpands > 0)) { while ((varStart != std::string::npos) && (maxExpands > 0)) {
int varEnd = withVars.search(")", varStart+2); size_t varEnd = withVars.find(")", varStart+2);
if (varEnd < 0) { if (varEnd == std::string::npos) {
break; break;
} }
// For consistency, when we see '$(ab$(cde))', expand the inner variable first, // For consistency, when we see '$(ab$(cde))', expand the inner variable first,
// regardless whether there is actually a degenerate variable named 'ab$(cde'. // regardless whether there is actually a degenerate variable named 'ab$(cde'.
int innerVarStart = withVars.search("$(", varStart+2); size_t innerVarStart = withVars.find("$(", varStart+2);
while ((innerVarStart > varStart) && (innerVarStart < varEnd)) { while ((innerVarStart != std::string::npos) && (innerVarStart > varStart) && (innerVarStart < varEnd)) {
varStart = innerVarStart; varStart = innerVarStart;
innerVarStart = withVars.search("$(", varStart+2); innerVarStart = withVars.find("$(", varStart+2);
} }
SString var(withVars.c_str(), varStart + 2, varEnd); std::string var(withVars.c_str(), varStart + 2, varEnd - varStart - 2);
SString val = props.Get(var.c_str()); std::string val = props.Get(var.c_str());
if (blankVars.contains(var.c_str())) { if (blankVars.contains(var.c_str())) {
val.clear(); // treat blankVar as an empty string (e.g. to block self-reference) val = ""; // treat blankVar as an empty string (e.g. to block self-reference)
} }
if (--maxExpands >= 0) { if (--maxExpands >= 0) {
maxExpands = ExpandAllInPlace(props, val, maxExpands, VarChain(var.c_str(), &blankVars)); maxExpands = ExpandAllInPlace(props, val, maxExpands, VarChain(var.c_str(), &blankVars));
} }
withVars.remove(varStart, varEnd-varStart+1); withVars.erase(varStart, varEnd-varStart+1);
withVars.insert(varStart, val.c_str(), val.length()); withVars.insert(varStart, val.c_str(), val.length());
varStart = withVars.search("$("); varStart = withVars.find("$(");
} }
return maxExpands; return maxExpands;
} }
SString PropSet::GetExpanded(const char *key) const { char *PropSetSimple::Expanded(const char *key) const {
SString val = Get(key); std::string val = Get(key);
ExpandAllInPlace(*this, val, 100, VarChain(key)); ExpandAllInPlace(*this, val, 100, VarChain(key));
return val; char *ret = new char [val.size() + 1];
} strcpy(ret, val.c_str());
SString PropSet::Expand(const char *withVars, int maxExpands) const {
SString val = withVars;
ExpandAllInPlace(*this, val, maxExpands);
return val;
}
int PropSet::GetInt(const char *key, int defaultValue) const {
SString val = GetExpanded(key);
if (val.length())
return val.value();
return defaultValue;
}
bool isprefix(const char *target, const char *prefix) {
while (*target && *prefix) {
if (*target != *prefix)
return false;
target++;
prefix++;
}
if (*prefix)
return false;
else
return true;
}
void PropSet::Clear() {
for (int root = 0; root < hashRoots; root++) {
Property *p = props[root];
while (p) {
Property *pNext = p->next;
p->hash = 0;
delete []p->key;
p->key = 0;
delete []p->val;
p->val = 0;
delete p;
p = pNext;
}
props[root] = 0;
}
}
char *PropSet::ToString() const {
size_t len=0;
for (int r = 0; r < hashRoots; r++) {
for (Property *p = props[r]; p; p = p->next) {
len += strlen(p->key) + 1;
len += strlen(p->val) + 1;
}
}
if (len == 0)
len = 1; // Return as empty string
char *ret = new char [len];
if (ret) {
char *w = ret;
for (int root = 0; root < hashRoots; root++) {
for (Property *p = props[root]; p; p = p->next) {
strcpy(w, p->key);
w += strlen(p->key);
*w++ = '=';
strcpy(w, p->val);
w += strlen(p->val);
*w++ = '\n';
}
}
ret[len-1] = '\0';
}
return ret; return ret;
} }
/** char *PropSetSimple::ToString() const {
* Creates an array that points into each word in the string and puts \0 terminators mapss *props = static_cast<mapss *>(impl);
* after each word. std::string sval;
*/ for (mapss::const_iterator it=props->begin(); it != props->end(); it++) {
static char **ArrayFromWordList(char *wordlist, int *len, bool onlyLineEnds = false) { sval += it->first;
int prev = '\n'; sval += "=";
int words = 0; sval += it->second;
// For rapid determination of whether a character is a separator, build sval += "\n";
// a look up table.
bool wordSeparator[256];
for (int i=0;i<256; i++) {
wordSeparator[i] = false;
} }
wordSeparator['\r'] = true; char *ret = new char [sval.size() + 1];
wordSeparator['\n'] = true; strcpy(ret, sval.c_str());
if (!onlyLineEnds) { return ret;
wordSeparator[' '] = true;
wordSeparator['\t'] = true;
}
for (int j = 0; wordlist[j]; j++) {
int curr = static_cast<unsigned char>(wordlist[j]);
if (!wordSeparator[curr] && wordSeparator[prev])
words++;
prev = curr;
}
char **keywords = new char *[words + 1];
if (keywords) {
words = 0;
prev = '\0';
size_t slen = strlen(wordlist);
for (size_t k = 0; k < slen; k++) {
if (!wordSeparator[static_cast<unsigned char>(wordlist[k])]) {
if (!prev) {
keywords[words] = &wordlist[k];
words++;
}
} else {
wordlist[k] = '\0';
}
prev = wordlist[k];
}
keywords[words] = &wordlist[slen];
*len = words;
} else {
*len = 0;
}
return keywords;
} }
void WordList::Clear() { int PropSetSimple::GetInt(const char *key, int defaultValue) const {
if (words) { char *val = Expanded(key);
delete []list; if (val) {
delete []words; int retVal = val[0] ? atoi(val) : defaultValue;
delete []val;
return retVal;
} }
words = 0; return defaultValue;
list = 0;
len = 0;
sorted = false;
}
void WordList::Set(const char *s) {
list = StringDup(s);
sorted = false;
words = ArrayFromWordList(list, &len, onlyLineEnds);
}
extern "C" int cmpString(const void *a1, const void *a2) {
// Can't work out the correct incantation to use modern casts here
return strcmp(*(char**)(a1), *(char**)(a2));
}
static void SortWordList(char **words, unsigned int len) {
qsort(reinterpret_cast<void*>(words), len, sizeof(*words),
cmpString);
}
bool WordList::InList(const char *s) {
if (0 == words)
return false;
if (!sorted) {
sorted = true;
SortWordList(words, len);
for (unsigned int k = 0; k < (sizeof(starts) / sizeof(starts[0])); k++)
starts[k] = -1;
for (int l = len - 1; l >= 0; l--) {
unsigned char indexChar = words[l][0];
starts[indexChar] = l;
}
}
unsigned char firstChar = s[0];
int j = starts[firstChar];
if (j >= 0) {
while ((unsigned char)words[j][0] == firstChar) {
if (s[1] == words[j][1]) {
const char *a = words[j] + 1;
const char *b = s + 1;
while (*a && *a == *b) {
a++;
b++;
}
if (!*a && !*b)
return true;
}
j++;
}
}
j = starts['^'];
if (j >= 0) {
while (words[j][0] == '^') {
const char *a = words[j] + 1;
const char *b = s;
while (*a && *a == *b) {
a++;
b++;
}
if (!*a)
return true;
j++;
}
}
return false;
}
/** similar to InList, but word s can be a substring of keyword.
* eg. the keyword define is defined as def~ine. This means the word must start
* with def to be a keyword, but also defi, defin and define are valid.
* The marker is ~ in this case.
*/
bool WordList::InListAbbreviated(const char *s, const char marker) {
if (0 == words)
return false;
if (!sorted) {
sorted = true;
SortWordList(words, len);
for (unsigned int k = 0; k < (sizeof(starts) / sizeof(starts[0])); k++)
starts[k] = -1;
for (int l = len - 1; l >= 0; l--) {
unsigned char indexChar = words[l][0];
starts[indexChar] = l;
}
}
unsigned char firstChar = s[0];
int j = starts[firstChar];
if (j >= 0) {
while (words[j][0] == firstChar) {
bool isSubword = false;
int start = 1;
if (words[j][1] == marker) {
isSubword = true;
start++;
}
if (s[1] == words[j][start]) {
const char *a = words[j] + start;
const char *b = s + 1;
while (*a && *a == *b) {
a++;
if (*a == marker) {
isSubword = true;
a++;
}
b++;
}
if ((!*a || isSubword) && !*b)
return true;
}
j++;
}
}
j = starts['^'];
if (j >= 0) {
while (words[j][0] == '^') {
const char *a = words[j] + 1;
const char *b = s;
while (*a && *a == *b) {
a++;
b++;
}
if (!*a)
return true;
j++;
}
}
return false;
} }

View File

@ -198,6 +198,8 @@
* matches: foo-foo fo-fo fob-fob foobar-foobar ... * matches: foo-foo fo-fo fob-fob foobar-foobar ...
*/ */
#include <stdlib.h>
#include "CharClassify.h" #include "CharClassify.h"
#include "RESearch.h" #include "RESearch.h"

View File

@ -23,7 +23,6 @@ class SVector {
int *v; ///< The vector int *v; ///< The vector
unsigned int size; ///< Number of elements allocated unsigned int size; ///< Number of elements allocated
unsigned int len; ///< Number of elements used in vector unsigned int len; ///< Number of elements used in vector
bool allocFailure; ///< A memory allocation call has failed
/** Internally allocate more elements than the user wants /** Internally allocate more elements than the user wants
* to avoid thrashing the memory allocator. */ * to avoid thrashing the memory allocator. */
@ -33,10 +32,6 @@ class SVector {
else else
newSize = (newSize * 3) / 2; newSize = (newSize * 3) / 2;
int* newv = new int[newSize]; int* newv = new int[newSize];
if (!newv) {
allocFailure = true;
return;
}
size = newSize; size = newSize;
unsigned int i=0; unsigned int i=0;
for (; i<len; i++) { for (; i<len; i++) {
@ -51,7 +46,6 @@ class SVector {
public: public:
SVector() { SVector() {
allocFailure = false;
v = 0; v = 0;
len = 0; len = 0;
size = 0; size = 0;
@ -61,33 +55,27 @@ public:
} }
/// Constructor from another vector. /// Constructor from another vector.
SVector(const SVector &other) { SVector(const SVector &other) {
allocFailure = false;
v = 0; v = 0;
len = 0; len = 0;
size = 0; size = 0;
if (other.Length() > 0) { if (other.Length() > 0) {
SizeTo(other.Length()); SizeTo(other.Length());
if (!allocFailure) {
for (int i=0;i<other.Length();i++) for (int i=0;i<other.Length();i++)
v[i] = other.v[i]; v[i] = other.v[i];
len = other.Length(); len = other.Length();
} }
} }
}
/// Copy constructor. /// Copy constructor.
SVector &operator=(const SVector &other) { SVector &operator=(const SVector &other) {
if (this != &other) { if (this != &other) {
delete []v; delete []v;
allocFailure = false;
v = 0; v = 0;
len = 0; len = 0;
size = 0; size = 0;
if (other.Length() > 0) { if (other.Length() > 0) {
SizeTo(other.Length()); SizeTo(other.Length());
if (!allocFailure) {
for (int i=0;i<other.Length();i++) for (int i=0;i<other.Length();i++)
v[i] = other.v[i]; v[i] = other.v[i];
}
len = other.Length(); len = other.Length();
} }
} }

View File

@ -10,10 +10,13 @@
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
#include <vector>
#include "Platform.h" #include "Platform.h"
#include "Scintilla.h" #include "Scintilla.h"
#include "PropSet.h" #include "PropSet.h"
#include "PropSetSimple.h"
#ifdef SCI_LEXER #ifdef SCI_LEXER
#include "SciLexer.h" #include "SciLexer.h"
#include "Accessor.h" #include "Accessor.h"
@ -36,6 +39,7 @@
#include "CharClassify.h" #include "CharClassify.h"
#include "Decoration.h" #include "Decoration.h"
#include "Document.h" #include "Document.h"
#include "Selection.h"
#include "PositionCache.h" #include "PositionCache.h"
#include "Editor.h" #include "Editor.h"
#include "ScintillaBase.h" #include "ScintillaBase.h"
@ -190,7 +194,7 @@ int ScintillaBase::KeyCommand(unsigned int iMessage) {
ct.CallTipCancel(); ct.CallTipCancel();
} }
if ((iMessage == SCI_DELETEBACK) || (iMessage == SCI_DELETEBACKNOTLINE)) { if ((iMessage == SCI_DELETEBACK) || (iMessage == SCI_DELETEBACKNOTLINE)) {
if (currentPos <= ct.posStartCallTip) { if (sel.MainCaret() <= ct.posStartCallTip) {
ct.CallTipCancel(); ct.CallTipCancel();
} }
} }
@ -212,24 +216,24 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {
const char *typeSep = strchr(list, ac.GetTypesep()); const char *typeSep = strchr(list, ac.GetTypesep());
size_t lenInsert = (typeSep) ? (typeSep-list) : strlen(list); size_t lenInsert = (typeSep) ? (typeSep-list) : strlen(list);
if (ac.ignoreCase) { if (ac.ignoreCase) {
SetEmptySelection(currentPos - lenEntered); SetEmptySelection(sel.MainCaret() - lenEntered);
pdoc->DeleteChars(currentPos, lenEntered); pdoc->DeleteChars(sel.MainCaret(), lenEntered);
SetEmptySelection(currentPos); SetEmptySelection(sel.MainCaret());
pdoc->InsertString(currentPos, list, lenInsert); pdoc->InsertString(sel.MainCaret(), list, lenInsert);
SetEmptySelection(currentPos + lenInsert); SetEmptySelection(sel.MainCaret() + lenInsert);
} else { } else {
SetEmptySelection(currentPos); SetEmptySelection(sel.MainCaret());
pdoc->InsertString(currentPos, list + lenEntered, lenInsert - lenEntered); pdoc->InsertString(sel.MainCaret(), list + lenEntered, lenInsert - lenEntered);
SetEmptySelection(currentPos + lenInsert - lenEntered); SetEmptySelection(sel.MainCaret() + lenInsert - lenEntered);
} }
return; return;
} }
} }
ac.Start(wMain, idAutoComplete, currentPos, LocationFromPosition(currentPos), ac.Start(wMain, idAutoComplete, sel.MainCaret(), PointMainCaret(),
lenEntered, vs.lineHeight, IsUnicodeMode()); lenEntered, vs.lineHeight, IsUnicodeMode());
PRectangle rcClient = GetClientRectangle(); PRectangle rcClient = GetClientRectangle();
Point pt = LocationFromPosition(currentPos - lenEntered); Point pt = LocationFromPosition(sel.MainCaret() - lenEntered);
PRectangle rcPopupBounds = wMain.GetMonitorRect(pt); PRectangle rcPopupBounds = wMain.GetMonitorRect(pt);
if (rcPopupBounds.Height() == 0) if (rcPopupBounds.Height() == 0)
rcPopupBounds = rcClient; rcPopupBounds = rcClient;
@ -239,7 +243,7 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {
if (pt.x >= rcClient.right - widthLB) { if (pt.x >= rcClient.right - widthLB) {
HorizontalScrollTo(xOffset + pt.x - rcClient.right + widthLB); HorizontalScrollTo(xOffset + pt.x - rcClient.right + widthLB);
Redraw(); Redraw();
pt = LocationFromPosition(currentPos); pt = PointMainCaret();
} }
PRectangle rcac; PRectangle rcac;
rcac.left = pt.x - ac.lb->CaretFromEdge(); rcac.left = pt.x - ac.lb->CaretFromEdge();
@ -305,7 +309,7 @@ void ScintillaBase::AutoCompleteMoveToCurrentWord() {
char wordCurrent[1000]; char wordCurrent[1000];
int i; int i;
int startWord = ac.posStart - ac.startLen; int startWord = ac.posStart - ac.startLen;
for (i = startWord; i < currentPos && i - startWord < 1000; i++) for (i = startWord; i < sel.MainCaret() && i - startWord < 1000; i++)
wordCurrent[i - startWord] = pdoc->CharAt(i); wordCurrent[i - startWord] = pdoc->CharAt(i);
wordCurrent[Platform::Minimum(i - startWord, 999)] = '\0'; wordCurrent[Platform::Minimum(i - startWord, 999)] = '\0';
ac.Select(wordCurrent); ac.Select(wordCurrent);
@ -322,9 +326,9 @@ void ScintillaBase::AutoCompleteCharacterAdded(char ch) {
} }
void ScintillaBase::AutoCompleteCharacterDeleted() { void ScintillaBase::AutoCompleteCharacterDeleted() {
if (currentPos < ac.posStart - ac.startLen) { if (sel.MainCaret() < ac.posStart - ac.startLen) {
AutoCompleteCancel(); AutoCompleteCancel();
} else if (ac.cancelAtStartPos && (currentPos <= ac.posStart)) { } else if (ac.cancelAtStartPos && (sel.MainCaret() <= ac.posStart)) {
AutoCompleteCancel(); AutoCompleteCancel();
} else { } else {
AutoCompleteMoveToCurrentWord(); AutoCompleteMoveToCurrentWord();
@ -349,7 +353,6 @@ void ScintillaBase::AutoCompleteCompleted() {
ac.Show(false); ac.Show(false);
listSelected = selected;
SCNotification scn = {0}; SCNotification scn = {0};
scn.nmhdr.code = listType > 0 ? SCN_USERLISTSELECTION : SCN_AUTOCSELECTION; scn.nmhdr.code = listType > 0 ? SCN_USERLISTSELECTION : SCN_AUTOCSELECTION;
scn.message = 0; scn.message = 0;
@ -357,7 +360,7 @@ void ScintillaBase::AutoCompleteCompleted() {
scn.listType = listType; scn.listType = listType;
Position firstPos = ac.posStart - ac.startLen; Position firstPos = ac.posStart - ac.startLen;
scn.lParam = firstPos; scn.lParam = firstPos;
scn.text = listSelected.c_str(); scn.text = selected;
NotifyParent(scn); NotifyParent(scn);
if (!ac.Active()) if (!ac.Active())
@ -367,22 +370,20 @@ void ScintillaBase::AutoCompleteCompleted() {
if (listType > 0) if (listType > 0)
return; return;
Position endPos = currentPos; Position endPos = sel.MainCaret();
if (ac.dropRestOfWord) if (ac.dropRestOfWord)
endPos = pdoc->ExtendWordSelect(endPos, 1, true); endPos = pdoc->ExtendWordSelect(endPos, 1, true);
if (endPos < firstPos) if (endPos < firstPos)
return; return;
pdoc->BeginUndoAction(); UndoGroup ug(pdoc);
if (endPos != firstPos) { if (endPos != firstPos) {
pdoc->DeleteChars(firstPos, endPos - firstPos); pdoc->DeleteChars(firstPos, endPos - firstPos);
} }
SetEmptySelection(ac.posStart); SetEmptySelection(ac.posStart);
if (item != -1) { if (item != -1) {
SString piece = selected; pdoc->InsertCString(firstPos, selected);
pdoc->InsertCString(firstPos, piece.c_str()); SetEmptySelection(firstPos + static_cast<int>(strlen(selected)));
SetEmptySelection(firstPos + static_cast<int>(piece.length()));
} }
pdoc->EndUndoAction();
} }
int ScintillaBase::AutoCompleteGetCurrent() { int ScintillaBase::AutoCompleteGetCurrent() {
@ -401,7 +402,7 @@ void ScintillaBase::CallTipShow(Point pt, const char *defn) {
if (ct.UseStyleCallTip()) { if (ct.UseStyleCallTip()) {
ct.SetForeBack(vs.styles[STYLE_CALLTIP].fore, vs.styles[STYLE_CALLTIP].back); ct.SetForeBack(vs.styles[STYLE_CALLTIP].fore, vs.styles[STYLE_CALLTIP].back);
} }
PRectangle rc = ct.CallTipStart(currentPos, pt, PRectangle rc = ct.CallTipStart(sel.MainCaret(), pt,
defn, defn,
vs.styles[ctStyle].fontName, vs.styles[ctStyle].fontName,
vs.styles[ctStyle].sizeZoomed, vs.styles[ctStyle].sizeZoomed,
@ -436,10 +437,10 @@ void ScintillaBase::ContextMenu(Point pt) {
AddToPopUp("Undo", idcmdUndo, writable && pdoc->CanUndo()); AddToPopUp("Undo", idcmdUndo, writable && pdoc->CanUndo());
AddToPopUp("Redo", idcmdRedo, writable && pdoc->CanRedo()); AddToPopUp("Redo", idcmdRedo, writable && pdoc->CanRedo());
AddToPopUp(""); AddToPopUp("");
AddToPopUp("Cut", idcmdCut, writable && currentPos != anchor); AddToPopUp("Cut", idcmdCut, writable && !sel.Empty());
AddToPopUp("Copy", idcmdCopy, currentPos != anchor); AddToPopUp("Copy", idcmdCopy, !sel.Empty());
AddToPopUp("Paste", idcmdPaste, writable && WndProc(SCI_CANPASTE, 0, 0)); AddToPopUp("Paste", idcmdPaste, writable && WndProc(SCI_CANPASTE, 0, 0));
AddToPopUp("Delete", idcmdDelete, writable && currentPos != anchor); AddToPopUp("Delete", idcmdDelete, writable && !sel.Empty());
AddToPopUp(""); AddToPopUp("");
AddToPopUp("Select All", idcmdSelectAll); AddToPopUp("Select All", idcmdSelectAll);
popup.Show(pt, wMain); popup.Show(pt, wMain);
@ -706,24 +707,23 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara
break; break;
case SCI_GETPROPERTY: { case SCI_GETPROPERTY: {
SString val = props.Get(reinterpret_cast<const char *>(wParam)); const char *val = props.Get(reinterpret_cast<const char *>(wParam));
const int n = val.length(); const int n = strlen(val);
if (lParam != 0) { if (lParam != 0) {
char *ptr = reinterpret_cast<char *>(lParam); char *ptr = reinterpret_cast<char *>(lParam);
memcpy(ptr, val.c_str(), n); strcpy(ptr, val);
ptr[n] = '\0'; // terminate
} }
return n; // Not including NUL return n; // Not including NUL
} }
case SCI_GETPROPERTYEXPANDED: { case SCI_GETPROPERTYEXPANDED: {
SString val = props.GetExpanded(reinterpret_cast<const char *>(wParam)); char *val = props.Expanded(reinterpret_cast<const char *>(wParam));
const int n = val.length(); const int n = strlen(val);
if (lParam != 0) { if (lParam != 0) {
char *ptr = reinterpret_cast<char *>(lParam); char *ptr = reinterpret_cast<char *>(lParam);
memcpy(ptr, val.c_str(), n); strcpy(ptr, val);
ptr[n] = '\0'; // terminate
} }
delete []val;
return n; // Not including NUL return n; // Not including NUL
} }

View File

@ -41,7 +41,6 @@ protected:
CallTip ct; CallTip ct;
int listType; ///< 0 is an autocomplete list int listType; ///< 0 is an autocomplete list
SString listSelected; ///< Receives listbox selected string
int maxListWidth; /// Maximum width of list, in average character widths int maxListWidth; /// Maximum width of list, in average character widths
bool performingStyle; ///< Prevent reentrance bool performingStyle; ///< Prevent reentrance
@ -49,7 +48,7 @@ protected:
#ifdef SCI_LEXER #ifdef SCI_LEXER
int lexLanguage; int lexLanguage;
const LexerModule *lexCurrent; const LexerModule *lexCurrent;
PropSet props; PropSetSimple props;
enum {numWordLists=KEYWORDSET_MAX+1}; enum {numWordLists=KEYWORDSET_MAX+1};
WordList *keyWordLists[numWordLists+1]; WordList *keyWordLists[numWordLists+1];
void SetLexer(uptr_t wParam); void SetLexer(uptr_t wParam);

View File

@ -92,10 +92,13 @@ ViewStyle::ViewStyle(const ViewStyle &source) {
selforeset = source.selforeset; selforeset = source.selforeset;
selforeground.desired = source.selforeground.desired; selforeground.desired = source.selforeground.desired;
selAdditionalForeground.desired = source.selAdditionalForeground.desired;
selbackset = source.selbackset; selbackset = source.selbackset;
selbackground.desired = source.selbackground.desired; selbackground.desired = source.selbackground.desired;
selAdditionalBackground.desired = source.selAdditionalBackground.desired;
selbackground2.desired = source.selbackground2.desired; selbackground2.desired = source.selbackground2.desired;
selAlpha = source.selAlpha; selAlpha = source.selAlpha;
selAdditionalAlpha = source.selAdditionalAlpha;
selEOLFilled = source.selEOLFilled; selEOLFilled = source.selEOLFilled;
foldmarginColourSet = source.foldmarginColourSet; foldmarginColourSet = source.foldmarginColourSet;
@ -117,6 +120,7 @@ ViewStyle::ViewStyle(const ViewStyle &source) {
selbar.desired = source.selbar.desired; selbar.desired = source.selbar.desired;
selbarlight.desired = source.selbarlight.desired; selbarlight.desired = source.selbarlight.desired;
caretcolour.desired = source.caretcolour.desired; caretcolour.desired = source.caretcolour.desired;
additionalCaretColour.desired = source.additionalCaretColour.desired;
showCaretLineBackground = source.showCaretLineBackground; showCaretLineBackground = source.showCaretLineBackground;
showCaretLineBackgroundAlways = source.showCaretLineBackgroundAlways; showCaretLineBackgroundAlways = source.showCaretLineBackgroundAlways;
caretLineBackground.desired = source.caretLineBackground.desired; caretLineBackground.desired = source.caretLineBackground.desired;
@ -177,10 +181,13 @@ void ViewStyle::Init(size_t stylesSize_) {
selforeset = false; selforeset = false;
selforeground.desired = ColourDesired(0xff, 0, 0); selforeground.desired = ColourDesired(0xff, 0, 0);
selAdditionalForeground.desired = ColourDesired(0xff, 0, 0);
selbackset = true; selbackset = true;
selbackground.desired = ColourDesired(0xc0, 0xc0, 0xc0); selbackground.desired = ColourDesired(0xc0, 0xc0, 0xc0);
selAdditionalBackground.desired = ColourDesired(0xd7, 0xd7, 0xd7);
selbackground2.desired = ColourDesired(0xb0, 0xb0, 0xb0); selbackground2.desired = ColourDesired(0xb0, 0xb0, 0xb0);
selAlpha = SC_ALPHA_NOALPHA; selAlpha = SC_ALPHA_NOALPHA;
selAdditionalAlpha = SC_ALPHA_NOALPHA;
selEOLFilled = false; selEOLFilled = false;
foldmarginColourSet = false; foldmarginColourSet = false;
@ -197,6 +204,7 @@ void ViewStyle::Init(size_t stylesSize_) {
styles[STYLE_LINENUMBER].fore.desired = ColourDesired(0, 0, 0); styles[STYLE_LINENUMBER].fore.desired = ColourDesired(0, 0, 0);
styles[STYLE_LINENUMBER].back.desired = Platform::Chrome(); styles[STYLE_LINENUMBER].back.desired = Platform::Chrome();
caretcolour.desired = ColourDesired(0, 0, 0); caretcolour.desired = ColourDesired(0, 0, 0);
additionalCaretColour.desired = ColourDesired(0x7f, 0x7f, 0x7f);
showCaretLineBackground = false; showCaretLineBackground = false;
showCaretLineBackgroundAlways = false; showCaretLineBackgroundAlways = false;
caretLineBackground.desired = ColourDesired(0xff, 0xff, 0); caretLineBackground.desired = ColourDesired(0xff, 0xff, 0);
@ -260,7 +268,9 @@ void ViewStyle::RefreshColourPalette(Palette &pal, bool want) {
markers[i].RefreshColourPalette(pal, want); markers[i].RefreshColourPalette(pal, want);
} }
pal.WantFind(selforeground, want); pal.WantFind(selforeground, want);
pal.WantFind(selAdditionalForeground, want);
pal.WantFind(selbackground, want); pal.WantFind(selbackground, want);
pal.WantFind(selAdditionalBackground, want);
pal.WantFind(selbackground2, want); pal.WantFind(selbackground2, want);
pal.WantFind(foldmarginColour, want); pal.WantFind(foldmarginColour, want);
@ -271,6 +281,7 @@ void ViewStyle::RefreshColourPalette(Palette &pal, bool want) {
pal.WantFind(selbar, want); pal.WantFind(selbar, want);
pal.WantFind(selbarlight, want); pal.WantFind(selbarlight, want);
pal.WantFind(caretcolour, want); pal.WantFind(caretcolour, want);
pal.WantFind(additionalCaretColour, want);
pal.WantFind(caretLineBackground, want); pal.WantFind(caretLineBackground, want);
pal.WantFind(edgecolour, want); pal.WantFind(edgecolour, want);
pal.WantFind(hotspotForeground, want); pal.WantFind(hotspotForeground, want);

View File

@ -58,10 +58,13 @@ public:
unsigned int spaceWidth; unsigned int spaceWidth;
bool selforeset; bool selforeset;
ColourPair selforeground; ColourPair selforeground;
ColourPair selAdditionalForeground;
bool selbackset; bool selbackset;
ColourPair selbackground; ColourPair selbackground;
ColourPair selAdditionalBackground;
ColourPair selbackground2; ColourPair selbackground2;
int selAlpha; int selAlpha;
int selAdditionalAlpha;
bool selEOLFilled; bool selEOLFilled;
bool whitespaceForegroundSet; bool whitespaceForegroundSet;
ColourPair whitespaceForeground; ColourPair whitespaceForeground;
@ -93,6 +96,7 @@ public:
bool viewEOL; bool viewEOL;
bool showMarkedLines; bool showMarkedLines;
ColourPair caretcolour; ColourPair caretcolour;
ColourPair additionalCaretColour;
bool showCaretLineBackground; bool showCaretLineBackground;
bool showCaretLineBackgroundAlways; bool showCaretLineBackgroundAlways;
ColourPair caretLineBackground; ColourPair caretLineBackground;

View File

@ -45,7 +45,7 @@ void WindowAccessor::Fill(int position) {
if (endPos > lenDoc) if (endPos > lenDoc)
endPos = lenDoc; endPos = lenDoc;
TextRange tr = {{startPos, endPos}, buf}; Sci_TextRange tr = {{startPos, endPos}, buf};
Platform::SendScintillaPointer(id, SCI_GETTEXTRANGE, 0, &tr); Platform::SendScintillaPointer(id, SCI_GETTEXTRANGE, 0, &tr);
} }

View File

@ -16,7 +16,7 @@ namespace Scintilla {
* Hold a pixmap in XPM format. * Hold a pixmap in XPM format.
*/ */
class XPM { class XPM {
int id; // Assigned by container int pid; // Assigned by container
int height; int height;
int width; int width;
int nColours; int nColours;
@ -42,8 +42,8 @@ public:
/// Decompose image into runs and use FillRectangle for each run /// Decompose image into runs and use FillRectangle for each run
void Draw(Surface *surface, PRectangle &rc); void Draw(Surface *surface, PRectangle &rc);
char **InLinesForm() { return lines; } char **InLinesForm() { return lines; }
void SetId(int id_) { id = id_; } void SetId(int pid_) { pid = pid_; }
int GetId() { return id; } int GetId() { return pid; }
int GetHeight() { return height; } int GetHeight() { return height; }
int GetWidth() { return width; } int GetWidth() { return width; }
static const char **LinesFormFromTextForm(const char *textForm); static const char **LinesFormFromTextForm(const char *textForm);

View File

@ -43,8 +43,8 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SciLexer_EXPORTS" /Yu"stdafx.h" /FD /c # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SciLexer_EXPORTS" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /G6 /MT /W4 /O1 /I "..\include" /I "..\src" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SCI_LEXER" /FD /c # ADD CPP /nologo /G6 /MT /W3 /GX /O1 /I "..\include" /I "..\src" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SCI_LEXER" /D "_CRT_SECURE_NO_WARNINGS" /Fr /FD /c
# SUBTRACT CPP /Fr /YX /Yc /Yu # SUBTRACT CPP /YX /Yc /Yu
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD BASE RSC /l 0x409 /d "NDEBUG"
@ -70,7 +70,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SciLexer_EXPORTS" /Yu"stdafx.h" /FD /GZ /c # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SciLexer_EXPORTS" /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /G6 /MTd /W4 /Gm /GX /ZI /Od /I "..\include" /I "..\src" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SCI_LEXER" /FR /FD /GZ /c # ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\src" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SCI_LEXER" /D "_CRT_SECURE_NO_WARNINGS" /FR /FD /GZ /c
# SUBTRACT CPP /YX /Yc /Yu # SUBTRACT CPP /YX /Yc /Yu
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
@ -506,6 +506,10 @@ SOURCE=..\win32\ScintRes.rc
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\Selection.cxx
# End Source File
# Begin Source File
SOURCE=..\src\Style.cxx SOURCE=..\src\Style.cxx
# End Source File # End Source File
# Begin Source File # Begin Source File

View File

@ -1 +1 @@
178 201

View File

@ -216,7 +216,7 @@ class FontCached : Font {
static FontCached *first; static FontCached *first;
public: public:
static FontID FindOrCreate(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_); static FontID FindOrCreate(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_);
static void ReleaseId(FontID id_); static void ReleaseId(FontID fid_);
}; };
FontCached *FontCached::first = 0; FontCached *FontCached::first = 0;
@ -225,7 +225,7 @@ FontCached::FontCached(const char *faceName_, int characterSet_, int size_, bool
next(0), usage(0), hash(0) { next(0), usage(0), hash(0) {
SetLogFont(lf, faceName_, characterSet_, size_, bold_, italic_); SetLogFont(lf, faceName_, characterSet_, size_, bold_, italic_);
hash = HashFont(faceName_, characterSet_, size_, bold_, italic_); hash = HashFont(faceName_, characterSet_, size_, bold_, italic_);
id = ::CreateFontIndirectA(&lf); fid = ::CreateFontIndirectA(&lf);
usage = 1; usage = 1;
} }
@ -239,9 +239,9 @@ bool FontCached::SameAs(const char *faceName_, int characterSet_, int size_, boo
} }
void FontCached::Release() { void FontCached::Release() {
if (id) if (fid)
::DeleteObject(id); ::DeleteObject(fid);
id = 0; fid = 0;
} }
FontID FontCached::FindOrCreate(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_) { FontID FontCached::FindOrCreate(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_) {
@ -252,7 +252,7 @@ FontID FontCached::FindOrCreate(const char *faceName_, int characterSet_, int si
if ((cur->hash == hashFind) && if ((cur->hash == hashFind) &&
cur->SameAs(faceName_, characterSet_, size_, bold_, italic_)) { cur->SameAs(faceName_, characterSet_, size_, bold_, italic_)) {
cur->usage++; cur->usage++;
ret = cur->id; ret = cur->fid;
} }
} }
if (ret == 0) { if (ret == 0) {
@ -260,18 +260,18 @@ FontID FontCached::FindOrCreate(const char *faceName_, int characterSet_, int si
if (fc) { if (fc) {
fc->next = first; fc->next = first;
first = fc; first = fc;
ret = fc->id; ret = fc->fid;
} }
} }
::LeaveCriticalSection(&crPlatformLock); ::LeaveCriticalSection(&crPlatformLock);
return ret; return ret;
} }
void FontCached::ReleaseId(FontID id_) { void FontCached::ReleaseId(FontID fid_) {
::EnterCriticalSection(&crPlatformLock); ::EnterCriticalSection(&crPlatformLock);
FontCached **pcur=&first; FontCached **pcur=&first;
for (FontCached *cur=first; cur; cur=cur->next) { for (FontCached *cur=first; cur; cur=cur->next) {
if (cur->id == id_) { if (cur->fid == fid_) {
cur->usage--; cur->usage--;
if (cur->usage == 0) { if (cur->usage == 0) {
*pcur = cur->next; *pcur = cur->next;
@ -287,7 +287,7 @@ void FontCached::ReleaseId(FontID id_) {
} }
Font::Font() { Font::Font() {
id = 0; fid = 0;
} }
Font::~Font() { Font::~Font() {
@ -301,21 +301,21 @@ void Font::Create(const char *faceName, int characterSet, int size,
#ifndef FONTS_CACHED #ifndef FONTS_CACHED
LOGFONT lf; LOGFONT lf;
SetLogFont(lf, faceName, characterSet, size, bold, italic); SetLogFont(lf, faceName, characterSet, size, bold, italic);
id = ::CreateFontIndirect(&lf); fid = ::CreateFontIndirect(&lf);
#else #else
id = FontCached::FindOrCreate(faceName, characterSet, size, bold, italic); fid = FontCached::FindOrCreate(faceName, characterSet, size, bold, italic);
#endif #endif
} }
void Font::Release() { void Font::Release() {
#ifndef FONTS_CACHED #ifndef FONTS_CACHED
if (id) if (fid)
::DeleteObject(id); ::DeleteObject(fid);
#else #else
if (id) if (fid)
FontCached::ReleaseId(id); FontCached::ReleaseId(fid);
#endif #endif
id = 0; fid = 0;
} }
#ifdef SCI_NAMESPACE #ifdef SCI_NAMESPACE
@ -969,28 +969,28 @@ Window::~Window() {
} }
void Window::Destroy() { void Window::Destroy() {
if (id) if (wid)
::DestroyWindow(reinterpret_cast<HWND>(id)); ::DestroyWindow(reinterpret_cast<HWND>(wid));
id = 0; wid = 0;
} }
bool Window::HasFocus() { bool Window::HasFocus() {
return ::GetFocus() == id; return ::GetFocus() == wid;
} }
PRectangle Window::GetPosition() { PRectangle Window::GetPosition() {
RECT rc; RECT rc;
::GetWindowRect(reinterpret_cast<HWND>(id), &rc); ::GetWindowRect(reinterpret_cast<HWND>(wid), &rc);
return PRectangle(rc.left, rc.top, rc.right, rc.bottom); return PRectangle(rc.left, rc.top, rc.right, rc.bottom);
} }
void Window::SetPosition(PRectangle rc) { void Window::SetPosition(PRectangle rc) {
::SetWindowPos(reinterpret_cast<HWND>(id), ::SetWindowPos(reinterpret_cast<HWND>(wid),
0, rc.left, rc.top, rc.Width(), rc.Height(), SWP_NOZORDER|SWP_NOACTIVATE); 0, rc.left, rc.top, rc.Width(), rc.Height(), SWP_NOZORDER|SWP_NOACTIVATE);
} }
void Window::SetPositionRelative(PRectangle rc, Window w) { void Window::SetPositionRelative(PRectangle rc, Window w) {
LONG style = ::GetWindowLong(reinterpret_cast<HWND>(id), GWL_STYLE); LONG style = ::GetWindowLong(reinterpret_cast<HWND>(wid), GWL_STYLE);
if (style & WS_POPUP) { if (style & WS_POPUP) {
RECT rcOther; RECT rcOther;
::GetWindowRect(reinterpret_cast<HWND>(w.GetID()), &rcOther); ::GetWindowRect(reinterpret_cast<HWND>(w.GetID()), &rcOther);
@ -1017,25 +1017,25 @@ void Window::SetPositionRelative(PRectangle rc, Window w) {
PRectangle Window::GetClientPosition() { PRectangle Window::GetClientPosition() {
RECT rc={0,0,0,0}; RECT rc={0,0,0,0};
if (id) if (wid)
::GetClientRect(reinterpret_cast<HWND>(id), &rc); ::GetClientRect(reinterpret_cast<HWND>(wid), &rc);
return PRectangle(rc.left, rc.top, rc.right, rc.bottom); return PRectangle(rc.left, rc.top, rc.right, rc.bottom);
} }
void Window::Show(bool show) { void Window::Show(bool show) {
if (show) if (show)
::ShowWindow(reinterpret_cast<HWND>(id), SW_SHOWNOACTIVATE); ::ShowWindow(reinterpret_cast<HWND>(wid), SW_SHOWNOACTIVATE);
else else
::ShowWindow(reinterpret_cast<HWND>(id), SW_HIDE); ::ShowWindow(reinterpret_cast<HWND>(wid), SW_HIDE);
} }
void Window::InvalidateAll() { void Window::InvalidateAll() {
::InvalidateRect(reinterpret_cast<HWND>(id), NULL, FALSE); ::InvalidateRect(reinterpret_cast<HWND>(wid), NULL, FALSE);
} }
void Window::InvalidateRectangle(PRectangle rc) { void Window::InvalidateRectangle(PRectangle rc) {
RECT rcw = RectFromPRectangle(rc); RECT rcw = RectFromPRectangle(rc);
::InvalidateRect(reinterpret_cast<HWND>(id), &rcw, FALSE); ::InvalidateRect(reinterpret_cast<HWND>(wid), &rcw, FALSE);
} }
static LRESULT Window_SendMessage(Window *w, UINT msg, WPARAM wParam=0, LPARAM lParam=0) { static LRESULT Window_SendMessage(Window *w, UINT msg, WPARAM wParam=0, LPARAM lParam=0) {
@ -1089,7 +1089,7 @@ void Window::SetCursor(Cursor curs) {
} }
void Window::SetTitle(const char *s) { void Window::SetTitle(const char *s) {
::SetWindowTextA(reinterpret_cast<HWND>(id), s); ::SetWindowTextA(reinterpret_cast<HWND>(wid), s);
} }
/* Returns rectangle of monitor pt is on, both rect and pt are in Window's /* Returns rectangle of monitor pt is on, both rect and pt are in Window's
@ -1329,7 +1329,7 @@ void ListBoxX::Create(Window &parent_, int ctrlID_, Point location_, int lineHei
HWND hwndParent = reinterpret_cast<HWND>(parent->GetID()); HWND hwndParent = reinterpret_cast<HWND>(parent->GetID());
HINSTANCE hinstanceParent = GetWindowInstance(hwndParent); HINSTANCE hinstanceParent = GetWindowInstance(hwndParent);
// Window created as popup so not clipped within parent client area // Window created as popup so not clipped within parent client area
id = ::CreateWindowEx( wid = ::CreateWindowEx(
WS_EX_WINDOWEDGE, ListBoxX_ClassName, TEXT(""), WS_EX_WINDOWEDGE, ListBoxX_ClassName, TEXT(""),
WS_POPUP | WS_THICKFRAME, WS_POPUP | WS_THICKFRAME,
100,100, 150,80, hwndParent, 100,100, 150,80, hwndParent,
@ -1555,7 +1555,6 @@ void ListBoxX::SetList(const char *list, char separator, char typesep) {
Clear(); Clear();
int size = strlen(list) + 1; int size = strlen(list) + 1;
char *words = new char[size]; char *words = new char[size];
if (words) {
lti.SetWords(words); lti.SetWords(words);
memcpy(words, list, size); memcpy(words, list, size);
char *startword = words; char *startword = words;
@ -1585,7 +1584,6 @@ void ListBoxX::SetList(const char *list, char separator, char typesep) {
for (int j=0; j<count; j++) { for (int j=0; j<count; j++) {
::SendMessage(lb, LB_ADDSTRING, 0, j+1); ::SendMessage(lb, LB_ADDSTRING, 0, j+1);
} }
}
SetRedraw(true); SetRedraw(true);
} }
@ -1809,6 +1807,7 @@ void ListBoxX::Paint(HDC hDC) {
} }
LRESULT PASCAL ListBoxX::ControlWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { LRESULT PASCAL ListBoxX::ControlWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
try {
switch (uMsg) { switch (uMsg) {
case WM_ERASEBKGND: case WM_ERASEBKGND:
return TRUE; return TRUE;
@ -1856,6 +1855,9 @@ LRESULT PASCAL ListBoxX::ControlWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPA
} else { } else {
return ::DefWindowProc(hWnd, uMsg, wParam, lParam); return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
} }
} catch (...) {
}
return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
} }
LRESULT ListBoxX::WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam) { LRESULT ListBoxX::WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam) {
@ -2003,22 +2005,22 @@ bool ListBoxX_Unregister() {
return ::UnregisterClass(ListBoxX_ClassName, hinstPlatformRes) != 0; return ::UnregisterClass(ListBoxX_ClassName, hinstPlatformRes) != 0;
} }
Menu::Menu() : id(0) { Menu::Menu() : mid(0) {
} }
void Menu::CreatePopUp() { void Menu::CreatePopUp() {
Destroy(); Destroy();
id = ::CreatePopupMenu(); mid = ::CreatePopupMenu();
} }
void Menu::Destroy() { void Menu::Destroy() {
if (id) if (mid)
::DestroyMenu(reinterpret_cast<HMENU>(id)); ::DestroyMenu(reinterpret_cast<HMENU>(mid));
id = 0; mid = 0;
} }
void Menu::Show(Point pt, Window &w) { void Menu::Show(Point pt, Window &w) {
::TrackPopupMenu(reinterpret_cast<HMENU>(id), ::TrackPopupMenu(reinterpret_cast<HMENU>(mid),
0, pt.x - 4, pt.y, 0, 0, pt.x - 4, pt.y, 0,
reinterpret_cast<HWND>(w.GetID()), NULL); reinterpret_cast<HWND>(w.GetID()), NULL);
Destroy(); Destroy();

View File

@ -9,8 +9,8 @@
#include "PlatformRes.h" #include "PlatformRes.h"
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1, 7, 8, 0 FILEVERSION 2, 0, 1, 0
PRODUCTVERSION 1, 7, 8, 0 PRODUCTVERSION 2, 0, 1, 0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
FILEFLAGS 0 FILEFLAGS 0
FILEOS VOS_NT_WINDOWS32 FILEOS VOS_NT_WINDOWS32
@ -27,12 +27,12 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "Neil Hodgson neilh@scintilla.org\0" VALUE "CompanyName", "Neil Hodgson neilh@scintilla.org\0"
VALUE "FileDescription", "Scintilla.DLL - a Source Editing Component\0" VALUE "FileDescription", "Scintilla.DLL - a Source Editing Component\0"
VALUE "FileVersion", "1.78\0" VALUE "FileVersion", "2.01\0"
VALUE "InternalName", "Scintilla\0" VALUE "InternalName", "Scintilla\0"
VALUE "LegalCopyright", "Copyright 1998-2009 by Neil Hodgson\0" VALUE "LegalCopyright", "Copyright 1998-2009 by Neil Hodgson\0"
VALUE "OriginalFilename", "Scintilla.DLL\0" VALUE "OriginalFilename", "Scintilla.DLL\0"
VALUE "ProductName", "Scintilla\0" VALUE "ProductName", "Scintilla\0"
VALUE "ProductVersion", "1.78\0" VALUE "ProductVersion", "2.01\0"
END END
END END
END END

View File

@ -5,6 +5,7 @@
// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org> // Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed. // The License.txt file describes the conditions under which this software may be distributed.
#include <new>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
@ -12,6 +13,9 @@
#include <assert.h> #include <assert.h>
#include <limits.h> #include <limits.h>
#include <string>
#include <vector>
#define _WIN32_WINNT 0x0500 #define _WIN32_WINNT 0x0500
#include <windows.h> #include <windows.h>
#include <commctrl.h> #include <commctrl.h>
@ -21,10 +25,10 @@
#include "Platform.h" #include "Platform.h"
#include "Scintilla.h" #include "Scintilla.h"
#include "SString.h"
#ifdef SCI_LEXER #ifdef SCI_LEXER
#include "SciLexer.h" #include "SciLexer.h"
#include "PropSet.h" #include "PropSet.h"
#include "PropSetSimple.h"
#include "Accessor.h" #include "Accessor.h"
#include "KeyWords.h" #include "KeyWords.h"
#endif #endif
@ -44,6 +48,7 @@
#include "CharClassify.h" #include "CharClassify.h"
#include "Decoration.h" #include "Decoration.h"
#include "Document.h" #include "Document.h"
#include "Selection.h"
#include "PositionCache.h" #include "PositionCache.h"
#include "Editor.h" #include "Editor.h"
#include "ScintillaBase.h" #include "ScintillaBase.h"
@ -237,7 +242,7 @@ class ScintillaWin :
virtual bool GetScrollInfo(int nBar, LPSCROLLINFO lpsi); virtual bool GetScrollInfo(int nBar, LPSCROLLINFO lpsi);
void ChangeScrollPos(int barType, int pos); void ChangeScrollPos(int barType, int pos);
void InsertPasteText(const char *text, int len, int selStart, bool isRectangular, bool isLine); void InsertPasteText(const char *text, int len, SelectionPosition selStart, bool isRectangular, bool isLine);
public: public:
// Public for benefit of Scintilla_DirectFunction // Public for benefit of Scintilla_DirectFunction
@ -339,7 +344,6 @@ void ScintillaWin::Finalise() {
ScintillaBase::Finalise(); ScintillaBase::Finalise();
SetTicking(false); SetTicking(false);
SetIdle(false); SetIdle(false);
DestroySystemCaret();
::RevokeDragDrop(MainHWND()); ::RevokeDragDrop(MainHWND());
if (SUCCEEDED(hrOle)) { if (SUCCEEDED(hrOle)) {
::OleUninitialize(); ::OleUninitialize();
@ -376,7 +380,7 @@ void ScintillaWin::StartDrag() {
} }
} }
inDragDrop = ddNone; inDragDrop = ddNone;
SetDragPosition(invalidPosition); SetDragPosition(SelectionPosition(invalidPosition));
} }
// Avoid warnings everywhere for old style casts by concentrating them here // Avoid warnings everywhere for old style casts by concentrating them here
@ -522,7 +526,7 @@ sptr_t ScintillaWin::HandleComposition(uptr_t wParam, sptr_t lParam) {
} }
} }
// Set new position after converted // Set new position after converted
Point pos = LocationFromPosition(currentPos); Point pos = PointMainCaret();
COMPOSITIONFORM CompForm; COMPOSITIONFORM CompForm;
CompForm.dwStyle = CFS_POINT; CompForm.dwStyle = CFS_POINT;
CompForm.ptCurrentPos.x = pos.x; CompForm.ptCurrentPos.x = pos.x;
@ -585,6 +589,7 @@ static UINT CodePageFromCharSet(DWORD characterSet, UINT documentCodePage) {
} }
sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
try {
//Platform::DebugPrintf("S M:%x WP:%x L:%x\n", iMessage, wParam, lParam); //Platform::DebugPrintf("S M:%x WP:%x L:%x\n", iMessage, wParam, lParam);
iMessage = SciMessageFromEM(iMessage); iMessage = SciMessageFromEM(iMessage);
switch (iMessage) { switch (iMessage) {
@ -905,7 +910,7 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam
Point pt = Point::FromLong(lParam); Point pt = Point::FromLong(lParam);
if ((pt.x == -1) && (pt.y == -1)) { if ((pt.x == -1) && (pt.y == -1)) {
// Caused by keyboard so display menu near caret // Caused by keyboard so display menu near caret
pt = LocationFromPosition(currentPos); pt = PointMainCaret();
POINT spt = {pt.x, pt.y}; POINT spt = {pt.x, pt.y};
::ClientToScreen(MainHWND(), &spt); ::ClientToScreen(MainHWND(), &spt);
pt = Point(spt.x, spt.y); pt = Point(spt.x, spt.y);
@ -949,7 +954,7 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam
case EM_LINEFROMCHAR: case EM_LINEFROMCHAR:
if (static_cast<int>(wParam) < 0) { if (static_cast<int>(wParam) < 0) {
wParam = SelectionStart(); wParam = SelectionStart().Position();
} }
return pdoc->LineFromPosition(wParam); return pdoc->LineFromPosition(wParam);
@ -958,20 +963,20 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam
case EM_GETSEL: case EM_GETSEL:
if (wParam) { if (wParam) {
*reinterpret_cast<int *>(wParam) = SelectionStart(); *reinterpret_cast<int *>(wParam) = SelectionStart().Position();
} }
if (lParam) { if (lParam) {
*reinterpret_cast<int *>(lParam) = SelectionEnd(); *reinterpret_cast<int *>(lParam) = SelectionEnd().Position();
} }
return MAKELONG(SelectionStart(), SelectionEnd()); return MAKELONG(SelectionStart().Position(), SelectionEnd().Position());
case EM_EXGETSEL: { case EM_EXGETSEL: {
if (lParam == 0) { if (lParam == 0) {
return 0; return 0;
} }
CharacterRange *pCR = reinterpret_cast<CharacterRange *>(lParam); Sci_CharacterRange *pCR = reinterpret_cast<Sci_CharacterRange *>(lParam);
pCR->cpMin = SelectionStart(); pCR->cpMin = SelectionStart().Position();
pCR->cpMax = SelectionEnd(); pCR->cpMax = SelectionEnd().Position();
} }
break; break;
@ -997,15 +1002,15 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam
if (lParam == 0) { if (lParam == 0) {
return 0; return 0;
} }
CharacterRange *pCR = reinterpret_cast<CharacterRange *>(lParam); Sci_CharacterRange *pCR = reinterpret_cast<Sci_CharacterRange *>(lParam);
selType = selStream; sel.selType = Selection::selStream;
if (pCR->cpMin == 0 && pCR->cpMax == -1) { if (pCR->cpMin == 0 && pCR->cpMax == -1) {
SetSelection(pCR->cpMin, pdoc->Length()); SetSelection(pCR->cpMin, pdoc->Length());
} else { } else {
SetSelection(pCR->cpMin, pCR->cpMax); SetSelection(pCR->cpMin, pCR->cpMax);
} }
EnsureCaretVisible(); EnsureCaretVisible();
return pdoc->LineFromPosition(SelectionStart()); return pdoc->LineFromPosition(SelectionStart().Position());
} }
case SCI_GETDIRECTFUNCTION: case SCI_GETDIRECTFUNCTION:
@ -1034,6 +1039,11 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam
default: default:
return ScintillaBase::WndProc(iMessage, wParam, lParam); return ScintillaBase::WndProc(iMessage, wParam, lParam);
} }
} catch (std::bad_alloc&) {
errorStatus = SC_STATUS_BADALLOC;
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
return 0l; return 0l;
} }
@ -1132,7 +1142,7 @@ void ScintillaWin::UpdateSystemCaret() {
DestroySystemCaret(); DestroySystemCaret();
CreateSystemCaret(); CreateSystemCaret();
} }
Point pos = LocationFromPosition(currentPos); Point pos = PointMainCaret();
::SetCaretPos(pos.x, pos.y); ::SetCaretPos(pos.x, pos.y);
} }
} }
@ -1256,7 +1266,7 @@ void ScintillaWin::NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt)
void ScintillaWin::Copy() { void ScintillaWin::Copy() {
//Platform::DebugPrintf("Copy\n"); //Platform::DebugPrintf("Copy\n");
if (currentPos != anchor) { if (!sel.Empty()) {
SelectionText selectedText; SelectionText selectedText;
CopySelectionRange(&selectedText); CopySelectionRange(&selectedText);
CopyToClipboard(selectedText); CopyToClipboard(selectedText);
@ -1318,7 +1328,7 @@ public:
} }
}; };
void ScintillaWin::InsertPasteText(const char *text, int len, int selStart, bool isRectangular, bool isLine) { void ScintillaWin::InsertPasteText(const char *text, int len, SelectionPosition selStart, bool isRectangular, bool isLine) {
if (isRectangular) { if (isRectangular) {
PasteRectangular(selStart, text, len); PasteRectangular(selStart, text, len);
} else { } else {
@ -1329,7 +1339,7 @@ void ScintillaWin::InsertPasteText(const char *text, int len, int selStart, bool
text = convertedText; text = convertedText;
} }
if (isLine) { if (isLine) {
int insertPos = pdoc->LineStart(pdoc->LineFromPosition(currentPos)); int insertPos = pdoc->LineStart(pdoc->LineFromPosition(sel.MainCaret()));
pdoc->InsertString(insertPos, text, len); pdoc->InsertString(insertPos, text, len);
// add the newline if necessary // add the newline if necessary
if ((len > 0) && (text[len-1] != '\n' && text[len-1] != '\r')) { if ((len > 0) && (text[len-1] != '\n' && text[len-1] != '\r')) {
@ -1337,11 +1347,14 @@ void ScintillaWin::InsertPasteText(const char *text, int len, int selStart, bool
pdoc->InsertString(insertPos + len, endline, strlen(endline)); pdoc->InsertString(insertPos + len, endline, strlen(endline));
len += strlen(endline); len += strlen(endline);
} }
if (currentPos == insertPos) { if (sel.MainCaret() == insertPos) {
SetEmptySelection(currentPos + len); SetEmptySelection(sel.MainCaret() + len);
}
} else {
selStart = SelectionPosition(InsertSpace(selStart.Position(), selStart.VirtualSpace()));
if (pdoc->InsertString(selStart.Position(), text, len)) {
SetEmptySelection(selStart.Position() + len);
} }
} else if (pdoc->InsertString(currentPos, text, len)) {
SetEmptySelection(currentPos + len);
} }
delete []convertedText; delete []convertedText;
} }
@ -1350,10 +1363,10 @@ void ScintillaWin::InsertPasteText(const char *text, int len, int selStart, bool
void ScintillaWin::Paste() { void ScintillaWin::Paste() {
if (!::OpenClipboard(MainHWND())) if (!::OpenClipboard(MainHWND()))
return; return;
pdoc->BeginUndoAction(); UndoGroup ug(pdoc);
bool isLine = SelectionEmpty() && (::IsClipboardFormatAvailable(cfLineSelect) != 0); bool isLine = SelectionEmpty() && (::IsClipboardFormatAvailable(cfLineSelect) != 0);
ClearSelection(); ClearSelection();
int selStart = SelectionStart(); SelectionPosition selStart = sel.Range(sel.Main()).Start();
bool isRectangular = ::IsClipboardFormatAvailable(cfColumnSelect) != 0; bool isRectangular = ::IsClipboardFormatAvailable(cfColumnSelect) != 0;
// Always use CF_UNICODETEXT if available // Always use CF_UNICODETEXT if available
@ -1368,9 +1381,7 @@ void ScintillaWin::Paste() {
unsigned int bytes = memUSelection.Size(); unsigned int bytes = memUSelection.Size();
len = UTF8Length(uptr, bytes / 2); len = UTF8Length(uptr, bytes / 2);
putf = new char[len + 1]; putf = new char[len + 1];
if (putf) {
UTF8FromUTF16(uptr, bytes / 2, putf, len); UTF8FromUTF16(uptr, bytes / 2, putf, len);
}
} else { } else {
// CF_UNICODETEXT available, but not in Unicode mode // CF_UNICODETEXT available, but not in Unicode mode
// Convert from Unicode to current Scintilla code page // Convert from Unicode to current Scintilla code page
@ -1379,17 +1390,13 @@ void ScintillaWin::Paste() {
len = ::WideCharToMultiByte(cpDest, 0, uptr, -1, len = ::WideCharToMultiByte(cpDest, 0, uptr, -1,
NULL, 0, NULL, NULL) - 1; // subtract 0 terminator NULL, 0, NULL, NULL) - 1; // subtract 0 terminator
putf = new char[len + 1]; putf = new char[len + 1];
if (putf) {
::WideCharToMultiByte(cpDest, 0, uptr, -1, ::WideCharToMultiByte(cpDest, 0, uptr, -1,
putf, len + 1, NULL, NULL); putf, len + 1, NULL, NULL);
} }
}
if (putf) {
InsertPasteText(putf, len, selStart, isRectangular, isLine); InsertPasteText(putf, len, selStart, isRectangular, isLine);
delete []putf; delete []putf;
} }
}
memUSelection.Unlock(); memUSelection.Unlock();
} else { } else {
// CF_UNICODETEXT not available, paste ANSI text // CF_UNICODETEXT not available, paste ANSI text
@ -1432,8 +1439,6 @@ void ScintillaWin::Paste() {
} }
} }
::CloseClipboard(); ::CloseClipboard();
pdoc->EndUndoAction();
NotifyChange();
Redraw(); Redraw();
} }
@ -1548,7 +1553,12 @@ STDMETHODIMP FormatEnumerator_Reset(FormatEnumerator *fe) {
return S_OK; return S_OK;
} }
STDMETHODIMP FormatEnumerator_Clone(FormatEnumerator *fe, IEnumFORMATETC **ppenum) { STDMETHODIMP FormatEnumerator_Clone(FormatEnumerator *fe, IEnumFORMATETC **ppenum) {
FormatEnumerator *pfe = new FormatEnumerator(fe->pos, fe->formats, fe->formatsLen); FormatEnumerator *pfe;
try {
pfe = new FormatEnumerator(fe->pos, fe->formats, fe->formatsLen);
} catch (...) {
return E_OUTOFMEMORY;
}
return FormatEnumerator_QueryInterface(pfe, IID_IEnumFORMATETC, return FormatEnumerator_QueryInterface(pfe, IID_IEnumFORMATETC,
reinterpret_cast<void **>(ppenum)); reinterpret_cast<void **>(ppenum));
} }
@ -1675,6 +1685,7 @@ STDMETHODIMP DataObject_SetData(DataObject *, FORMATETC *, STGMEDIUM *, BOOL) {
} }
STDMETHODIMP DataObject_EnumFormatEtc(DataObject *pd, DWORD dwDirection, IEnumFORMATETC **ppEnum) { STDMETHODIMP DataObject_EnumFormatEtc(DataObject *pd, DWORD dwDirection, IEnumFORMATETC **ppEnum) {
try {
//Platform::DebugPrintf("DOB EnumFormatEtc %d\n", dwDirection); //Platform::DebugPrintf("DOB EnumFormatEtc %d\n", dwDirection);
if (dwDirection != DATADIR_GET) { if (dwDirection != DATADIR_GET) {
*ppEnum = 0; *ppEnum = 0;
@ -1690,6 +1701,13 @@ STDMETHODIMP DataObject_EnumFormatEtc(DataObject *pd, DWORD dwDirection, IEnumFO
} }
return FormatEnumerator_QueryInterface(pfe, IID_IEnumFORMATETC, return FormatEnumerator_QueryInterface(pfe, IID_IEnumFORMATETC,
reinterpret_cast<void **>(ppEnum)); reinterpret_cast<void **>(ppEnum));
} catch (std::bad_alloc&) {
pd->sci->errorStatus = SC_STATUS_BADALLOC;
return E_OUTOFMEMORY;
} catch (...) {
pd->sci->errorStatus = SC_STATUS_FAILURE;
return E_FAIL;
}
} }
STDMETHODIMP DataObject_DAdvise(DataObject *, FORMATETC *, DWORD, IAdviseSink *, PDWORD) { STDMETHODIMP DataObject_DAdvise(DataObject *, FORMATETC *, DWORD, IAdviseSink *, PDWORD) {
@ -1742,17 +1760,37 @@ STDMETHODIMP_(ULONG)DropTarget_Release(DropTarget *dt) {
/// Implement IDropTarget by forwarding to Scintilla /// Implement IDropTarget by forwarding to Scintilla
STDMETHODIMP DropTarget_DragEnter(DropTarget *dt, LPDATAOBJECT pIDataSource, DWORD grfKeyState, STDMETHODIMP DropTarget_DragEnter(DropTarget *dt, LPDATAOBJECT pIDataSource, DWORD grfKeyState,
POINTL pt, PDWORD pdwEffect) { POINTL pt, PDWORD pdwEffect) {
try {
return dt->sci->DragEnter(pIDataSource, grfKeyState, pt, pdwEffect); return dt->sci->DragEnter(pIDataSource, grfKeyState, pt, pdwEffect);
} catch (...) {
dt->sci->errorStatus = SC_STATUS_FAILURE;
}
return E_FAIL;
} }
STDMETHODIMP DropTarget_DragOver(DropTarget *dt, DWORD grfKeyState, POINTL pt, PDWORD pdwEffect) { STDMETHODIMP DropTarget_DragOver(DropTarget *dt, DWORD grfKeyState, POINTL pt, PDWORD pdwEffect) {
try {
return dt->sci->DragOver(grfKeyState, pt, pdwEffect); return dt->sci->DragOver(grfKeyState, pt, pdwEffect);
} catch (...) {
dt->sci->errorStatus = SC_STATUS_FAILURE;
}
return E_FAIL;
} }
STDMETHODIMP DropTarget_DragLeave(DropTarget *dt) { STDMETHODIMP DropTarget_DragLeave(DropTarget *dt) {
try {
return dt->sci->DragLeave(); return dt->sci->DragLeave();
} catch (...) {
dt->sci->errorStatus = SC_STATUS_FAILURE;
}
return E_FAIL;
} }
STDMETHODIMP DropTarget_Drop(DropTarget *dt, LPDATAOBJECT pIDataSource, DWORD grfKeyState, STDMETHODIMP DropTarget_Drop(DropTarget *dt, LPDATAOBJECT pIDataSource, DWORD grfKeyState,
POINTL pt, PDWORD pdwEffect) { POINTL pt, PDWORD pdwEffect) {
try {
return dt->sci->Drop(pIDataSource, grfKeyState, pt, pdwEffect); return dt->sci->Drop(pIDataSource, grfKeyState, pt, pdwEffect);
} catch (...) {
dt->sci->errorStatus = SC_STATUS_FAILURE;
}
return E_FAIL;
} }
static void *vtDropTarget[] = { static void *vtDropTarget[] = {
@ -1780,7 +1818,7 @@ void ScintillaWin::ImeStartComposition() {
if (caret.active) { if (caret.active) {
// Move IME Window to current caret position // Move IME Window to current caret position
HIMC hIMC = ::ImmGetContext(MainHWND()); HIMC hIMC = ::ImmGetContext(MainHWND());
Point pos = LocationFromPosition(currentPos); Point pos = PointMainCaret();
COMPOSITIONFORM CompForm; COMPOSITIONFORM CompForm;
CompForm.dwStyle = CFS_POINT; CompForm.dwStyle = CFS_POINT;
CompForm.ptCurrentPos.x = pos.x; CompForm.ptCurrentPos.x = pos.x;
@ -1792,7 +1830,7 @@ void ScintillaWin::ImeStartComposition() {
if (stylesValid) { if (stylesValid) {
// Since the style creation code has been made platform independent, // Since the style creation code has been made platform independent,
// The logfont for the IME is recreated here. // The logfont for the IME is recreated here.
int styleHere = (pdoc->StyleAt(currentPos)) & 31; int styleHere = (pdoc->StyleAt(sel.MainCaret())) & 31;
LOGFONTA lf = {0,0,0,0,0,0,0,0,0,0,0,0,0, ""}; LOGFONTA lf = {0,0,0,0,0,0,0,0,0,0,0,0,0, ""};
int sizeZoomed = vs.styles[styleHere].size + vs.zoomLevel; int sizeZoomed = vs.styles[styleHere].size + vs.zoomLevel;
if (sizeZoomed <= 2) // Hangs if sizeZoomed <= 1 if (sizeZoomed <= 2) // Hangs if sizeZoomed <= 1
@ -2116,6 +2154,7 @@ STDMETHODIMP ScintillaWin::DragEnter(LPDATAOBJECT pIDataSource, DWORD grfKeyStat
} }
STDMETHODIMP ScintillaWin::DragOver(DWORD grfKeyState, POINTL pt, PDWORD pdwEffect) { STDMETHODIMP ScintillaWin::DragOver(DWORD grfKeyState, POINTL pt, PDWORD pdwEffect) {
try {
if (!hasOKText || pdoc->IsReadOnly()) { if (!hasOKText || pdoc->IsReadOnly()) {
*pdwEffect = DROPEFFECT_NONE; *pdwEffect = DROPEFFECT_NONE;
return S_OK; return S_OK;
@ -2126,24 +2165,34 @@ STDMETHODIMP ScintillaWin::DragOver(DWORD grfKeyState, POINTL pt, PDWORD pdwEffe
// Update the cursor. // Update the cursor.
POINT rpt = {pt.x, pt.y}; POINT rpt = {pt.x, pt.y};
::ScreenToClient(MainHWND(), &rpt); ::ScreenToClient(MainHWND(), &rpt);
SetDragPosition(PositionFromLocation(Point(rpt.x, rpt.y))); SetDragPosition(SPositionFromLocation(Point(rpt.x, rpt.y), false, false, UserVirtualSpace()));
return S_OK; return S_OK;
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
return E_FAIL;
} }
STDMETHODIMP ScintillaWin::DragLeave() { STDMETHODIMP ScintillaWin::DragLeave() {
SetDragPosition(invalidPosition); try {
SetDragPosition(SelectionPosition(invalidPosition));
return S_OK; return S_OK;
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
return E_FAIL;
} }
STDMETHODIMP ScintillaWin::Drop(LPDATAOBJECT pIDataSource, DWORD grfKeyState, STDMETHODIMP ScintillaWin::Drop(LPDATAOBJECT pIDataSource, DWORD grfKeyState,
POINTL pt, PDWORD pdwEffect) { POINTL pt, PDWORD pdwEffect) {
try {
*pdwEffect = EffectFromState(grfKeyState); *pdwEffect = EffectFromState(grfKeyState);
if (pIDataSource == NULL) if (pIDataSource == NULL)
return E_POINTER; return E_POINTER;
SetDragPosition(invalidPosition); SetDragPosition(SelectionPosition(invalidPosition));
STGMEDIUM medium={0,{0},0}; STGMEDIUM medium={0,{0},0};
@ -2159,10 +2208,8 @@ STDMETHODIMP ScintillaWin::Drop(LPDATAOBJECT pIDataSource, DWORD grfKeyState,
// Convert UTF-16 to UTF-8 // Convert UTF-16 to UTF-8
int dataLen = UTF8Length(udata, tlen/2); int dataLen = UTF8Length(udata, tlen/2);
data = new char[dataLen+1]; data = new char[dataLen+1];
if (data) {
UTF8FromUTF16(udata, tlen/2, data, dataLen); UTF8FromUTF16(udata, tlen/2, data, dataLen);
dataAllocated = true; dataAllocated = true;
}
} else { } else {
// Convert UTF-16 to ANSI // Convert UTF-16 to ANSI
// //
@ -2174,14 +2221,12 @@ STDMETHODIMP ScintillaWin::Drop(LPDATAOBJECT pIDataSource, DWORD grfKeyState,
int tlen = ::WideCharToMultiByte(cpDest, 0, udata, -1, int tlen = ::WideCharToMultiByte(cpDest, 0, udata, -1,
NULL, 0, NULL, NULL) - 1; // subtract 0 terminator NULL, 0, NULL, NULL) - 1; // subtract 0 terminator
data = new char[tlen + 1]; data = new char[tlen + 1];
if (data) {
memset(data, 0, (tlen+1)); memset(data, 0, (tlen+1));
::WideCharToMultiByte(cpDest, 0, udata, -1, ::WideCharToMultiByte(cpDest, 0, udata, -1,
data, tlen + 1, NULL, NULL); data, tlen + 1, NULL, NULL);
dataAllocated = true; dataAllocated = true;
} }
} }
}
if (!data) { if (!data) {
FORMATETC fmte = {CF_TEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; FORMATETC fmte = {CF_TEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
@ -2201,7 +2246,7 @@ STDMETHODIMP ScintillaWin::Drop(LPDATAOBJECT pIDataSource, DWORD grfKeyState,
POINT rpt = {pt.x, pt.y}; POINT rpt = {pt.x, pt.y};
::ScreenToClient(MainHWND(), &rpt); ::ScreenToClient(MainHWND(), &rpt);
int movePos = PositionFromLocation(Point(rpt.x, rpt.y)); SelectionPosition movePos = SPositionFromLocation(Point(rpt.x, rpt.y), false, false, UserVirtualSpace());
DropAt(movePos, data, *pdwEffect == DROPEFFECT_MOVE, hrRectangular == S_OK); DropAt(movePos, data, *pdwEffect == DROPEFFECT_MOVE, hrRectangular == S_OK);
@ -2217,6 +2262,10 @@ STDMETHODIMP ScintillaWin::Drop(LPDATAOBJECT pIDataSource, DWORD grfKeyState,
delete []data; delete []data;
return S_OK; return S_OK;
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
return E_FAIL;
} }
/// Implement important part of IDataObject /// Implement important part of IDataObject
@ -2383,9 +2432,9 @@ static void SetWindowPointer(HWND hWnd, void *ptr) {
sptr_t PASCAL ScintillaWin::CTWndProc( sptr_t PASCAL ScintillaWin::CTWndProc(
HWND hWnd, UINT iMessage, WPARAM wParam, sptr_t lParam) { HWND hWnd, UINT iMessage, WPARAM wParam, sptr_t lParam) {
// Find C++ object associated with window. // Find C++ object associated with window.
ScintillaWin *sciThis = reinterpret_cast<ScintillaWin *>(PointerFromWindow(hWnd)); ScintillaWin *sciThis = reinterpret_cast<ScintillaWin *>(PointerFromWindow(hWnd));
try {
// ctp will be zero if WM_CREATE not seen yet // ctp will be zero if WM_CREATE not seen yet
if (sciThis == 0) { if (sciThis == 0) {
if (iMessage == WM_CREATE) { if (iMessage == WM_CREATE) {
@ -2436,6 +2485,10 @@ sptr_t PASCAL ScintillaWin::CTWndProc(
return ::DefWindowProc(hWnd, iMessage, wParam, lParam); return ::DefWindowProc(hWnd, iMessage, wParam, lParam);
} }
} }
} catch (...) {
sciThis->errorStatus = SC_STATUS_FAILURE;
}
return ::DefWindowProc(hWnd, iMessage, wParam, lParam);
} }
sptr_t ScintillaWin::DirectFunction( sptr_t ScintillaWin::DirectFunction(
@ -2461,18 +2514,23 @@ sptr_t PASCAL ScintillaWin::SWndProc(
ScintillaWin *sci = reinterpret_cast<ScintillaWin *>(PointerFromWindow(hWnd)); ScintillaWin *sci = reinterpret_cast<ScintillaWin *>(PointerFromWindow(hWnd));
// sci will be zero if WM_CREATE not seen yet // sci will be zero if WM_CREATE not seen yet
if (sci == 0) { if (sci == 0) {
try {
if (iMessage == WM_CREATE) { if (iMessage == WM_CREATE) {
// Create C++ object associated with window // Create C++ object associated with window
sci = new ScintillaWin(hWnd); sci = new ScintillaWin(hWnd);
SetWindowPointer(hWnd, sci); SetWindowPointer(hWnd, sci);
return sci->WndProc(iMessage, wParam, lParam); return sci->WndProc(iMessage, wParam, lParam);
} else {
return ::DefWindowProc(hWnd, iMessage, wParam, lParam);
} }
} catch (...) {
}
return ::DefWindowProc(hWnd, iMessage, wParam, lParam);
} else { } else {
if (iMessage == WM_NCDESTROY) { if (iMessage == WM_NCDESTROY) {
try {
sci->Finalise(); sci->Finalise();
delete sci; delete sci;
} catch (...) {
}
::SetWindowLong(hWnd, 0, 0); ::SetWindowLong(hWnd, 0, 0);
return ::DefWindowProc(hWnd, iMessage, wParam, lParam); return ::DefWindowProc(hWnd, iMessage, wParam, lParam);
} else { } else {

View File

@ -1,7 +1,7 @@
PlatWin.o: PlatWin.cxx ../include/Platform.h PlatformRes.h \ PlatWin.o: PlatWin.cxx ../include/Platform.h PlatformRes.h \
../src/UniConversion.h ../src/XPM.h ../src/UniConversion.h ../src/XPM.h
ScintillaWin.o: ScintillaWin.cxx ../include/Platform.h \ ScintillaWin.o: ScintillaWin.cxx ../include/Platform.h \
../include/Scintilla.h ../include/SString.h ../src/ContractionState.h \ ../include/Scintilla.h ../src/ContractionState.h \
../src/SVector.h ../src/SplitVector.h ../src/Partitioning.h \ ../src/SVector.h ../src/SplitVector.h ../src/Partitioning.h \
../src/RunStyles.h ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h \ ../src/RunStyles.h ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h \
../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \ ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \
@ -9,7 +9,7 @@ ScintillaWin.o: ScintillaWin.cxx ../include/Platform.h \
../src/Decoration.h ../src/Document.h ../src/Editor.h \ ../src/Decoration.h ../src/Document.h ../src/Editor.h \
../src/ScintillaBase.h ../src/UniConversion.h ../src/ScintillaBase.h ../src/UniConversion.h
AutoComplete.o: ../src/AutoComplete.cxx ../include/Platform.h \ AutoComplete.o: ../src/AutoComplete.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../src/AutoComplete.h ../include/PropSet.h ../src/AutoComplete.h
CallTip.o: ../src/CallTip.cxx ../include/Platform.h \ CallTip.o: ../src/CallTip.cxx ../include/Platform.h \
../include/Scintilla.h ../src/CallTip.h ../include/Scintilla.h ../src/CallTip.h
CellBuffer.o: ../src/CellBuffer.cxx ../include/Platform.h \ CellBuffer.o: ../src/CellBuffer.cxx ../include/Platform.h \
@ -27,7 +27,7 @@ Document.o: ../src/Document.cxx ../include/Platform.h \
../src/CharClassify.h ../src/Decoration.h ../src/Document.h \ ../src/CharClassify.h ../src/Decoration.h ../src/Document.h \
../src/RESearch.h ../src/RESearch.h
DocumentAccessor.o: ../src/DocumentAccessor.cxx ../include/Platform.h \ DocumentAccessor.o: ../src/DocumentAccessor.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../src/SVector.h \ ../include/PropSet.h ../src/SVector.h \
../include/Accessor.h ../src/DocumentAccessor.h ../src/SplitVector.h \ ../include/Accessor.h ../src/DocumentAccessor.h ../src/SplitVector.h \
../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \ ../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \
../include/Scintilla.h ../src/CharClassify.h ../src/Decoration.h \ ../include/Scintilla.h ../src/CharClassify.h ../src/Decoration.h \
@ -40,228 +40,226 @@ Editor.o: ../src/Editor.cxx ../include/Platform.h ../include/Scintilla.h \
../src/Decoration.h ../src/Document.h ../src/Editor.h ../src/Decoration.h ../src/Document.h ../src/Editor.h
ExternalLexer.o: ../src/ExternalLexer.cxx ../include/Platform.h \ ExternalLexer.o: ../src/ExternalLexer.cxx ../include/Platform.h \
../include/Scintilla.h ../include/SciLexer.h ../include/PropSet.h \ ../include/Scintilla.h ../include/SciLexer.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/DocumentAccessor.h \ ../include/Accessor.h ../src/DocumentAccessor.h \
../include/KeyWords.h ../src/ExternalLexer.h ../include/KeyWords.h ../src/ExternalLexer.h
Indicator.o: ../src/Indicator.cxx ../include/Platform.h \ Indicator.o: ../src/Indicator.cxx ../include/Platform.h \
../include/Scintilla.h ../src/Indicator.h ../include/Scintilla.h ../src/Indicator.h
KeyMap.o: ../src/KeyMap.cxx ../include/Platform.h ../include/Scintilla.h \ KeyMap.o: ../src/KeyMap.cxx ../include/Platform.h ../include/Scintilla.h \
../src/KeyMap.h ../src/KeyMap.h
KeyWords.o: ../src/KeyWords.cxx ../include/Platform.h \ KeyWords.o: ../src/KeyWords.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexAda.o: ../src/LexAda.cxx ../include/Platform.h ../include/Accessor.h \ LexAda.o: ../src/LexAda.cxx ../include/Platform.h ../include/Accessor.h \
../src/StyleContext.h ../include/PropSet.h ../include/SString.h \ ../src/StyleContext.h ../include/PropSet.h \
../include/KeyWords.h ../include/SciLexer.h ../include/SString.h ../include/KeyWords.h ../include/SciLexer.h
LexAPDL.o: ../src/LexAPDL.cxx ../include/Platform.h ../include/PropSet.h \ LexAPDL.o: ../src/LexAPDL.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexAsm.o: ../src/LexAsm.cxx ../include/Platform.h ../include/PropSet.h \ LexAsm.o: ../src/LexAsm.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexAsn1.o: ../src/LexAsn1.cxx ../include/Platform.h ../include/PropSet.h \ LexAsn1.o: ../src/LexAsn1.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexAU3.o: ../src/LexAU3.cxx ../include/Platform.h ../include/PropSet.h \ LexAU3.o: ../src/LexAU3.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexAVE.o: ../src/LexAVE.cxx ../include/Platform.h ../include/PropSet.h \ LexAVE.o: ../src/LexAVE.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexBaan.o: ../src/LexBaan.cxx ../include/Platform.h ../include/PropSet.h \ LexBaan.o: ../src/LexBaan.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexBash.o: ../src/LexBash.cxx ../include/Platform.h ../include/PropSet.h \ LexBash.o: ../src/LexBash.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../include/KeyWords.h \ ../include/Accessor.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h ../include/Scintilla.h ../include/SciLexer.h
LexBasic.o: ../src/LexBasic.cxx ../include/Platform.h \ LexBasic.o: ../src/LexBasic.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h ../include/SciLexer.h
LexBullant.o: ../src/LexBullant.cxx ../include/Platform.h \ LexBullant.o: ../src/LexBullant.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexCaml.o: ../src/LexCaml.cxx ../include/Platform.h ../include/PropSet.h \ LexCaml.o: ../src/LexCaml.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexCLW.o: ../src/LexCLW.cxx ../include/Platform.h ../include/PropSet.h \ LexCLW.o: ../src/LexCLW.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexCmake.o: ../src/LexCmake.cxx ../include/Platform.h \ LexCmake.o: ../src/LexCmake.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexConf.o: ../src/LexConf.cxx ../include/Platform.h ../include/PropSet.h \ LexConf.o: ../src/LexConf.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../include/KeyWords.h \ ../include/Accessor.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h ../include/Scintilla.h ../include/SciLexer.h
LexCPP.o: ../src/LexCPP.cxx ../include/Platform.h ../include/PropSet.h \ LexCPP.o: ../src/LexCPP.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexCrontab.o: ../src/LexCrontab.cxx ../include/Platform.h \ LexCrontab.o: ../src/LexCrontab.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexCsound.o: ../src/LexCsound.cxx ../include/Platform.h \ LexCsound.o: ../src/LexCsound.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h ../include/SciLexer.h
LexCSS.o: ../src/LexCSS.cxx ../include/Platform.h ../include/PropSet.h \ LexCSS.o: ../src/LexCSS.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexD.o: ../src/LexD.cxx ../include/Platform.h ../include/PropSet.h \ LexD.o: ../src/LexD.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexEiffel.o: ../src/LexEiffel.cxx ../include/Platform.h \ LexEiffel.o: ../src/LexEiffel.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h ../include/SciLexer.h
LexErlang.o: ../src/LexErlang.cxx ../include/Platform.h \ LexErlang.o: ../src/LexErlang.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h ../include/SciLexer.h
LexEScript.o: ../src/LexEScript.cxx ../include/Platform.h \ LexEScript.o: ../src/LexEScript.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h ../include/SciLexer.h
LexFlagship.o: ../src/LexFlagship.cxx ../include/Platform.h \ LexFlagship.o: ../src/LexFlagship.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h ../include/SciLexer.h
LexForth.o: ../src/LexForth.cxx ../include/Platform.h \ LexForth.o: ../src/LexForth.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexFortran.o: ../src/LexFortran.cxx ../include/Platform.h \ LexFortran.o: ../src/LexFortran.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h ../include/SciLexer.h
LexGui4Cli.o: ../src/LexGui4Cli.cxx ../include/Platform.h \ LexGui4Cli.o: ../src/LexGui4Cli.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h ../include/SciLexer.h
LexHaskell.o: ../src/LexHaskell.cxx ../include/Platform.h \ LexHaskell.o: ../src/LexHaskell.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h ../include/SciLexer.h
LexHTML.o: ../src/LexHTML.cxx ../include/Platform.h ../include/PropSet.h \ LexHTML.o: ../src/LexHTML.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexInno.o: ../src/LexInno.cxx ../include/Platform.h ../include/PropSet.h \ LexInno.o: ../src/LexInno.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexKix.o: ../src/LexKix.cxx ../include/Platform.h ../include/PropSet.h \ LexKix.o: ../src/LexKix.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexLisp.o: ../src/LexLisp.cxx ../include/Platform.h ../include/PropSet.h \ LexLisp.o: ../src/LexLisp.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../include/KeyWords.h \ ../include/Accessor.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h ../src/StyleContext.h ../include/Scintilla.h ../include/SciLexer.h ../src/StyleContext.h
LexLout.o: ../src/LexLout.cxx ../include/Platform.h ../include/PropSet.h \ LexLout.o: ../src/LexLout.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexLua.o: ../src/LexLua.cxx ../include/Platform.h ../include/PropSet.h \ LexLua.o: ../src/LexLua.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexMatlab.o: ../src/LexMatlab.cxx ../include/Platform.h \ LexMatlab.o: ../src/LexMatlab.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h ../include/SciLexer.h
LexMetapost.o: ../src/LexMetapost.cxx ../include/Platform.h \ LexMetapost.o: ../src/LexMetapost.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h \ ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h \
../src/StyleContext.h ../src/StyleContext.h
LexMMIXAL.o: ../src/LexMMIXAL.cxx ../include/Platform.h \ LexMMIXAL.o: ../src/LexMMIXAL.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h ../include/SciLexer.h
LexMPT.o: ../src/LexMPT.cxx ../include/Platform.h ../include/PropSet.h \ LexMPT.o: ../src/LexMPT.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../include/KeyWords.h \ ../include/Accessor.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h ../include/SString.h ../include/Scintilla.h ../include/SciLexer.h
LexMSSQL.o: ../src/LexMSSQL.cxx ../include/Platform.h \ LexMSSQL.o: ../src/LexMSSQL.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexNsis.o: ../src/LexNsis.cxx ../include/Platform.h ../include/PropSet.h \ LexNsis.o: ../src/LexNsis.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../include/KeyWords.h \ ../include/Accessor.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h ../include/Scintilla.h ../include/SciLexer.h
LexOpal.o: ../src/LexOpal.cxx ../include/Platform.h ../include/PropSet.h \ LexOpal.o: ../src/LexOpal.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../include/KeyWords.h \ ../include/Accessor.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h ../src/StyleContext.h ../include/Scintilla.h ../include/SciLexer.h ../src/StyleContext.h
LexOthers.o: ../src/LexOthers.cxx ../include/Platform.h \ LexOthers.o: ../src/LexOthers.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexPascal.o: ../src/LexPascal.cxx ../include/Platform.h \ LexPascal.o: ../src/LexPascal.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h \ ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h \
../src/StyleContext.h ../src/StyleContext.h
LexPB.o: ../src/LexPB.cxx ../include/Platform.h ../include/PropSet.h \ LexPB.o: ../src/LexPB.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexPerl.o: ../src/LexPerl.cxx ../include/Platform.h ../include/PropSet.h \ LexPerl.o: ../src/LexPerl.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../include/KeyWords.h \ ../include/Accessor.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h ../include/Scintilla.h ../include/SciLexer.h
LexPOV.o: ../src/LexPOV.cxx ../include/Platform.h ../include/PropSet.h \ LexPOV.o: ../src/LexPOV.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexPS.o: ../src/LexPS.cxx ../include/Platform.h ../include/PropSet.h \ LexPS.o: ../src/LexPS.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexPython.o: ../src/LexPython.cxx ../include/Platform.h \ LexPython.o: ../src/LexPython.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h ../include/SciLexer.h
LexRebol.o: ../src/LexRebol.cxx ../include/Platform.h \ LexRebol.o: ../src/LexRebol.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h \ ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h \
../src/StyleContext.h ../src/StyleContext.h
LexRuby.o: ../src/LexRuby.cxx ../include/Platform.h ../include/PropSet.h \ LexRuby.o: ../src/LexRuby.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../include/KeyWords.h \ ../include/Accessor.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h ../include/Scintilla.h ../include/SciLexer.h
LexScriptol.o: ../src/LexScriptol.cxx ../include/Platform.h \ LexScriptol.o: ../src/LexScriptol.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexSmalltalk.o: ../src/LexSmalltalk.cxx ../include/Platform.h \ LexSmalltalk.o: ../src/LexSmalltalk.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h ../include/SciLexer.h
LexSpecman.o: ../src/LexSpecman.cxx ../include/Platform.h \ LexSpecman.o: ../src/LexSpecman.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h ../include/SciLexer.h
LexSpice.o: ../src/LexSpice.cxx ../include/Platform.h \ LexSpice.o: ../src/LexSpice.cxx ../include/Platform.h \
../include/Accessor.h ../src/StyleContext.h ../include/PropSet.h \ ../include/Accessor.h ../src/StyleContext.h ../include/PropSet.h \
../include/SString.h ../include/KeyWords.h ../include/SciLexer.h \ ../include/KeyWords.h ../include/SciLexer.h
../include/SString.h
LexSQL.o: ../src/LexSQL.cxx ../include/Platform.h ../include/PropSet.h \ LexSQL.o: ../src/LexSQL.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexTADS3.o: ../src/LexTADS3.cxx ../include/Platform.h \ LexTADS3.o: ../src/LexTADS3.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h ../include/SciLexer.h
LexTCL.o: ../src/LexTCL.cxx ../include/Platform.h ../include/PropSet.h \ LexTCL.o: ../src/LexTCL.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexTeX.o: ../src/LexTeX.cxx ../include/Platform.h ../include/PropSet.h \ LexTeX.o: ../src/LexTeX.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../include/KeyWords.h \ ../include/Accessor.h ../include/KeyWords.h \
../include/Scintilla.h ../include/SciLexer.h ../src/StyleContext.h ../include/Scintilla.h ../include/SciLexer.h ../src/StyleContext.h
LexVB.o: ../src/LexVB.cxx ../include/Platform.h ../include/PropSet.h \ LexVB.o: ../src/LexVB.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexVerilog.o: ../src/LexVerilog.cxx ../include/Platform.h \ LexVerilog.o: ../src/LexVerilog.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \ ../src/StyleContext.h ../include/KeyWords.h ../include/Scintilla.h \
../include/SciLexer.h ../include/SciLexer.h
LexVHDL.o: ../src/LexVHDL.cxx ../include/Platform.h ../include/PropSet.h \ LexVHDL.o: ../src/LexVHDL.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LexYAML.o: ../src/LexYAML.cxx ../include/Platform.h ../include/PropSet.h \ LexYAML.o: ../src/LexYAML.cxx ../include/Platform.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/StyleContext.h \ ../include/Accessor.h ../src/StyleContext.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
LineMarker.o: ../src/LineMarker.cxx ../include/Platform.h \ LineMarker.o: ../src/LineMarker.cxx ../include/Platform.h \
../include/Scintilla.h ../src/XPM.h ../src/LineMarker.h ../include/Scintilla.h ../src/XPM.h ../src/LineMarker.h
PropSet.o: ../src/PropSet.cxx ../include/Platform.h ../include/PropSet.h \ PropSet.o: ../src/PropSet.cxx ../include/Platform.h ../include/PropSet.h
../include/SString.h
RESearch.o: ../src/RESearch.cxx ../src/CharClassify.h ../src/RESearch.h RESearch.o: ../src/RESearch.cxx ../src/CharClassify.h ../src/RESearch.h
RunStyles.o: ../src/RunStyles.cxx ../include/Platform.h \ RunStyles.o: ../src/RunStyles.cxx ../include/Platform.h \
../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \ ../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \
../src/RunStyles.h ../src/RunStyles.h
ScintillaBase.o: ../src/ScintillaBase.cxx ../include/Platform.h \ ScintillaBase.o: ../src/ScintillaBase.cxx ../include/Platform.h \
../include/Scintilla.h ../include/PropSet.h ../include/SString.h \ ../include/Scintilla.h ../include/PropSet.h \
../src/ContractionState.h ../src/SVector.h ../src/SplitVector.h \ ../src/ContractionState.h ../src/SVector.h ../src/SplitVector.h \
../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \ ../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \
../src/CallTip.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \ ../src/CallTip.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \
@ -271,7 +269,7 @@ ScintillaBase.o: ../src/ScintillaBase.cxx ../include/Platform.h \
Style.o: ../src/Style.cxx ../include/Platform.h ../include/Scintilla.h \ Style.o: ../src/Style.cxx ../include/Platform.h ../include/Scintilla.h \
../src/Style.h ../src/Style.h
StyleContext.o: ../src/StyleContext.cxx ../include/Platform.h \ StyleContext.o: ../src/StyleContext.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../src/StyleContext.h ../src/StyleContext.h
UniConversion.o: ../src/UniConversion.cxx ../src/UniConversion.h UniConversion.o: ../src/UniConversion.cxx ../src/UniConversion.h
ViewStyle.o: ../src/ViewStyle.cxx ../include/Platform.h \ ViewStyle.o: ../src/ViewStyle.cxx ../include/Platform.h \
@ -279,6 +277,6 @@ ViewStyle.o: ../src/ViewStyle.cxx ../include/Platform.h \
../src/RunStyles.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \ ../src/RunStyles.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \
../src/Style.h ../src/ViewStyle.h ../src/Style.h ../src/ViewStyle.h
WindowAccessor.o: ../src/WindowAccessor.cxx ../include/Platform.h \ WindowAccessor.o: ../src/WindowAccessor.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../include/WindowAccessor.h ../include/Scintilla.h ../include/WindowAccessor.h ../include/Scintilla.h
XPM.o: ../src/XPM.cxx ../include/Platform.h ../src/XPM.h XPM.o: ../src/XPM.cxx ../include/Platform.h ../src/XPM.h

View File

@ -29,12 +29,13 @@ LDFLAGS=-mwindows -lstdc++ -limm32 -lole32 -luuid -mno-cygwin
# Add -MMD to get dependencies # Add -MMD to get dependencies
#CXXFLAGS = -g -pg -pedantic -Os -fno-exceptions -fvtable-thunks -fno-rtti #CXXFLAGS = -g -pg -pedantic -Os -fno-exceptions -fvtable-thunks -fno-rtti
INCLUDEDIRS=-I ../include -I ../src INCLUDEDIRS=-I ../include -I ../src
CXXBASEFLAGS=-Wall -Wno-missing-braces -Wno-char-subscripts -pedantic $(INCLUDEDIRS) -Os -fno-exceptions $(THUNKFLAGS) -fno-rtti -mno-cygwin CXXBASEFLAGS=-Wall -Wno-missing-braces -Wno-char-subscripts -pedantic $(INCLUDEDIRS) $(THUNKFLAGS) -fno-rtti -mno-cygwin
ifdef DEBUG ifdef DEBUG
CXXFLAGS=-DDEBUG $(CXXBASEFLAGS) CXXFLAGS=-DDEBUG -g $(CXXBASEFLAGS)
else else
CXXFLAGS=-DNDEBUG $(CXXBASEFLAGS) CXXFLAGS=-DNDEBUG -Os $(CXXBASEFLAGS)
STRIPFLAG=-s
endif endif
.cxx.o: .cxx.o:
@ -67,17 +68,17 @@ LexTADS3.o LexTAL.o LexTCL.o LexTeX.o LexVB.o LexVerilog.o LexVHDL.o LexYAML.o
SOBJS = ScintillaWin.o ScintillaBase.o Editor.o CharClassify.o Decoration.o \ SOBJS = ScintillaWin.o ScintillaBase.o Editor.o CharClassify.o Decoration.o \
Document.o ContractionState.o CellBuffer.o CallTip.o \ Document.o ContractionState.o CellBuffer.o CallTip.o \
ScintRes.o PlatWin.o PositionCache.o KeyMap.o Indicator.o LineMarker.o RESearch.o RunStyles.o \ ScintRes.o PlatWin.o PositionCache.o KeyMap.o Indicator.o LineMarker.o RESearch.o RunStyles.o \
Style.o ViewStyle.o AutoComplete.o UniConversion.o PropSet.o XPM.o PerLine.o Selection.o Style.o ViewStyle.o AutoComplete.o UniConversion.o PropSet.o XPM.o PerLine.o
$(COMPONENT): $(SOBJS) Scintilla.def $(COMPONENT): $(SOBJS) Scintilla.def
$(DLLWRAP) --add-stdcall-alias --target i386-mingw32 -o $@ $(SOBJS) $(LDFLAGS) -s --relocatable $(DLLWRAP) --add-stdcall-alias --target i386-mingw32 -o $@ $(SOBJS) $(LDFLAGS) $(STRIPFLAG) --relocatable
LOBJS = ScintillaWinL.o ScintillaBaseL.o Editor.o CharClassify.o Decoration.o \ LOBJS = ScintillaWinL.o ScintillaBaseL.o Editor.o CharClassify.o Decoration.o \
Document.o ContractionState.o CellBuffer.o CallTip.o \ Document.o ContractionState.o CellBuffer.o CallTip.o \
ScintRes.o PlatWin.o PositionCache.o KeyMap.o Indicator.o LineMarker.o RESearch.o RunStyles.o \ ScintRes.o PlatWin.o PositionCache.o KeyMap.o Indicator.o LineMarker.o RESearch.o RunStyles.o \
Style.o ViewStyle.o AutoComplete.o UniConversion.o KeyWords.o \ Selection.o Style.o ViewStyle.o AutoComplete.o UniConversion.o KeyWords.o \
DocumentAccessor.o PropSet.o ExternalLexer.o StyleContext.o XPM.o PerLine.o $(LEXOBJS) DocumentAccessor.o PropSet.o ExternalLexer.o StyleContext.o XPM.o PerLine.o $(LEXOBJS)
$(LEXCOMPONENT): $(LOBJS) Scintilla.def $(LEXCOMPONENT): $(LOBJS) Scintilla.def
$(DLLWRAP) --add-stdcall-alias --target i386-mingw32 -o $@ $(LOBJS) $(LDFLAGS) -s --relocatable $(DLLWRAP) --add-stdcall-alias --target i386-mingw32 -o $@ $(LOBJS) $(LDFLAGS) $(STRIPFLAG) --relocatable
$(LEXLIB): $(LEXOBJS) $(LEXLIB): $(LEXOBJS)
$(AR) rc $@ $^ $(AR) rc $@ $^
@ -90,12 +91,12 @@ include deps.mak
ScintillaBaseL.o: ScintillaBase.cxx Platform.h Scintilla.h SciLexer.h \ ScintillaBaseL.o: ScintillaBase.cxx Platform.h Scintilla.h SciLexer.h \
ContractionState.h CellBuffer.h CallTip.h KeyMap.h Indicator.h \ ContractionState.h CellBuffer.h CallTip.h KeyMap.h Indicator.h \
LineMarker.h Style.h AutoComplete.h ViewStyle.h Document.h Editor.h \ LineMarker.h Style.h AutoComplete.h ViewStyle.h Document.h Editor.h \
ScintillaBase.h PropSet.h SString.h Accessor.h DocumentAccessor.h \ ScintillaBase.h PropSet.h Accessor.h DocumentAccessor.h \
KeyWords.h ExternalLexer.h PerLine.h KeyWords.h ExternalLexer.h PerLine.h
ScintillaWinL.o: ScintillaWin.cxx Platform.h Scintilla.h SciLexer.h \ ScintillaWinL.o: ScintillaWin.cxx Platform.h Scintilla.h SciLexer.h \
ContractionState.h CellBuffer.h CallTip.h KeyMap.h Indicator.h \ ContractionState.h CellBuffer.h CallTip.h KeyMap.h Indicator.h \
LineMarker.h Style.h AutoComplete.h ViewStyle.h Document.h Editor.h \ LineMarker.h Style.h AutoComplete.h ViewStyle.h Document.h Editor.h \
ScintillaBase.h PropSet.h SString.h Accessor.h KeyWords.h \ ScintillaBase.h PropSet.h Accessor.h KeyWords.h \
ExternalLexer.h UniConversion.h PerLine.h ExternalLexer.h UniConversion.h PerLine.h
ScintillaWinS.o: ScintillaWin.cxx Platform.h Scintilla.h \ ScintillaWinS.o: ScintillaWin.cxx Platform.h Scintilla.h \
ContractionState.h CellBuffer.h CallTip.h KeyMap.h Indicator.h \ ContractionState.h CellBuffer.h CallTip.h KeyMap.h Indicator.h \

View File

@ -1,5 +1,5 @@
# Make file for Scintilla on Windows Visual C++ and Borland C++ version # Make file for Scintilla on Windows Visual C++ and Borland C++ version
# Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org> # Copyright 1998-2009 by Neil Hodgson <neilh@scintilla.org>
# The License.txt file describes the conditions under which this software may be distributed. # The License.txt file describes the conditions under which this software may be distributed.
# This makefile is for using Visual C++ with nmake or Borland C++ with make depending on # This makefile is for using Visual C++ with nmake or Borland C++ with make depending on
# the setting of the VENDOR macro. If no VENDOR is defined n the command line then # the setting of the VENDOR macro. If no VENDOR is defined n the command line then
@ -35,7 +35,7 @@ CC=cl
RC=rc RC=rc
LD=link LD=link
CXXFLAGS=-Zi -TP -W4 -Zc:forScope -Zc:wchar_t -D_CRT_SECURE_NO_DEPRECATE=1 CXXFLAGS=-Zi -TP -W4 -EHsc -Zc:forScope -Zc:wchar_t -D_CRT_SECURE_NO_DEPRECATE=1
# For something scary:-Wp64 # For something scary:-Wp64
CXXDEBUG=-Od -MTd -DDEBUG CXXDEBUG=-Od -MTd -DDEBUG
CXXNDEBUG=-O1 -MT -DNDEBUG -GL CXXNDEBUG=-O1 -MT -DNDEBUG -GL
@ -52,7 +52,7 @@ CC=bcc32
RC=brcc32 -r RC=brcc32 -r
LD=ilink32 LD=ilink32
CXXFLAGS=-P -tWM -w -w-prc -w-inl -w-pin -RT- -x- CXXFLAGS=-P -tWM -w -w-prc -w-inl -w-pin -RT-
# Above turns off warnings for clarfying parentheses and inlines with for not expanded # Above turns off warnings for clarfying parentheses and inlines with for not expanded
CXXDEBUG=-Od -v -DDEBUG CXXDEBUG=-Od -v -DDEBUG
CXXNDEBUG=-O1 -DNDEBUG CXXNDEBUG=-O1 -DNDEBUG
@ -105,6 +105,7 @@ SOBJS=\
$(DIR_O)\RunStyles.obj \ $(DIR_O)\RunStyles.obj \
$(DIR_O)\ScintillaBase.obj \ $(DIR_O)\ScintillaBase.obj \
$(DIR_O)\ScintillaWin.obj \ $(DIR_O)\ScintillaWin.obj \
$(DIR_O)\Selection.obj \
$(DIR_O)\Style.obj \ $(DIR_O)\Style.obj \
$(DIR_O)\UniConversion.obj \ $(DIR_O)\UniConversion.obj \
$(DIR_O)\ViewStyle.obj \ $(DIR_O)\ViewStyle.obj \
@ -209,6 +210,7 @@ LOBJS=\
$(DIR_O)\KeyMap.obj \ $(DIR_O)\KeyMap.obj \
$(DIR_O)\KeyWords.obj \ $(DIR_O)\KeyWords.obj \
$(DIR_O)\LineMarker.obj \ $(DIR_O)\LineMarker.obj \
$(DIR_O)\PerLine.obj \
$(DIR_O)\PlatWin.obj \ $(DIR_O)\PlatWin.obj \
$(DIR_O)\PositionCache.obj \ $(DIR_O)\PositionCache.obj \
$(DIR_O)\PropSet.obj \ $(DIR_O)\PropSet.obj \
@ -216,12 +218,12 @@ LOBJS=\
$(DIR_O)\RunStyles.obj \ $(DIR_O)\RunStyles.obj \
$(DIR_O)\ScintillaBaseL.obj \ $(DIR_O)\ScintillaBaseL.obj \
$(DIR_O)\ScintillaWinL.obj \ $(DIR_O)\ScintillaWinL.obj \
$(DIR_O)\Selection.obj \
$(DIR_O)\Style.obj \ $(DIR_O)\Style.obj \
$(DIR_O)\StyleContext.obj \ $(DIR_O)\StyleContext.obj \
$(DIR_O)\UniConversion.obj \ $(DIR_O)\UniConversion.obj \
$(DIR_O)\ViewStyle.obj \ $(DIR_O)\ViewStyle.obj \
$(DIR_O)\XPM.obj \ $(DIR_O)\XPM.obj \
$(DIR_O)\PerLine.obj \
$(LEXOBJS) $(LEXOBJS)
$(DIR_O)\ScintRes.res : ScintRes.rc $(DIR_O)\ScintRes.res : ScintRes.rc
@ -267,11 +269,11 @@ $(DIR_O)\ScintillaWinS.obj: ScintillaWin.cxx
# All lexers depend on this set of headers # All lexers depend on this set of headers
LEX_HEADERS=..\include\Platform.h ..\include\PropSet.h \ LEX_HEADERS=..\include\Platform.h ..\include\PropSet.h \
..\include\SString.h ..\include\Accessor.h ..\include\KeyWords.h \ ..\include\Accessor.h ..\include\KeyWords.h \
..\include\Scintilla.h ..\include\SciLexer.h ..\src\StyleContext.h ..\include\Scintilla.h ..\include\SciLexer.h ..\src\StyleContext.h
$(DIR_O)\AutoComplete.obj: ../src/AutoComplete.cxx ../include/Platform.h \ $(DIR_O)\AutoComplete.obj: ../src/AutoComplete.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../src/AutoComplete.h ../include/PropSet.h ../src/AutoComplete.h
$(DIR_O)\CallTip.obj: ../src/CallTip.cxx ../include/Platform.h \ $(DIR_O)\CallTip.obj: ../src/CallTip.cxx ../include/Platform.h \
../include/Scintilla.h ../src/CallTip.h ../include/Scintilla.h ../src/CallTip.h
$(DIR_O)\CellBuffer.obj: ../src/CellBuffer.cxx ../include/Platform.h \ $(DIR_O)\CellBuffer.obj: ../src/CellBuffer.cxx ../include/Platform.h \
@ -289,7 +291,7 @@ $(DIR_O)\Document.obj: ../src/Document.cxx ../include/Platform.h \
../src/CharClassify.h ../src/Decoration.h ../src/Document.h \ ../src/CharClassify.h ../src/Decoration.h ../src/Document.h \
../src/RESearch.h ../src/PerLine.h ../src/RESearch.h ../src/PerLine.h
$(DIR_O)\DocumentAccessor.obj: ../src/DocumentAccessor.cxx ../include/Platform.h \ $(DIR_O)\DocumentAccessor.obj: ../src/DocumentAccessor.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../src/SVector.h \ ../include/PropSet.h ../src/SVector.h \
../include/Accessor.h ../src/DocumentAccessor.h ../src/SplitVector.h \ ../include/Accessor.h ../src/DocumentAccessor.h ../src/SplitVector.h \
../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \ ../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \
../include/Scintilla.h ../src/CharClassify.h ../src/Decoration.h \ ../include/Scintilla.h ../src/CharClassify.h ../src/Decoration.h \
@ -299,17 +301,17 @@ $(DIR_O)\Editor.obj: ../src/Editor.cxx ../include/Platform.h ../include/Scintill
../src/Partitioning.h ../src/CellBuffer.h ../src/KeyMap.h \ ../src/Partitioning.h ../src/CellBuffer.h ../src/KeyMap.h \
../src/RunStyles.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \ ../src/RunStyles.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \
../src/Style.h ../src/ViewStyle.h ../src/CharClassify.h \ ../src/Style.h ../src/ViewStyle.h ../src/CharClassify.h \
../src/Decoration.h ../src/Document.h ../src/Editor.h ../src/PositionCache.h ../src/Decoration.h ../src/Document.h ../src/Editor.h ../src/Selection.h ../src/PositionCache.h
$(DIR_O)\ExternalLexer.obj: ../src/ExternalLexer.cxx ../include/Platform.h \ $(DIR_O)\ExternalLexer.obj: ../src/ExternalLexer.cxx ../include/Platform.h \
../include/Scintilla.h ../include/SciLexer.h ../include/PropSet.h \ ../include/Scintilla.h ../include/SciLexer.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/DocumentAccessor.h \ ../include/Accessor.h ../src/DocumentAccessor.h \
../include/KeyWords.h ../src/ExternalLexer.h ../include/KeyWords.h ../src/ExternalLexer.h
$(DIR_O)\Indicator.obj: ../src/Indicator.cxx ../include/Platform.h \ $(DIR_O)\Indicator.obj: ../src/Indicator.cxx ../include/Platform.h \
../include/Scintilla.h ../src/Indicator.h ../include/Scintilla.h ../src/Indicator.h
$(DIR_O)\KeyMap.obj: ../src/KeyMap.cxx ../include/Platform.h ../include/Scintilla.h \ $(DIR_O)\KeyMap.obj: ../src/KeyMap.cxx ../include/Platform.h ../include/Scintilla.h \
../src/KeyMap.h ../src/KeyMap.h
$(DIR_O)\KeyWords.obj: ../src/KeyWords.cxx ../include/Platform.h \ $(DIR_O)\KeyWords.obj: ../src/KeyWords.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
#++Autogenerated -- run src/LexGen.py to regenerate #++Autogenerated -- run src/LexGen.py to regenerate
@ -484,57 +486,58 @@ $(DIR_O)\PositionCache.obj: ../src/Editor.cxx ../include/Platform.h ../include/S
../src/Partitioning.h ../src/CellBuffer.h ../src/KeyMap.h \ ../src/Partitioning.h ../src/CellBuffer.h ../src/KeyMap.h \
../src/RunStyles.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \ ../src/RunStyles.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \
../src/Style.h ../src/ViewStyle.h ../src/CharClassify.h \ ../src/Style.h ../src/ViewStyle.h ../src/CharClassify.h \
../src/Decoration.h ../src/Document.h ../src/Editor.h ../src/PositionCache.h ../src/Decoration.h ../src/Document.h ../src/Editor.h ../src/Selection.h ../src/PositionCache.h
$(DIR_O)\PropSet.obj: ../src/PropSet.cxx ../include/Platform.h ../include/PropSet.h \ $(DIR_O)\PropSet.obj: ../src/PropSet.cxx ../include/Platform.h ../include/PropSet.h
../include/SString.h
$(DIR_O)\RESearch.obj: ../src/RESearch.cxx ../src/CharClassify.h ../src/RESearch.h $(DIR_O)\RESearch.obj: ../src/RESearch.cxx ../src/CharClassify.h ../src/RESearch.h
$(DIR_O)\RunStyles.obj: ../src/RunStyles.cxx ../include/Platform.h \ $(DIR_O)\RunStyles.obj: ../src/RunStyles.cxx ../include/Platform.h \
../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \ ../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \
../src/RunStyles.h ../src/RunStyles.h
$(DIR_O)\ScintillaBase.obj: ../src/ScintillaBase.cxx ../include/Platform.h \ $(DIR_O)\ScintillaBase.obj: ../src/ScintillaBase.cxx ../include/Platform.h \
../include/Scintilla.h ../include/PropSet.h ../include/SString.h \ ../include/Scintilla.h ../include/PropSet.h \
../src/ContractionState.h ../src/SVector.h ../src/SplitVector.h \ ../src/ContractionState.h ../src/SVector.h ../src/SplitVector.h \
../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \ ../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \
../src/CallTip.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \ ../src/CallTip.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \
../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \ ../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \
../src/AutoComplete.h ../src/CharClassify.h ../src/Decoration.h \ ../src/AutoComplete.h ../src/CharClassify.h ../src/Decoration.h \
../src/Document.h ../src/Editor.h ../src/ScintillaBase.h ../src/Document.h ../src/Editor.h ../src/Selection.h ../src/ScintillaBase.h
$(DIR_O)\ScintillaBaseL.obj: ../src/ScintillaBase.cxx ../include/Platform.h \ $(DIR_O)\ScintillaBaseL.obj: ../src/ScintillaBase.cxx ../include/Platform.h \
../include/Scintilla.h ../include/PropSet.h ../include/SString.h \ ../include/Scintilla.h ../include/PropSet.h \
../src/ContractionState.h ../src/SVector.h ../src/SplitVector.h \ ../src/ContractionState.h ../src/SVector.h ../src/SplitVector.h \
../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \ ../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \
../src/CallTip.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \ ../src/CallTip.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \
../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \ ../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \
../src/AutoComplete.h ../src/CharClassify.h ../src/Decoration.h \ ../src/AutoComplete.h ../src/CharClassify.h ../src/Decoration.h \
../src/Document.h ../src/Editor.h ../src/ScintillaBase.h ../src/Document.h ../src/Editor.h ../src/Selection.h ../src/ScintillaBase.h
$(DIR_O)\ScintillaWin.obj: ScintillaWin.cxx ../include/Platform.h \ $(DIR_O)\ScintillaWin.obj: ScintillaWin.cxx ../include/Platform.h \
../include/Scintilla.h ../include/SString.h ../src/ContractionState.h \ ../include/Scintilla.h ../src/ContractionState.h \
../src/SVector.h ../src/SplitVector.h ../src/Partitioning.h \ ../src/SVector.h ../src/SplitVector.h ../src/Partitioning.h \
../src/RunStyles.h ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h \ ../src/RunStyles.h ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h \
../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \ ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \
../src/AutoComplete.h ../src/ViewStyle.h ../src/CharClassify.h \ ../src/AutoComplete.h ../src/ViewStyle.h ../src/CharClassify.h \
../src/Decoration.h ../src/Document.h ../src/Editor.h \ ../src/Decoration.h ../src/Document.h ../src/Editor.h \
../src/ScintillaBase.h ../src/UniConversion.h ../src/ScintillaBase.h ../src/Selection.h ../src/UniConversion.h
$(DIR_O)\ScintillaWinS.obj: ScintillaWin.cxx ../include/Platform.h \ $(DIR_O)\ScintillaWinS.obj: ScintillaWin.cxx ../include/Platform.h \
../include/Scintilla.h ../include/SString.h ../src/ContractionState.h \ ../include/Scintilla.h ../src/ContractionState.h \
../src/SVector.h ../src/SplitVector.h ../src/Partitioning.h \ ../src/SVector.h ../src/SplitVector.h ../src/Partitioning.h \
../src/RunStyles.h ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h \ ../src/RunStyles.h ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h \
../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \ ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \
../src/AutoComplete.h ../src/ViewStyle.h ../src/CharClassify.h \ ../src/AutoComplete.h ../src/ViewStyle.h ../src/CharClassify.h \
../src/Decoration.h ../src/Document.h ../src/Editor.h \ ../src/Decoration.h ../src/Document.h ../src/Editor.h \
../src/ScintillaBase.h ../src/UniConversion.h ../src/ScintillaBase.h ../src/Selection.h ../src/UniConversion.h
$(DIR_O)\ScintillaWinL.obj: ScintillaWin.cxx ../include/Platform.h \ $(DIR_O)\ScintillaWinL.obj: ScintillaWin.cxx ../include/Platform.h \
../include/Scintilla.h ../include/SString.h ../src/ContractionState.h \ ../include/Scintilla.h ../src/ContractionState.h \
../src/SVector.h ../src/SplitVector.h ../src/Partitioning.h \ ../src/SVector.h ../src/SplitVector.h ../src/Partitioning.h \
../src/RunStyles.h ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h \ ../src/RunStyles.h ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h \
../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \ ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \
../src/AutoComplete.h ../src/ViewStyle.h ../src/CharClassify.h \ ../src/AutoComplete.h ../src/ViewStyle.h ../src/CharClassify.h \
../src/Decoration.h ../src/Document.h ../src/Editor.h \ ../src/Decoration.h ../src/Document.h ../src/Editor.h \
../src/ScintillaBase.h ../src/UniConversion.h ../src/ScintillaBase.h ../src/Selection.h ../src/UniConversion.h
$(DIR_O)\Selection.obj: ../src/Selection.cxx ../include/Platform.h ../include/Scintilla.h \
../src/Selection.h
$(DIR_O)\Style.obj: ../src/Style.cxx ../include/Platform.h ../include/Scintilla.h \ $(DIR_O)\Style.obj: ../src/Style.cxx ../include/Platform.h ../include/Scintilla.h \
../src/Style.h ../src/Style.h
$(DIR_O)\StyleContext.obj: ../src/StyleContext.cxx ../include/Platform.h \ $(DIR_O)\StyleContext.obj: ../src/StyleContext.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../src/StyleContext.h ../src/StyleContext.h
$(DIR_O)\UniConversion.obj: ../src/UniConversion.cxx ../src/UniConversion.h $(DIR_O)\UniConversion.obj: ../src/UniConversion.cxx ../src/UniConversion.h
$(DIR_O)\ViewStyle.obj: ../src/ViewStyle.cxx ../include/Platform.h \ $(DIR_O)\ViewStyle.obj: ../src/ViewStyle.cxx ../include/Platform.h \
@ -542,6 +545,6 @@ $(DIR_O)\ViewStyle.obj: ../src/ViewStyle.cxx ../include/Platform.h \
../src/RunStyles.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \ ../src/RunStyles.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \
../src/Style.h ../src/ViewStyle.h ../src/Style.h ../src/ViewStyle.h
$(DIR_O)\WindowAccessor.obj: ../src/WindowAccessor.cxx ../include/Platform.h \ $(DIR_O)\WindowAccessor.obj: ../src/WindowAccessor.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../include/WindowAccessor.h ../include/Scintilla.h ../include/WindowAccessor.h ../include/Scintilla.h
$(DIR_O)\XPM.obj: ../src/XPM.cxx ../include/Platform.h ../src/XPM.h $(DIR_O)\XPM.obj: ../src/XPM.cxx ../include/Platform.h ../src/XPM.h

View File

@ -1,5 +1,5 @@
# Make file for Scintilla on Windows Visual C++ and Borland C++ version # Make file for Scintilla on Windows Visual C++ and Borland C++ version
# Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org> # Copyright 1998-2009 by Neil Hodgson <neilh@scintilla.org>
# The License.txt file describes the conditions under which this software may be distributed. # The License.txt file describes the conditions under which this software may be distributed.
# This makefile is for using Visual C++ with nmake or Borland C++ with make depending on # This makefile is for using Visual C++ with nmake or Borland C++ with make depending on
# the setting of the VENDOR macro. If no VENDOR is defined n the command line then # the setting of the VENDOR macro. If no VENDOR is defined n the command line then
@ -36,7 +36,7 @@ RC=rc
LD=link LD=link
#-Zc:forScope -Zc:wchar_t #-Zc:forScope -Zc:wchar_t
CXXFLAGS=-Zi -TP -W4 CXXFLAGS=-Zi -TP -W3 -EHsc
# For something scary:-Wp64 # For something scary:-Wp64
CXXDEBUG=-Od -MTd -DDEBUG CXXDEBUG=-Od -MTd -DDEBUG
CXXNDEBUG=-O1 -MT -DNDEBUG CXXNDEBUG=-O1 -MT -DNDEBUG
@ -54,7 +54,7 @@ CC=bcc32
RC=brcc32 -r RC=brcc32 -r
LD=ilink32 LD=ilink32
CXXFLAGS=-P -tWM -w -w-prc -w-inl -RT- -x- CXXFLAGS=-P -tWM -w -w-prc -w-inl -RT-
# Above turns off warnings for clarfying parentheses and inlines with for not expanded # Above turns off warnings for clarfying parentheses and inlines with for not expanded
CXXDEBUG=-Od -v -DDEBUG CXXDEBUG=-Od -v -DDEBUG
CXXNDEBUG=-O1 -DNDEBUG CXXNDEBUG=-O1 -DNDEBUG
@ -100,7 +100,6 @@ SOBJS=\
$(DIR_O)\Indicator.obj \ $(DIR_O)\Indicator.obj \
$(DIR_O)\KeyMap.obj \ $(DIR_O)\KeyMap.obj \
$(DIR_O)\LineMarker.obj \ $(DIR_O)\LineMarker.obj \
$(DIR_O)\PerLine.obj \
$(DIR_O)\PlatWin.obj \ $(DIR_O)\PlatWin.obj \
$(DIR_O)\PositionCache.obj \ $(DIR_O)\PositionCache.obj \
$(DIR_O)\PropSet.obj \ $(DIR_O)\PropSet.obj \
@ -108,10 +107,12 @@ SOBJS=\
$(DIR_O)\RunStyles.obj \ $(DIR_O)\RunStyles.obj \
$(DIR_O)\ScintillaBase.obj \ $(DIR_O)\ScintillaBase.obj \
$(DIR_O)\ScintillaWin.obj \ $(DIR_O)\ScintillaWin.obj \
$(DIR_O)\Selection.obj \
$(DIR_O)\Style.obj \ $(DIR_O)\Style.obj \
$(DIR_O)\UniConversion.obj \ $(DIR_O)\UniConversion.obj \
$(DIR_O)\ViewStyle.obj \ $(DIR_O)\ViewStyle.obj \
$(DIR_O)\XPM.obj $(DIR_O)\XPM.obj \
$(DIR_O)\PerLine.obj
#++Autogenerated -- run src/LexGen.py to regenerate #++Autogenerated -- run src/LexGen.py to regenerate
#**LEXOBJS=\\\n\(\t$(DIR_O)\\\*.obj \\\n\) #**LEXOBJS=\\\n\(\t$(DIR_O)\\\*.obj \\\n\)
@ -214,11 +215,12 @@ LOBJS=\
$(DIR_O)\PerLine.obj \ $(DIR_O)\PerLine.obj \
$(DIR_O)\PlatWin.obj \ $(DIR_O)\PlatWin.obj \
$(DIR_O)\PositionCache.obj \ $(DIR_O)\PositionCache.obj \
$(DIR_O)\RunStyles.obj \
$(DIR_O)\RESearch.obj \
$(DIR_O)\PropSet.obj \ $(DIR_O)\PropSet.obj \
$(DIR_O)\RESearch.obj \
$(DIR_O)\RunStyles.obj \
$(DIR_O)\ScintillaBaseL.obj \ $(DIR_O)\ScintillaBaseL.obj \
$(DIR_O)\ScintillaWinL.obj \ $(DIR_O)\ScintillaWinL.obj \
$(DIR_O)\Selection.obj \
$(DIR_O)\Style.obj \ $(DIR_O)\Style.obj \
$(DIR_O)\StyleContext.obj \ $(DIR_O)\StyleContext.obj \
$(DIR_O)\UniConversion.obj \ $(DIR_O)\UniConversion.obj \
@ -269,11 +271,11 @@ $(DIR_O)\ScintillaWinS.obj: ScintillaWin.cxx
# All lexers depend on this set of headers # All lexers depend on this set of headers
LEX_HEADERS=..\include\Platform.h ..\include\PropSet.h \ LEX_HEADERS=..\include\Platform.h ..\include\PropSet.h \
..\include\SString.h ..\include\Accessor.h ..\include\KeyWords.h \ ..\include\Accessor.h ..\include\KeyWords.h \
..\include\Scintilla.h ..\include\SciLexer.h ..\src\StyleContext.h ..\include\Scintilla.h ..\include\SciLexer.h ..\src\StyleContext.h
$(DIR_O)\AutoComplete.obj: ../src/AutoComplete.cxx ../include/Platform.h \ $(DIR_O)\AutoComplete.obj: ../src/AutoComplete.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../src/AutoComplete.h ../include/PropSet.h ../src/AutoComplete.h
$(DIR_O)\CallTip.obj: ../src/CallTip.cxx ../include/Platform.h \ $(DIR_O)\CallTip.obj: ../src/CallTip.cxx ../include/Platform.h \
../include/Scintilla.h ../src/CallTip.h ../include/Scintilla.h ../src/CallTip.h
$(DIR_O)\CellBuffer.obj: ../src/CellBuffer.cxx ../include/Platform.h \ $(DIR_O)\CellBuffer.obj: ../src/CellBuffer.cxx ../include/Platform.h \
@ -289,9 +291,9 @@ $(DIR_O)\Document.obj: ../src/Document.cxx ../include/Platform.h \
../include/Scintilla.h ../src/SVector.h ../src/SplitVector.h \ ../include/Scintilla.h ../src/SVector.h ../src/SplitVector.h \
../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \ ../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \
../src/CharClassify.h ../src/Decoration.h ../src/Document.h \ ../src/CharClassify.h ../src/Decoration.h ../src/Document.h \
../src/RESearch.h ../src/RESearch.h ../src/PerLine.h
$(DIR_O)\DocumentAccessor.obj: ../src/DocumentAccessor.cxx ../include/Platform.h \ $(DIR_O)\DocumentAccessor.obj: ../src/DocumentAccessor.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../src/SVector.h \ ../include/PropSet.h ../src/SVector.h \
../include/Accessor.h ../src/DocumentAccessor.h ../src/SplitVector.h \ ../include/Accessor.h ../src/DocumentAccessor.h ../src/SplitVector.h \
../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \ ../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \
../include/Scintilla.h ../src/CharClassify.h ../src/Decoration.h \ ../include/Scintilla.h ../src/CharClassify.h ../src/Decoration.h \
@ -301,17 +303,17 @@ $(DIR_O)\Editor.obj: ../src/Editor.cxx ../include/Platform.h ../include/Scintill
../src/Partitioning.h ../src/CellBuffer.h ../src/KeyMap.h \ ../src/Partitioning.h ../src/CellBuffer.h ../src/KeyMap.h \
../src/RunStyles.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \ ../src/RunStyles.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \
../src/Style.h ../src/ViewStyle.h ../src/CharClassify.h \ ../src/Style.h ../src/ViewStyle.h ../src/CharClassify.h \
../src/Decoration.h ../src/Document.h ../src/Editor.h ../src/Decoration.h ../src/Document.h ../src/Editor.h ../src/Selection.h ../src/PositionCache.h
$(DIR_O)\ExternalLexer.obj: ../src/ExternalLexer.cxx ../include/Platform.h \ $(DIR_O)\ExternalLexer.obj: ../src/ExternalLexer.cxx ../include/Platform.h \
../include/Scintilla.h ../include/SciLexer.h ../include/PropSet.h \ ../include/Scintilla.h ../include/SciLexer.h ../include/PropSet.h \
../include/SString.h ../include/Accessor.h ../src/DocumentAccessor.h \ ../include/Accessor.h ../src/DocumentAccessor.h \
../include/KeyWords.h ../src/ExternalLexer.h ../include/KeyWords.h ../src/ExternalLexer.h
$(DIR_O)\Indicator.obj: ../src/Indicator.cxx ../include/Platform.h \ $(DIR_O)\Indicator.obj: ../src/Indicator.cxx ../include/Platform.h \
../include/Scintilla.h ../src/Indicator.h ../include/Scintilla.h ../src/Indicator.h
$(DIR_O)\KeyMap.obj: ../src/KeyMap.cxx ../include/Platform.h ../include/Scintilla.h \ $(DIR_O)\KeyMap.obj: ../src/KeyMap.cxx ../include/Platform.h ../include/Scintilla.h \
../src/KeyMap.h ../src/KeyMap.h
$(DIR_O)\KeyWords.obj: ../src/KeyWords.cxx ../include/Platform.h \ $(DIR_O)\KeyWords.obj: ../src/KeyWords.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h ../include/KeyWords.h ../include/Scintilla.h ../include/SciLexer.h
#++Autogenerated -- run src/LexGen.py to regenerate #++Autogenerated -- run src/LexGen.py to regenerate
@ -476,58 +478,68 @@ $(DIR_O)\LexYAML.obj: ..\src\LexYAML.cxx $(LEX_HEADERS)
$(DIR_O)\LineMarker.obj: ../src/LineMarker.cxx ../include/Platform.h \ $(DIR_O)\LineMarker.obj: ../src/LineMarker.cxx ../include/Platform.h \
../include/Scintilla.h ../src/XPM.h ../src/LineMarker.h ../include/Scintilla.h ../src/XPM.h ../src/LineMarker.h
$(DIR_O)\PerLine.obj: ../src/PerLine.cxx ../include/Platform.h \
../include/Scintilla.h ../src/SVector.h ../src/SplitVector.h \
../src/Partitioning.h ../src/RunStyles.h ../src/PerLine.h
$(DIR_O)\PlatWin.obj: PlatWin.cxx ../include/Platform.h PlatformRes.h \ $(DIR_O)\PlatWin.obj: PlatWin.cxx ../include/Platform.h PlatformRes.h \
../src/UniConversion.h ../src/XPM.h ../src/UniConversion.h ../src/XPM.h
$(DIR_O)\PropSet.obj: ../src/PropSet.cxx ../include/Platform.h ../include/PropSet.h \ $(DIR_O)\PositionCache.obj: ../src/Editor.cxx ../include/Platform.h ../include/Scintilla.h \
../include/SString.h ../src/ContractionState.h ../src/SVector.h ../src/SplitVector.h \
../src/Partitioning.h ../src/CellBuffer.h ../src/KeyMap.h \
../src/RunStyles.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \
../src/Style.h ../src/ViewStyle.h ../src/CharClassify.h \
../src/Decoration.h ../src/Document.h ../src/Editor.h ../src/Selection.h ../src/PositionCache.h
$(DIR_O)\PropSet.obj: ../src/PropSet.cxx ../include/Platform.h ../include/PropSet.h
$(DIR_O)\RESearch.obj: ../src/RESearch.cxx ../src/CharClassify.h ../src/RESearch.h $(DIR_O)\RESearch.obj: ../src/RESearch.cxx ../src/CharClassify.h ../src/RESearch.h
$(DIR_O)\RunStyles.obj: ../src/RunStyles.cxx ../include/Platform.h \ $(DIR_O)\RunStyles.obj: ../src/RunStyles.cxx ../include/Platform.h \
../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \ ../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \
../src/RunStyles.h ../src/RunStyles.h
$(DIR_O)\ScintillaBase.obj: ../src/ScintillaBase.cxx ../include/Platform.h \ $(DIR_O)\ScintillaBase.obj: ../src/ScintillaBase.cxx ../include/Platform.h \
../include/Scintilla.h ../include/PropSet.h ../include/SString.h \ ../include/Scintilla.h ../include/PropSet.h \
../src/ContractionState.h ../src/SVector.h ../src/SplitVector.h \ ../src/ContractionState.h ../src/SVector.h ../src/SplitVector.h \
../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \ ../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \
../src/CallTip.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \ ../src/CallTip.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \
../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \ ../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \
../src/AutoComplete.h ../src/CharClassify.h ../src/Decoration.h \ ../src/AutoComplete.h ../src/CharClassify.h ../src/Decoration.h \
../src/Document.h ../src/Editor.h ../src/ScintillaBase.h ../src/Document.h ../src/Editor.h ../src/Selection.h ../src/ScintillaBase.h
$(DIR_O)\ScintillaBaseL.obj: ../src/ScintillaBase.cxx ../include/Platform.h \ $(DIR_O)\ScintillaBaseL.obj: ../src/ScintillaBase.cxx ../include/Platform.h \
../include/Scintilla.h ../include/PropSet.h ../include/SString.h \ ../include/Scintilla.h ../include/PropSet.h \
../src/ContractionState.h ../src/SVector.h ../src/SplitVector.h \ ../src/ContractionState.h ../src/SVector.h ../src/SplitVector.h \
../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \ ../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \
../src/CallTip.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \ ../src/CallTip.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \
../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \ ../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \
../src/AutoComplete.h ../src/CharClassify.h ../src/Decoration.h \ ../src/AutoComplete.h ../src/CharClassify.h ../src/Decoration.h \
../src/Document.h ../src/Editor.h ../src/ScintillaBase.h ../src/Document.h ../src/Editor.h ../src/Selection.h ../src/ScintillaBase.h
$(DIR_O)\ScintillaWin.obj: ScintillaWin.cxx ../include/Platform.h \ $(DIR_O)\ScintillaWin.obj: ScintillaWin.cxx ../include/Platform.h \
../include/Scintilla.h ../include/SString.h ../src/ContractionState.h \ ../include/Scintilla.h ../src/ContractionState.h \
../src/SVector.h ../src/SplitVector.h ../src/Partitioning.h \ ../src/SVector.h ../src/SplitVector.h ../src/Partitioning.h \
../src/RunStyles.h ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h \ ../src/RunStyles.h ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h \
../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \ ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \
../src/AutoComplete.h ../src/ViewStyle.h ../src/CharClassify.h \ ../src/AutoComplete.h ../src/ViewStyle.h ../src/CharClassify.h \
../src/Decoration.h ../src/Document.h ../src/Editor.h \ ../src/Decoration.h ../src/Document.h ../src/Editor.h \
../src/ScintillaBase.h ../src/UniConversion.h ../src/ScintillaBase.h ../src/Selection.h ../src/UniConversion.h
$(DIR_O)\ScintillaWinS.obj: ScintillaWin.cxx ../include/Platform.h \ $(DIR_O)\ScintillaWinS.obj: ScintillaWin.cxx ../include/Platform.h \
../include/Scintilla.h ../include/SString.h ../src/ContractionState.h \ ../include/Scintilla.h ../src/ContractionState.h \
../src/SVector.h ../src/SplitVector.h ../src/Partitioning.h \ ../src/SVector.h ../src/SplitVector.h ../src/Partitioning.h \
../src/RunStyles.h ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h \ ../src/RunStyles.h ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h \
../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \ ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \
../src/AutoComplete.h ../src/ViewStyle.h ../src/CharClassify.h \ ../src/AutoComplete.h ../src/ViewStyle.h ../src/CharClassify.h \
../src/Decoration.h ../src/Document.h ../src/Editor.h \ ../src/Decoration.h ../src/Document.h ../src/Editor.h \
../src/ScintillaBase.h ../src/UniConversion.h ../src/ScintillaBase.h ../src/Selection.h ../src/UniConversion.h
$(DIR_O)\ScintillaWinL.obj: ScintillaWin.cxx ../include/Platform.h \ $(DIR_O)\ScintillaWinL.obj: ScintillaWin.cxx ../include/Platform.h \
../include/Scintilla.h ../include/SString.h ../src/ContractionState.h \ ../include/Scintilla.h ../src/ContractionState.h \
../src/SVector.h ../src/SplitVector.h ../src/Partitioning.h \ ../src/SVector.h ../src/SplitVector.h ../src/Partitioning.h \
../src/RunStyles.h ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h \ ../src/RunStyles.h ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h \
../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \ ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \
../src/AutoComplete.h ../src/ViewStyle.h ../src/CharClassify.h \ ../src/AutoComplete.h ../src/ViewStyle.h ../src/CharClassify.h \
../src/Decoration.h ../src/Document.h ../src/Editor.h \ ../src/Decoration.h ../src/Document.h ../src/Editor.h \
../src/ScintillaBase.h ../src/UniConversion.h ../src/ScintillaBase.h ../src/Selection.h ../src/UniConversion.h
$(DIR_O)\Selection.obj: ../src/Selection.cxx ../include/Platform.h ../include/Scintilla.h \
../src/Selection.h
$(DIR_O)\Style.obj: ../src/Style.cxx ../include/Platform.h ../include/Scintilla.h \ $(DIR_O)\Style.obj: ../src/Style.cxx ../include/Platform.h ../include/Scintilla.h \
../src/Style.h ../src/Style.h
$(DIR_O)\StyleContext.obj: ../src/StyleContext.cxx ../include/Platform.h \ $(DIR_O)\StyleContext.obj: ../src/StyleContext.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../src/StyleContext.h ../src/StyleContext.h
$(DIR_O)\UniConversion.obj: ../src/UniConversion.cxx ../src/UniConversion.h $(DIR_O)\UniConversion.obj: ../src/UniConversion.cxx ../src/UniConversion.h
$(DIR_O)\ViewStyle.obj: ../src/ViewStyle.cxx ../include/Platform.h \ $(DIR_O)\ViewStyle.obj: ../src/ViewStyle.cxx ../include/Platform.h \
@ -535,6 +547,6 @@ $(DIR_O)\ViewStyle.obj: ../src/ViewStyle.cxx ../include/Platform.h \
../src/RunStyles.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \ ../src/RunStyles.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \
../src/Style.h ../src/ViewStyle.h ../src/Style.h ../src/ViewStyle.h
$(DIR_O)\WindowAccessor.obj: ../src/WindowAccessor.cxx ../include/Platform.h \ $(DIR_O)\WindowAccessor.obj: ../src/WindowAccessor.cxx ../include/Platform.h \
../include/PropSet.h ../include/SString.h ../include/Accessor.h \ ../include/PropSet.h ../include/Accessor.h \
../include/WindowAccessor.h ../include/Scintilla.h ../include/WindowAccessor.h ../include/Scintilla.h
$(DIR_O)\XPM.obj: ../src/XPM.cxx ../include/Platform.h ../src/XPM.h $(DIR_O)\XPM.obj: ../src/XPM.cxx ../include/Platform.h ../src/XPM.h