summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2012-07-11 10:21:21 +0000
committerXhmikosR <xhmikosr@users.sourceforge.net>2012-07-11 10:21:21 +0000
commit1a6979e854545da1a5afb8de7a5b13d7916a4c10 (patch)
tree3edce5452b15f2452fd0a41cb9b9998655c82993
parentdadd6de6811ea87689bfb28dd53896ff8c346111 (diff)
downloadnotepad2-mod-1a6979e854545da1a5afb8de7a5b13d7916a4c10.zip
notepad2-mod-1a6979e854545da1a5afb8de7a5b13d7916a4c10.tar.gz
notepad2-mod-1a6979e854545da1a5afb8de7a5b13d7916a4c10.tar.bz2
update scintilla to v3.2.1 (HG 3f9b065c4401)
git-svn-id: https://notepad2-mod.googlecode.com/svn/trunk@751 28bd50df-7adb-d945-0439-6e466c6a13cc
-rw-r--r--Readme-mod.txt2
-rw-r--r--scintilla/doc/ScintillaDownload.html10
-rw-r--r--scintilla/doc/ScintillaHistory.html118
-rw-r--r--scintilla/doc/index.html7
-rw-r--r--scintilla/include/Scintilla.iface6
-rw-r--r--scintilla/lexers/LexCPP.cxx7
-rw-r--r--scintilla/lexers/LexFortran.cxx33
-rw-r--r--scintilla/lexers/LexHTML.cxx2
-rw-r--r--scintilla/lexlib/CharacterSet.h21
-rw-r--r--scintilla/src/Editor.cxx2
-rw-r--r--scintilla/version.txt2
-rw-r--r--scintilla/win32/PlatWin.cxx107
-rw-r--r--scintilla/win32/ScintillaWin.cxx3
13 files changed, 241 insertions, 79 deletions
diff --git a/Readme-mod.txt b/Readme-mod.txt
index c7a0cb0..6f5ad38 100644
--- a/Readme-mod.txt
+++ b/Readme-mod.txt
@@ -31,6 +31,6 @@ Ctrl+Alt+F2 Expand selection to next match.
Ctrl+Alt+Shift+F2 Expand selection to previous match.
Ctrl+Shift+Enter New line with toggled auto indent option.
-Notepad2-mod 4.2.25 has been created with Scintilla 3.2.0 HG 3cb9bb515df2.
+Notepad2-mod 4.2.25 has been created with Scintilla 3.2.1 HG 3f9b065c4401.
You can use WDK 7.1, MSVC 2010 or Intel C++ Compiler XE 2011 SP1 Update 6 (or newer)
to build Notepad2-mod.
diff --git a/scintilla/doc/ScintillaDownload.html b/scintilla/doc/ScintillaDownload.html
index 165b111..ea8c56d 100644
--- a/scintilla/doc/ScintillaDownload.html
+++ b/scintilla/doc/ScintillaDownload.html
@@ -25,9 +25,9 @@
<table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
<tr>
<td>
- <font size="4"> <a href="http://prdownloads.sourceforge.net/scintilla/scintilla320.zip?download">
+ <font size="4"> <a href="http://prdownloads.sourceforge.net/scintilla/scintilla321.zip?download">
Windows</a>&nbsp;&nbsp;
- <a href="http://prdownloads.sourceforge.net/scintilla/scintilla320.tgz?download">
+ <a href="http://prdownloads.sourceforge.net/scintilla/scintilla321.tgz?download">
GTK+/Linux</a>&nbsp;&nbsp;
</font>
</td>
@@ -41,7 +41,7 @@
containing very few restrictions.
</p>
<h3>
- Release 3.2.0
+ Release 3.2.1
</h3>
<h4>
Source Code
@@ -49,8 +49,8 @@
The source code package contains all of the source code for Scintilla but no binary
executable code and is available in
<ul>
- <li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla320.zip?download">zip format</a> (1200K) commonly used on Windows</li>
- <li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla320.tgz?download">tgz format</a> (1080K) commonly used on Linux and compatible operating systems</li>
+ <li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla321.zip?download">zip format</a> (1250K) commonly used on Windows</li>
+ <li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla321.tgz?download">tgz format</a> (1100K) commonly used on Linux and compatible operating systems</li>
</ul>
Instructions for building on both Windows and Linux are included in the readme file.
<h4>
diff --git a/scintilla/doc/ScintillaHistory.html b/scintilla/doc/ScintillaHistory.html
index e7dcf5a..8e41bf3 100644
--- a/scintilla/doc/ScintillaHistory.html
+++ b/scintilla/doc/ScintillaHistory.html
@@ -407,6 +407,8 @@
<td>Fan Yang</td>
</tr><tr>
<td>Denis Shelomovskij</td>
+ <td>darmar</td>
+ <td>John Vella</td>
</tr>
</table>
<p>
@@ -419,6 +421,122 @@
</li>
</ul>
<h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite321.zip?download">Release 3.2.1</a>
+ </h3>
+ <ul>
+ <li>
+ Released 15 July 2012.
+ </li>
+ <li>
+ In Scintilla.iface, specify features as properties instead of functions where possible and fix some enumerations.
+ </li>
+ <li>
+ In SciTE Lua scripts, string properties in Scintilla API can be retrieved as well as set using property notation.
+ </li>
+ <li>
+ Added character class APIs: SCI_SETPUNCTUATIONCHARS, SCI_GETWORDCHARS, SCI_GETWHITESPACECHARS,
+ and SCI_GETPUNCTUATIONCHARS.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3529805&group_id=2439">Feature #3529805.</a>
+ </li>
+ <li>
+ Less/Hss support added to CSS lexer.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3532413&group_id=2439">Feature #3532413.</a>
+ </li>
+ <li>
+ C++ lexer style SCE_C_PREPROCESSORCOMMENT added for stream comments in preprocessor.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3487406&group_id=2439">Bug #3487406.</a>
+ </li>
+ <li>
+ Fix incorrect styling of inactive code in C++ lexer.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3533036&group_id=2439">Bug #3533036.</a>
+ </li>
+ <li>
+ Fix incorrect styling by C++ lexer after empty lines in preprocessor style.
+ </li>
+ <li>
+ C++ lexer option "lexer.cpp.allow.dollars" fixed so can be turned off after being on.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3541461&group_id=2439">Bug #3541461.</a>
+ </li>
+ <li>
+ Fortran fixed format lexer fixed to style comments from column 73.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3540486&group_id=2439">Bug #3540486.</a>
+ </li>
+ <li>
+ Fortran folder folds CRITICAL .. END CRITICAL.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3540486&group_id=2439">Bug #3540486.</a>
+ </li>
+ <li>
+ Fortran lexer fixes styling after comment line ending with '&amp;'.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3087226&group_id=2439">Bug #3087226.</a>
+ </li>
+ <li>
+ Fortran lexer styles preprocessor lines so they do not trigger incorrect folding.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2906275&group_id=2439">Bug #2906275.</a>
+ </li>
+ <li>
+ Fortran folder fixes folding of nested ifs.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2809176&group_id=2439">Bug #2809176.</a>
+ </li>
+ <li>
+ HTML folder fixes folding of CDATA when fold.html.preprocessor=0.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3540491&group_id=2439">Bug #3540491.</a>
+ </li>
+ <li>
+ On Cocoa, fix autocompletion font lifetime issue and row height computation.
+ </li>
+ <li>
+ In 'choose single' mode, autocompletion will close an existing list if asked to display a single entry list.
+ </li>
+ <li>
+ Fixed SCI_MARKERDELETE to only delete one marker per call.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3535806&group_id=2439">Bug #3535806.</a>
+ </li>
+ <li>
+ Properly position caret after undoing coalesced delete operations.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3523326&group_id=2439">Bug #3523326.</a>
+ </li>
+ <li>
+ Ensure margin is redrawn when SCI_MARGINSETSTYLE called.
+ </li>
+ <li>
+ Fix clicks in first pixel of margins to send SCN_MARGINCLICK.
+ </li>
+ <li>
+ Fix infinite loop when drawing block caret for a zero width space character at document start.
+ </li>
+ <li>
+ Crash fixed for deleting negative range.
+ </li>
+ <li>
+ For characters that overlap the beginning of their space such as italics descenders and bold serifs, allow start
+ of text to draw 1 pixel into margin.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=699587&group_id=2439">Bug #699587.</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3537799&group_id=2439">Bug #3537799.</a>
+ </li>
+ <li>
+ Fixed problems compiling Scintilla for Qt with GCC 4.7.1 x64.
+ </li>
+ <li>
+ Fixed problem with determining GTK+ sub-platform caused when adding Qt support in 3.2.0.
+ </li>
+ <li>
+ Fix incorrect measurement of untitled file in SciTE on Linux leading to message "File ...' is 2147483647 bytes long".
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3537764&group_id=2439">Bug #3537764.</a>
+ </li>
+ <li>
+ In SciTE, fix open of selected filename with line number to go to that line.
+ </li>
+ <li>
+ Fix problem with last visible buffer closing in SciTE causing invisible buffers to be active.
+ </li>
+ <li>
+ Avoid blinking of SciTE's current word highlight when output pane changes.
+ </li>
+ <li>
+ SciTE properties files can be longer than 60K.
+ </li>
+ </ul>
+ <h3>
<a href="http://prdownloads.sourceforge.net/scintilla/scite320.zip?download">Release 3.2.0</a>
</h3>
<ul>
diff --git a/scintilla/doc/index.html b/scintilla/doc/index.html
index 725f6c2..96b4673 100644
--- a/scintilla/doc/index.html
+++ b/scintilla/doc/index.html
@@ -9,7 +9,7 @@
<meta name="keywords" content="Scintilla, SciTE, Editing Component, Text Editor" />
<meta name="Description"
content="www.scintilla.org is the home of the Scintilla editing component and SciTE text editor application." />
- <meta name="Date.Modified" content="20120601" />
+ <meta name="Date.Modified" content="20120715" />
<style type="text/css">
#versionlist {
margin: 0;
@@ -55,8 +55,8 @@
GTK+</font>
</td>
<td width="40%" align="right">
- <font color="#FFCC99" size="3"> Release version 3.2.0<br />
- Site last modified June 1 2012</font>
+ <font color="#FFCC99" size="3"> Release version 3.2.1<br />
+ Site last modified July 15 2012</font>
</td>
<td width="20%">
&nbsp;
@@ -71,6 +71,7 @@
</tr>
</table>
<ul id="versionlist">
+ <li>Version 3.2.1 fixes minor bugs.</li>
<li>Version 3.2.0 adds support for the Qt platform and PySide Python bindings.</li>
<li>Version 3.1.0 adds an animated find indicator on Cocoa.</li>
<li>Version 3.0.4 fixes minor problems particularly with Direct2D.</li>
diff --git a/scintilla/include/Scintilla.iface b/scintilla/include/Scintilla.iface
index beed6e0..23eba65 100644
--- a/scintilla/include/Scintilla.iface
+++ b/scintilla/include/Scintilla.iface
@@ -1633,7 +1633,7 @@ fun void DelLineLeft=2395(,)
# Delete forwards from the current position to the end of the line.
fun void DelLineRight=2396(,)
-# Get and Set the xOffset (ie, horizonal scroll position).
+# Get and Set the xOffset (ie, horizontal scroll position).
set void SetXOffset=2397(int newOffset,)
get int GetXOffset=2398(,)
@@ -1667,7 +1667,7 @@ val CARET_JUMPS=0x10
# where most code reside, and the lines after the caret, eg. the body of a function.
val CARET_EVEN=0x08
-# Set the way the caret is kept visible when going sideway.
+# Set the way the caret is kept visible when going sideways.
# The exclusion zone is given in pixels.
fun void SetXCaretPolicy=2402(int caretPolicy, int caretSlop)
@@ -2235,7 +2235,7 @@ fun void ScrollToEnd=2629(,)
val SC_TECHNOLOGY_DEFAULT=0
val SC_TECHNOLOGY_DIRECTWRITE=1
-# Set the technolgy used.
+# Set the technology used.
set void SetTechnology=2630(int technology,)
# Get the tech.
diff --git a/scintilla/lexers/LexCPP.cxx b/scintilla/lexers/LexCPP.cxx
index 705fa01..e7acef0 100644
--- a/scintilla/lexers/LexCPP.cxx
+++ b/scintilla/lexers/LexCPP.cxx
@@ -379,6 +379,12 @@ public:
int SCI_METHOD LexerCPP::PropertySet(const char *key, const char *val) {
if (osCPP.PropertySet(&options, key, val)) {
+ if (strcmp(key, "lexer.cpp.allow.dollars") == 0) {
+ setWord = CharacterSet(CharacterSet::setAlphaNum, "._", 0x80, true);
+ if (options.identifiersAllowDollars) {
+ setWord.Add('$');
+ }
+ }
return 0;
}
return -1;
@@ -453,7 +459,6 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
if (options.identifiersAllowDollars) {
setWordStart.Add('$');
- setWord.Add('$');
}
int chPrevNonWhite = ' ';
diff --git a/scintilla/lexers/LexFortran.cxx b/scintilla/lexers/LexFortran.cxx
index 6698605..d120932 100644
--- a/scintilla/lexers/LexFortran.cxx
+++ b/scintilla/lexers/LexFortran.cxx
@@ -87,7 +87,7 @@ static void ColouriseFortranDoc(unsigned int startPos, int length, int initStyle
/***********************************************/
// Handle the fix format generically
int toLineStart = sc.currentPos - posLineStart;
- if (isFixFormat && (toLineStart < 6 || toLineStart > 72)) {
+ if (isFixFormat && (toLineStart < 6 || toLineStart >= 72)) {
if ((toLineStart == 0 && (tolower(sc.ch) == 'c' || sc.ch == '*')) || sc.ch == '!') {
if (sc.MatchIgnoreCase("cdec$") || sc.MatchIgnoreCase("*dec$") || sc.MatchIgnoreCase("!dec$") ||
sc.MatchIgnoreCase("cdir$") || sc.MatchIgnoreCase("*dir$") || sc.MatchIgnoreCase("!dir$") ||
@@ -99,7 +99,7 @@ static void ColouriseFortranDoc(unsigned int startPos, int length, int initStyle
}
while (!sc.atLineEnd && sc.More()) sc.Forward(); // Until line end
- } else if (toLineStart > 72) {
+ } else if (toLineStart >= 72) {
sc.SetState(SCE_F_COMMENT);
while (!sc.atLineEnd && sc.More()) sc.Forward(); // Until line end
} else if (toLineStart < 5) {
@@ -108,17 +108,27 @@ static void ColouriseFortranDoc(unsigned int startPos, int length, int initStyle
else
sc.SetState(SCE_F_DEFAULT);
} else if (toLineStart == 5) {
- if (!IsASpace(sc.ch) && sc.ch != '0') {
+ //if (!IsASpace(sc.ch) && sc.ch != '0') {
+ if (sc.ch != '\r' && sc.ch != '\n') {
sc.SetState(SCE_F_CONTINUATION);
- sc.ForwardSetState(prevState);
+ if (!IsASpace(sc.ch) && sc.ch != '0')
+ sc.ForwardSetState(prevState);
} else
sc.SetState(SCE_F_DEFAULT);
}
continue;
}
/***************************************/
+ // Hanndle preprocessor directives
+ if (sc.ch == '#' && numNonBlank == 1)
+ {
+ sc.SetState(SCE_F_PREPROCESSOR);
+ while (!sc.atLineEnd && sc.More())
+ sc.Forward(); // Until line end
+ }
+ /***************************************/
// Handle line continuation generically.
- if (!isFixFormat && sc.ch == '&') {
+ if (!isFixFormat && sc.ch == '&' && sc.state != SCE_F_COMMENT) {
char chTemp = ' ';
int j = 1;
while (IsABlank(chTemp) && j<132) {
@@ -252,7 +262,8 @@ static int classifyFoldPointFortran(const char* s, const char* prevWord, const c
|| strcmp(s, "function") == 0 || strcmp(s, "interface") == 0
|| strcmp(s, "module") == 0 || strcmp(s, "program") == 0
|| strcmp(s, "subroutine") == 0 || strcmp(s, "then") == 0
- || (strcmp(s, "type") == 0 && chNextNonBlank != '(') ){
+ || (strcmp(s, "type") == 0 && chNextNonBlank != '(')
+ || strcmp(s, "critical") == 0){
if (strcmp(prevWord, "end") == 0)
lev = 0;
else
@@ -265,12 +276,14 @@ static int classifyFoldPointFortran(const char* s, const char* prevWord, const c
|| strcmp(s, "endfunction") == 0 || strcmp(s, "endinterface") == 0
|| strcmp(s, "endmodule") == 0 || strcmp(s, "endprogram") == 0
|| strcmp(s, "endsubroutine") == 0 || strcmp(s, "endtype") == 0
- || strcmp(s, "endwhere") == 0
- || (strcmp(s, "procedure") == 0 && strcmp(prevWord,"module")==0) ) { // Take care of the module procedure statement
+ || strcmp(s, "endwhere") == 0 || strcmp(s, "endcritical") == 0
+ || (strcmp(s, "procedure") == 0 && strcmp(prevWord, "module") == 0) ) { // Take care of the "module procedure" statement
lev = -1;
} else if (strcmp(prevWord, "end") == 0 && strcmp(s, "if") == 0){ // end if
lev = 0;
- }
+ } else if (strcmp(prevWord, "type") == 0 && strcmp(s, "is") == 0){ // type is
+ lev = -1;
+ }
return lev;
}
// Folding the code
@@ -312,7 +325,7 @@ static void FoldFortranDoc(unsigned int startPos, int length, int initStyle,
styleNext = styler.StyleAt(i + 1);
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
//
- if (stylePrev == SCE_F_DEFAULT && (style == SCE_F_WORD || style == SCE_F_LABEL)) {
+ if (((isFixFormat && stylePrev == SCE_F_CONTINUATION) || stylePrev == SCE_F_DEFAULT || stylePrev == SCE_F_OPERATOR) && (style == SCE_F_WORD || style == SCE_F_LABEL)) {
// Store last word and label start point.
lastStart = i;
}
diff --git a/scintilla/lexers/LexHTML.cxx b/scintilla/lexers/LexHTML.cxx
index fd781e7..3af2b6d 100644
--- a/scintilla/lexers/LexHTML.cxx
+++ b/scintilla/lexers/LexHTML.cxx
@@ -1089,7 +1089,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
state = SCE_H_SGML_COMMAND; // wait for a pending command
}
// fold whole tag (-- when closing the tag)
- if (foldHTMLPreprocessor || (state == SCE_H_COMMENT))
+ if (foldHTMLPreprocessor || state == SCE_H_COMMENT || state == SCE_H_CDATA)
levelCurrent++;
continue;
}
diff --git a/scintilla/lexlib/CharacterSet.h b/scintilla/lexlib/CharacterSet.h
index 643359d..9c3c252 100644
--- a/scintilla/lexlib/CharacterSet.h
+++ b/scintilla/lexlib/CharacterSet.h
@@ -40,11 +40,32 @@ public:
if (base & setDigits)
AddString("0123456789");
}
+ CharacterSet(const CharacterSet &other) {
+ size = other.size;
+ valueAfter = other.valueAfter;
+ bset = new bool[size];
+ for (int i=0; i < size; i++) {
+ bset[i] = other.bset[i];
+ }
+ }
~CharacterSet() {
delete []bset;
bset = 0;
size = 0;
}
+ CharacterSet &operator=(const CharacterSet &other) {
+ if (this != &other) {
+ bool *bsetNew = new bool[other.size];
+ for (int i=0; i < other.size; i++) {
+ bsetNew[i] = other.bset[i];
+ }
+ delete []bset;
+ size = other.size;
+ valueAfter = other.valueAfter;
+ bset = bsetNew;
+ }
+ return *this;
+ }
void Add(int val) {
assert(val >= 0);
assert(val < size);
diff --git a/scintilla/src/Editor.cxx b/scintilla/src/Editor.cxx
index e6929fb..bbbf528 100644
--- a/scintilla/src/Editor.cxx
+++ b/scintilla/src/Editor.cxx
@@ -4438,7 +4438,7 @@ bool Editor::NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt) {
int marginClicked = -1;
int x = 0;
for (int margin = 0; margin < ViewStyle::margins; margin++) {
- if ((pt.x > x) && (pt.x < x + vs.ms[margin].width))
+ if ((pt.x >= x) && (pt.x < x + vs.ms[margin].width))
marginClicked = margin;
x += vs.ms[margin].width;
}
diff --git a/scintilla/version.txt b/scintilla/version.txt
index 5200413..27943c8 100644
--- a/scintilla/version.txt
+++ b/scintilla/version.txt
@@ -1 +1 @@
-320
+321
diff --git a/scintilla/win32/PlatWin.cxx b/scintilla/win32/PlatWin.cxx
index fa52f5c..853ed6d 100644
--- a/scintilla/win32/PlatWin.cxx
+++ b/scintilla/win32/PlatWin.cxx
@@ -779,44 +779,46 @@ void SurfaceGDI::AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fil
HBITMAP hbmMem = CreateDIBSection(reinterpret_cast<HDC>(hMemDC), &bpih,
DIB_RGB_COLORS, &image, NULL, 0);
- HBITMAP hbmOld = SelectBitmap(hMemDC, hbmMem);
-
- DWORD valEmpty = dwordFromBGRA(0,0,0,0);
- DWORD valFill = dwordFromBGRA(
- static_cast<byte>(GetBValue(fill.AsLong()) * alphaFill / 255),
- static_cast<byte>(GetGValue(fill.AsLong()) * alphaFill / 255),
- static_cast<byte>(GetRValue(fill.AsLong()) * alphaFill / 255),
- static_cast<byte>(alphaFill));
- DWORD valOutline = dwordFromBGRA(
- static_cast<byte>(GetBValue(outline.AsLong()) * alphaOutline / 255),
- static_cast<byte>(GetGValue(outline.AsLong()) * alphaOutline / 255),
- static_cast<byte>(GetRValue(outline.AsLong()) * alphaOutline / 255),
- static_cast<byte>(alphaOutline));
- DWORD *pixels = reinterpret_cast<DWORD *>(image);
- for (int y=0; y<height; y++) {
- for (int x=0; x<width; x++) {
- if ((x==0) || (x==width-1) || (y == 0) || (y == height-1)) {
- pixels[y*width+x] = valOutline;
- } else {
- pixels[y*width+x] = valFill;
+ if (hbmMem) {
+ HBITMAP hbmOld = SelectBitmap(hMemDC, hbmMem);
+
+ DWORD valEmpty = dwordFromBGRA(0,0,0,0);
+ DWORD valFill = dwordFromBGRA(
+ static_cast<byte>(GetBValue(fill.AsLong()) * alphaFill / 255),
+ static_cast<byte>(GetGValue(fill.AsLong()) * alphaFill / 255),
+ static_cast<byte>(GetRValue(fill.AsLong()) * alphaFill / 255),
+ static_cast<byte>(alphaFill));
+ DWORD valOutline = dwordFromBGRA(
+ static_cast<byte>(GetBValue(outline.AsLong()) * alphaOutline / 255),
+ static_cast<byte>(GetGValue(outline.AsLong()) * alphaOutline / 255),
+ static_cast<byte>(GetRValue(outline.AsLong()) * alphaOutline / 255),
+ static_cast<byte>(alphaOutline));
+ DWORD *pixels = reinterpret_cast<DWORD *>(image);
+ for (int y=0; y<height; y++) {
+ for (int x=0; x<width; x++) {
+ if ((x==0) || (x==width-1) || (y == 0) || (y == height-1)) {
+ pixels[y*width+x] = valOutline;
+ } else {
+ pixels[y*width+x] = valFill;
+ }
}
}
- }
- for (int c=0;c<cornerSize; c++) {
- for (int x=0;x<c+1; x++) {
- AllFour(pixels, width, height, x, c-x, valEmpty);
+ for (int c=0;c<cornerSize; c++) {
+ for (int x=0;x<c+1; x++) {
+ AllFour(pixels, width, height, x, c-x, valEmpty);
+ }
+ }
+ for (int x=1;x<cornerSize; x++) {
+ AllFour(pixels, width, height, x, cornerSize-x, valOutline);
}
- }
- for (int x=1;x<cornerSize; x++) {
- AllFour(pixels, width, height, x, cornerSize-x, valOutline);
- }
- BLENDFUNCTION merge = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ BLENDFUNCTION merge = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
- AlphaBlendFn(reinterpret_cast<HDC>(hdc), rc.left, rc.top, width, height, hMemDC, 0, 0, width, height, merge);
+ AlphaBlendFn(reinterpret_cast<HDC>(hdc), rc.left, rc.top, width, height, hMemDC, 0, 0, width, height, merge);
- SelectBitmap(hMemDC, hbmOld);
- ::DeleteObject(hbmMem);
+ SelectBitmap(hMemDC, hbmOld);
+ ::DeleteObject(hbmMem);
+ }
::DeleteDC(hMemDC);
} else {
BrushColor(outline);
@@ -839,26 +841,28 @@ void SurfaceGDI::DrawRGBAImage(PRectangle rc, int width, int height, const unsig
unsigned char *image = 0;
HBITMAP hbmMem = CreateDIBSection(reinterpret_cast<HDC>(hMemDC), &bpih,
DIB_RGB_COLORS, reinterpret_cast<void **>(&image), NULL, 0);
- HBITMAP hbmOld = SelectBitmap(hMemDC, hbmMem);
+ if (hbmMem) {
+ HBITMAP hbmOld = SelectBitmap(hMemDC, hbmMem);
- for (int y=height-1; y>=0; y--) {
- for (int x=0; x<width; x++) {
- unsigned char *pixel = image + (y*width+x) * 4;
- unsigned char alpha = pixelsImage[3];
- // Input is RGBA, output is BGRA with premultiplied alpha
- pixel[2] = (*pixelsImage++) * alpha / 255;
- pixel[1] = (*pixelsImage++) * alpha / 255;
- pixel[0] = (*pixelsImage++) * alpha / 255;
- pixel[3] = *pixelsImage++;
+ for (int y=height-1; y>=0; y--) {
+ for (int x=0; x<width; x++) {
+ unsigned char *pixel = image + (y*width+x) * 4;
+ unsigned char alpha = pixelsImage[3];
+ // Input is RGBA, output is BGRA with premultiplied alpha
+ pixel[2] = (*pixelsImage++) * alpha / 255;
+ pixel[1] = (*pixelsImage++) * alpha / 255;
+ pixel[0] = (*pixelsImage++) * alpha / 255;
+ pixel[3] = *pixelsImage++;
+ }
}
- }
- BLENDFUNCTION merge = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ BLENDFUNCTION merge = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
- AlphaBlendFn(reinterpret_cast<HDC>(hdc), rc.left, rc.top, rc.Width(), rc.Height(), hMemDC, 0, 0, width, height, merge);
+ AlphaBlendFn(reinterpret_cast<HDC>(hdc), rc.left, rc.top, rc.Width(), rc.Height(), hMemDC, 0, 0, width, height, merge);
- SelectBitmap(hMemDC, hbmOld);
- ::DeleteObject(hbmMem);
+ SelectBitmap(hMemDC, hbmOld);
+ ::DeleteObject(hbmMem);
+ }
::DeleteDC(hMemDC);
}
@@ -2498,14 +2502,13 @@ void ListBoxX::SetList(const char *list, char separator, char typesep) {
// the listbox is not visible.
SetRedraw(false);
Clear();
- size_t size = strlen(list) + 1;
- char *words = new char[size];
+ size_t size = strlen(list);
+ char *words = new char[size+1];
lti.SetWords(words);
- memcpy(words, list, size);
+ memcpy(words, list, size+1);
char *startword = words;
char *numword = NULL;
- int i = 0;
- for (; words[i]; i++) {
+ for (size_t i=0; i < size; i++) {
if (words[i] == separator) {
words[i] = '\0';
if (numword)
diff --git a/scintilla/win32/ScintillaWin.cxx b/scintilla/win32/ScintillaWin.cxx
index cccc457..1f357cf 100644
--- a/scintilla/win32/ScintillaWin.cxx
+++ b/scintilla/win32/ScintillaWin.cxx
@@ -391,7 +391,8 @@ void ScintillaWin::Initialise() {
// Find TrackMouseEvent which is available on Windows > 95
HMODULE user32 = ::GetModuleHandle(TEXT("user32.dll"));
- TrackMouseEventFn = (TrackMouseEventSig)::GetProcAddress(user32, "TrackMouseEvent");
+ if (user32)
+ TrackMouseEventFn = (TrackMouseEventSig)::GetProcAddress(user32, "TrackMouseEvent");
if (TrackMouseEventFn == NULL) {
// Windows 95 has an emulation in comctl32.dll:_TrackMouseEvent
HMODULE commctrl32 = ::LoadLibrary(TEXT("comctl32.dll"));