Merge remote-tracking branch 'origin/master' into tm/tree-refactoring
Conflicts: makefile.win32 src/makefile.win32
This commit is contained in:
commit
c72dce06a5
6875
ChangeLog.pre-1-22
Normal file
6875
ChangeLog.pre-1-22
Normal file
File diff suppressed because it is too large
Load Diff
20
Makefile.am
20
Makefile.am
@ -34,6 +34,7 @@ EXTRA_DIST = \
|
||||
geany.pc.in \
|
||||
geany.spec \
|
||||
ChangeLog.pre-0-17 \
|
||||
ChangeLog.pre-1-22 \
|
||||
HACKING \
|
||||
README.I18N \
|
||||
README.Packagers \
|
||||
@ -85,11 +86,19 @@ install-data-only:
|
||||
done
|
||||
|
||||
|
||||
BZIP2_ENV =--best
|
||||
dist-hook:
|
||||
@if test -d "$(top_srcdir)/.git"; then \
|
||||
echo ' GEN ChangeLog'; \
|
||||
( cd "$(top_srcdir)" && \
|
||||
echo '# Generated by Makefile. Do not edit.' && echo && \
|
||||
git log --stat 0.21.0.. ) > ChangeLog.tmp \
|
||||
&& mv -f ChangeLog.tmp "$(distdir)/ChangeLog" \
|
||||
|| ( rm -f ChangeLog.tmp ; \
|
||||
echo 'Failed to generate ChangeLog' >&2 ); \
|
||||
else \
|
||||
echo 'A git clone is required to generate a ChangeLog' >&2; \
|
||||
fi
|
||||
|
||||
dist-bzip2: distdir
|
||||
BZIP2=$(BZIP2_ENV) $(AMTAR) --bzip2 -chof $(distdir).tar.bz2 $(distdir)
|
||||
-rm -rf $(distdir)
|
||||
|
||||
sign:
|
||||
if test -f $(PACKAGE)-$(VERSION).tar.gz; then \
|
||||
@ -97,9 +106,6 @@ sign:
|
||||
if test -f $(PACKAGE)-$(VERSION).tar.bz2; then \
|
||||
gpg --detach-sign --digest-algo SHA512 $(PACKAGE)-$(VERSION).tar.bz2; fi
|
||||
|
||||
deb:
|
||||
dpkg-buildpackage -rfakeroot
|
||||
|
||||
|
||||
rpm: dist
|
||||
rpmbuild -ta $(distdir).tar.gz
|
||||
|
33
NEWS
33
NEWS
@ -1,4 +1,10 @@
|
||||
Geany 1.22 (unreleased)
|
||||
Geany 1.23 (unreleased)
|
||||
|
||||
Editor
|
||||
* Update Scintilla to version 3.2.0.
|
||||
|
||||
|
||||
Geany 1.22 (June 18, 2012)
|
||||
|
||||
General
|
||||
* Bump dependencies to GTK >= 2.16 and GLib >= 2.20.
|
||||
@ -6,28 +12,39 @@ Geany 1.22 (unreleased)
|
||||
* Rewrite theming support for better flexibility.
|
||||
* Add support for opening files read-only from the command line.
|
||||
* Always load the default session if configured to do so.
|
||||
* Make all filetypes use named styles to simplify colour scheme
|
||||
* Make all filetypes use named styles to simplify color scheme
|
||||
authoring.
|
||||
* Make 'Replace Spaces by Tabs' only match leading spaces to
|
||||
preserve alignment.
|
||||
|
||||
Possibly incompatible changes
|
||||
* Theming and filetype style changes mean old filetypes and color
|
||||
schemes are not compatible with this version of Geany.
|
||||
* There are some default keybinding changes but these will only
|
||||
apply to newly created configurations.
|
||||
* Changes to the "project-dialog*" signals may affect plugins.
|
||||
|
||||
Bug fixes
|
||||
* Fix escaping of session file paths (#3425969).
|
||||
* Fix closing when minimized under Windows (#3421282).
|
||||
* Properly handle remote URIs received through drag 'n drop
|
||||
(#2966770, #3479567).
|
||||
* Fix build with bleeding-edge GLib (#3483388).
|
||||
* Fix colour scheme selection in Ubuntu Unity (#3479674).
|
||||
* Fix color scheme selection in Ubuntu Unity (#3479674).
|
||||
* Fix very slow regex tag parsing on Windows (e.g. for HTML).
|
||||
* Fix detecting a changed file on disk when opening from
|
||||
the command-line (Windows).
|
||||
* Fix quick search entry behavior on Windows.
|
||||
* Fix keybindings conflicts check when swapping a binding.
|
||||
* Fix comments insertion in some cases (#3449635, #3534320).
|
||||
* Add missing Windows mio makefile.
|
||||
|
||||
Prefs
|
||||
* Split "always wrap search and hide find dialog" pref into
|
||||
"always wrap search" and "hide find dialog" (Dimitar Zhekov).
|
||||
* Add Project Properties overrides for 'Saving files' prefs.
|
||||
* Add hidden VTE preference "send_cmd_prefix" to prefix commands sent
|
||||
to the VTE. (See the manual for details).
|
||||
|
||||
Interface
|
||||
* Add support for switching to the last used document after closing
|
||||
@ -73,8 +90,9 @@ Geany 1.22 (unreleased)
|
||||
* Parse PHP functions with multiline argument list (#3037797).
|
||||
* Handle ``/bin/dash`` shebang (#3470986).
|
||||
* Update JavaScript parser from CTags.
|
||||
* Parse D class, struct, interface template bodies and template
|
||||
blocks; ignore 'static if' expressions.
|
||||
* Parse D class/struct/interface template bodies and template
|
||||
blocks; ignore 'static if' expressions; parse function
|
||||
@attributes, pure/nothrow and immutable/inout/shared return types.
|
||||
* Fix broken tag/word autocompletion in HTML/PHP documents.
|
||||
* Enable &entity; completion for all XML-based filetypes.
|
||||
|
||||
@ -94,9 +112,10 @@ Geany 1.22 (unreleased)
|
||||
* Add stash_group_free_settings().
|
||||
* Add support for plugins written in C++.
|
||||
|
||||
Internationalisation:
|
||||
Internationalization:
|
||||
* Add translations: ar, id, lt, mn, nn, sk
|
||||
* Update translations: de, hu, it, kk, pl, sl, sv, zh_TW
|
||||
* Update translations: de, es, fr, hu, it, ja, kk, lt, nl, pl, pt,
|
||||
pt_BR, sk, sl, sv, tr, zh_CN, zh_TW
|
||||
|
||||
|
||||
Geany 0.21 (October 2, 2011)
|
||||
|
2
README
2
README
@ -102,7 +102,7 @@ file.
|
||||
|
||||
|
||||
--
|
||||
2005-2011 by Enrico Tröger, Nick Treleaven, Colomban Wendling, Matthew Brush and Frank Lanitz
|
||||
2005-2012 by Enrico Tröger, Nick Treleaven, Colomban Wendling, Matthew Brush and Frank Lanitz
|
||||
enrico(dot)troeger(at)uvena(dot)de
|
||||
nick(dot)treleaven(at)btinternet(dot)com
|
||||
lists(dot)ban(at)herbesfolles(dot)org
|
||||
|
@ -82,7 +82,7 @@ list to stay informed about major changes and of course, new releases.
|
||||
|
||||
|
||||
--
|
||||
2008-2011 by Enrico Tröger, Nick Treleaven, Colomban Wendling, Matthew Brush and Frank Lanitz
|
||||
2008-2012 by Enrico Tröger, Nick Treleaven, Colomban Wendling, Matthew Brush and Frank Lanitz
|
||||
enrico(dot)troeger(at)uvena(dot)de
|
||||
nick(dot)treleaven(at)btinternet(dot)com
|
||||
lists(dot)ban(at)herbesfolles(dot)org
|
||||
|
16
THANKS
16
THANKS
@ -94,8 +94,8 @@ Translators:
|
||||
------------
|
||||
These people have translated Geany to foreign languages:
|
||||
|
||||
Fayssal Chamekh <chamfay(at)gmail(dot)com - ar
|
||||
Marcos Costales <marcoscostales(at)gmail(dot)com - ast
|
||||
Fayssal Chamekh <chamfay(at)gmail(dot)com> - ar
|
||||
Marcos Costales <marcoscostales(at)gmail(dot)com> - ast
|
||||
Yura Siamashka <yurand2(at)gmail(dot)com> - be_BY
|
||||
Dilyan Rusev <dilyanrusev(at)gmail(dot)com> - bg
|
||||
Toni Garcia-Navarro <topi(at)elpiset(dot)net> - ca_ES
|
||||
@ -105,7 +105,7 @@ Karel Kolman <kolmis(at)gmail(dot)com> - cs_CZ
|
||||
Frank Lanitz <frank(at)frank(dot)uvena(dot)de> - de_DE
|
||||
Dominic Hopf <dmaphy(at)googlemail(dot)com> - de_DE
|
||||
Stavros Temertzidis <bullgr(at)gmail(dot)com> - el
|
||||
Jeff Bailes <thepizzaking(at)gmail(dot)com - en_GB
|
||||
Jeff Bailes <thepizzaking(at)gmail(dot)com> - en_GB
|
||||
Damián Viano <debian(at)damianv(dot)com(dot)ar> - es
|
||||
Antonio Jiménez González <tonificante(at)hotmail(dot)com> - es
|
||||
Nacho Cabanes <ncabanes(at)gmail(dot)com> - es
|
||||
@ -116,7 +116,7 @@ Jari Rahkonen <jari(dot)rahkonen(at)pp1(dot)inet(dot)fi> - fi
|
||||
Jean-Philippe Moal <skateinmars(at)skateinmars(dot)net> - fr
|
||||
Roland Baudin <roland(dot)baudin(at)thalesaleniaspace(dot)com> - fr
|
||||
Lionel Fuentes <funto66(at)gmail(dot)com> - fr
|
||||
Benjamin Ballet <benjamin(dot)ballet(at)gmail(dot)com -fr
|
||||
Benjamin Ballet <benjamin(dot)ballet(at)gmail(dot)com> -fr
|
||||
José Manuel Castroagudín Silva <chavescesures(at)mail(dot)com> - gl
|
||||
Gabor Kmetyko aka kilo <kg_kilo(at)freemail(dot)hu> - hu
|
||||
M.Baldinelli <m(dot)baldinelli(at)agora(dot)it> - it
|
||||
@ -127,10 +127,10 @@ Chikahiro Masami <cmasa(dot)z321(at)gmail(dot)com> - ja
|
||||
Park Jang-heon <dotkabi(at)gmail(dot)com> - ko
|
||||
Baurzhan Muftakhidinov <baurthefirst(at)gmail(dot)com> - kk
|
||||
Laurent Hoeltgen <hoeltgman(at)gmail(dot)com> - lb
|
||||
Algimantas Margevičius <margevicius(dot)algimantas(at)gmail(dot)com - lt
|
||||
Algimantas Margevičius <margevicius(dot)algimantas(at)gmail(dot)com> - lt
|
||||
tsetsee <tsetsee(dot)yugi(at)gmail(dot)com> - mn
|
||||
Kurt De Bree <kdebree(at)telenet(dot)be> - nl
|
||||
Peter Scholtens <<peter(dot)scholtens(at)xs4all(dot)nl> - nl
|
||||
Peter Scholtens <peter(dot)scholtens(at)xs4all(dot)nl> - nl
|
||||
Ayke van Laethem <aykevanlaethem(at)gmail(dot)com> - nl
|
||||
Jacek Wolszczak <shutdownrunner(at)o2(dot)pl> - pl_PL
|
||||
Jarosław Foksa <jfoksa(at)gmail(dot)com> - pl_PL
|
||||
@ -138,7 +138,7 @@ Krzysztof Troska <elleander86(at)gmail(dot)com> - pl_PL
|
||||
Wojciech Świderski <woj.swiderski@gmail.com> - pl_PL
|
||||
Alexandre Moreira <alexandream(at)gmail(dot)com> - pt_BR
|
||||
Adrovane Marques Kade <adrovane(at)gmail(dot)com> - pt_BR
|
||||
Rafael Peregrino da Silva <rperegrino(at)linuxnewmedia(dot)com(dot)br - pt_BR
|
||||
Rafael Peregrino da Silva <rperegrino(at)linuxnewmedia(dot)com(dot)br> - pt_BR
|
||||
Alex Eftimie <alex(at)rosedu(dot)org> - ro
|
||||
brahmann_ <brahmann(at)pisem(dot)net> - ru_RU
|
||||
Nikita E. Shalaev <nshalaev(at)eu(dot)spb(dot)ru> - ru_RU
|
||||
@ -148,7 +148,7 @@ John Wehin <john(dot)wehin(at)gmail(dot)com> - ru_RU
|
||||
Tomáš Vadina <kyberdev(at)gmail(dot)com> - sk
|
||||
Jože Klepec <joze(dot)klepec(at)siol(dot)net> - sl
|
||||
Tony Mattsson <superxorn(at)gmail(dot)com> - sv
|
||||
Gürkan Gür <seqizz(at)gmail(dot)com - tr
|
||||
Gürkan Gür <seqizz(at)gmail(dot)com> - tr
|
||||
Boris Dibrov <dibrov(dot)bor(at)gmail(dot)com> - uk
|
||||
Clytie Siddall <clytie(at)riverland(dot)net(dot)au> - vi_VN
|
||||
Dormouse Young <mouselinux(at)163(dot)com> - zh_CN
|
||||
|
@ -1,7 +1,7 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ([2.60])
|
||||
AC_INIT([Geany], [1.22],
|
||||
AC_INIT([Geany], [1.23],
|
||||
[https://sourceforge.net/tracker/?group_id=153444&atid=787791])
|
||||
AC_CONFIG_SRCDIR([src/geany.h])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
|
@ -69,7 +69,6 @@ character=string_1
|
||||
backticks=string_2
|
||||
here_doc=string_2
|
||||
|
||||
scalar=string_2
|
||||
label=default,bold
|
||||
preprocessor=0x808000
|
||||
regex=number_1
|
||||
|
@ -5,8 +5,8 @@
|
||||
# all items must be in one line
|
||||
primary=abstract and array as assert async bool break byte case cast char class const construct continue date datetime decimal dedent def default delegate delete dict div do double downto dynamic else ensures enum errordomain event except exception extern false final finally float for foreach get hash identifier if implements implements in init inline int int16 int32 int64 int8 interface internal is isa list lock long max min namespace namespace new not null object of or otherwise out override owned params pass print private prop protected public raise raises readonly ref requires return sbyte self set short single sizeof size_t ssize_t static string struct super to true try typeof uint uint32 uint64 uint8 ulong unichar unit16 unless unowned uses uses ushort var virtual void volatile weak when while writeonly yield
|
||||
#secondary=
|
||||
# these are some doxygen keywords (incomplete)
|
||||
docComment=attention author brief bug class code date def enum example exception file fn namespace note param remarks return see since struct throw todo typedef var version warning union
|
||||
# these are the Doxygen and Valadoc keywords
|
||||
docComment=a addindex addtogroup anchor arg attention author authors b brief bug c callergraph callgraph category cite class code cond copybrief copydetails copydoc copyright date def defgroup deprecated details dir dontinclude dot dotfile e else elseif em endcode endcond enddot endhtmlonly endif endinternal endlatexonly endlink endmanonly endmsc endrtfonly endverbatim endxmlonly enum example exception extends file fn headerfile hideinitializer htmlinclude htmlonly if ifnot image implements include includelineno ingroup inheritDoc interface internal invariant latexonly li line link mainpage manonly memberof msc mscfile n name namespace nosubgrouping note overload p package page par paragraph param post pre private privatesection property protected protectedsection protocol public publicsection ref related relatedalso relates relatesalso remark remarks result return returns retval rtfonly sa section see short showinitializer since skip skipline snippet struct subpage subsection subsubsection tableofcontents test throw throws todo tparam typedef union until var verbatim verbinclude version warning weakgroup xmlonly xrefitem
|
||||
|
||||
[lexer_properties]
|
||||
lexer.cpp.triplequoted.strings=1
|
||||
|
@ -6,7 +6,7 @@ word=keyword_1
|
||||
identifier=identifier_1
|
||||
number=number
|
||||
delimiter=operator
|
||||
character=string_1
|
||||
character=character
|
||||
charactereol=string_eol
|
||||
string=string_1
|
||||
stringeol=string_eol
|
||||
|
@ -14,7 +14,7 @@ mathinstruction=keyword_2
|
||||
register=type
|
||||
directive=preprocessor
|
||||
directiveoperand=keyword_3
|
||||
character=string_1
|
||||
character=character
|
||||
stringeol=string_eol
|
||||
extinstruction=keyword_4
|
||||
|
||||
|
@ -9,7 +9,7 @@ number=number_1
|
||||
word=keyword_1
|
||||
word2=keyword_2
|
||||
string=string_1
|
||||
character=string_1
|
||||
character=character
|
||||
uuid=other
|
||||
preprocessor=preprocessor
|
||||
operator=operator
|
||||
@ -23,13 +23,14 @@ commentdockeyworderror=comment_doc_keyword_error
|
||||
globalclass=class
|
||||
# """verbatim"""
|
||||
tripleverbatim=string_2
|
||||
hashquotedstring=string_2
|
||||
|
||||
[keywords]
|
||||
# all items must be in one line
|
||||
primary=asm auto break case char const continue default do double else enum extern float for goto if inline int long register restrict return short signed sizeof static struct switch typedef union unsigned void volatile while FALSE NULL TRUE
|
||||
secondary=
|
||||
# these are some doxygen keywords (incomplete)
|
||||
docComment=attention author brief bug class code date def enum example exception file fn namespace note param remarks return see since struct throw todo typedef var version warning union
|
||||
# these are the Doxygen keywords
|
||||
docComment=a addindex addtogroup anchor arg attention author authors b brief bug c callergraph callgraph category cite class code cond copybrief copydetails copydoc copyright date def defgroup deprecated details dir dontinclude dot dotfile e else elseif em endcode endcond enddot endhtmlonly endif endinternal endlatexonly endlink endmanonly endmsc endrtfonly endverbatim endxmlonly enum example exception extends file fn headerfile hideinitializer htmlinclude htmlonly if ifnot image implements include includelineno ingroup interface internal invariant latexonly li line link mainpage manonly memberof msc mscfile n name namespace nosubgrouping note overload p package page par paragraph param post pre private privatesection property protected protectedsection protocol public publicsection ref related relatedalso relates relatesalso remark remarks result return returns retval rtfonly sa section see short showinitializer since skip skipline snippet struct subpage subsection subsubsection tableofcontents test throw throws todo tparam typedef union until var verbatim verbinclude version warning weakgroup xmlonly xrefitem
|
||||
|
||||
[lexer_properties]
|
||||
styling.within.preprocessor=1
|
||||
|
@ -154,7 +154,6 @@ character=string_1
|
||||
backticks=string_2
|
||||
here_doc=string_2
|
||||
|
||||
scalar=string_2
|
||||
label=default,bold
|
||||
preprocessor=0x007f7f
|
||||
regex=number_1
|
||||
|
@ -5,8 +5,8 @@
|
||||
# all items must be in one line
|
||||
primary=alignas alignof and and_eq asm auto bitand bitor bool break case catch char char16_t char32_t class compl const const_cast constexpr continue decltype default delete do double dynamic_cast else enum explicit export extern false final float for friend goto if inline int int8_t int16_t int32_t int64_t long mutable namespace new noexcept not not_eq nullptr operator or or_eq override private protected ptrdiff_t public register reinterpret_cast return short signed sizeof size_t static static_assert static_cast struct switch template this thread_local throw true try typedef typeid typename union unsigned using virtual void volatile wchar_t while xor xor_eq
|
||||
secondary=
|
||||
# these are some doxygen keywords (incomplete)
|
||||
docComment=attention author brief bug class code date def enum example exception file fn namespace note param remarks return see since struct throw todo tparam typedef var version warning union
|
||||
# these are the Doxygen keywords
|
||||
docComment=a addindex addtogroup anchor arg attention author authors b brief bug c callergraph callgraph category cite class code cond copybrief copydetails copydoc copyright date def defgroup deprecated details dir dontinclude dot dotfile e else elseif em endcode endcond enddot endhtmlonly endif endinternal endlatexonly endlink endmanonly endmsc endrtfonly endverbatim endxmlonly enum example exception extends file fn headerfile hideinitializer htmlinclude htmlonly if ifnot image implements include includelineno ingroup interface internal invariant latexonly li line link mainpage manonly memberof msc mscfile n name namespace nosubgrouping note overload p package page par paragraph param post pre private privatesection property protected protectedsection protocol public publicsection ref related relatedalso relates relatesalso remark remarks result return returns retval rtfonly sa section see short showinitializer since skip skipline snippet struct subpage subsection subsubsection tableofcontents test throw throws todo tparam typedef union until var verbatim verbinclude version warning weakgroup xmlonly xrefitem
|
||||
|
||||
[lexer_properties]
|
||||
styling.within.preprocessor=1
|
||||
|
@ -16,6 +16,7 @@ attribute=attribute
|
||||
value=value
|
||||
id=number
|
||||
identifier2=keyword_2
|
||||
variable=identifier_1
|
||||
important=extra
|
||||
directive=preprocessor
|
||||
identifier3=keyword_3
|
||||
|
@ -28,6 +28,9 @@ secondary=
|
||||
docComment=Authors Bugs Copyright Date Deprecated Examples History License Macros Params Returns See_Also Standards Throws Version
|
||||
types=
|
||||
|
||||
[lexer_properties]
|
||||
fold.d.comment.explicit=0
|
||||
|
||||
[settings]
|
||||
# default extension used when saving files
|
||||
extension=d
|
||||
|
@ -10,13 +10,13 @@ string=string_1
|
||||
character=character
|
||||
preprocessor=preprocessor
|
||||
operator=operator
|
||||
identifier=identifier_1
|
||||
scalar=scalar
|
||||
identifier=identifier
|
||||
scalar=identifier_1
|
||||
pod=comment_doc
|
||||
regex=regex
|
||||
array=regex
|
||||
hash=regex
|
||||
symboltable=number_2
|
||||
array=identifier_2
|
||||
hash=identifier_3
|
||||
symboltable=identifier_4
|
||||
backticks=backticks
|
||||
pod_verbatim=comment_doc_keyword
|
||||
reg_subst=regex
|
||||
|
@ -8,10 +8,10 @@ word=keyword_1
|
||||
string=string_1
|
||||
character=character
|
||||
operator=operator
|
||||
identifier=identifier_1
|
||||
identifier=identifier
|
||||
backticks=backticks
|
||||
param=parameter
|
||||
scalar=scalar
|
||||
scalar=identifier_1
|
||||
error=error
|
||||
here_delim=here_doc
|
||||
here_q=here_doc
|
||||
|
@ -5,8 +5,8 @@
|
||||
# all items must be in one line
|
||||
primary=abstract as async base bool break callback case catch char class const constpointer construct continue default delegate delete do double dynamic else ensures enum errordomain extern false finally float for foreach generic get global if in inline int int16 int32 int64 int8 interface internal is lock long namespace new null out override owned private protected public ref requires return set sealed short signal size_t sizeof ssize_t static string struct switch this throw throws time_t true try typeof uchar uint uint16 uint32 uint64 uint8 ulong unichar unowned ushort using value var virtual void weak while yield
|
||||
#secondary=
|
||||
# these are some doxygen and valadoc keywords (incomplete)
|
||||
docComment=attention author brief bug class code date def deprecated enum example exception file fn inheritDoc link namespace note param remarks return see since struct throw throws todo typedef union var version warning
|
||||
# these are the Doxygen and Valadoc keywords
|
||||
docComment=a addindex addtogroup anchor arg attention author authors b brief bug c callergraph callgraph category cite class code cond copybrief copydetails copydoc copyright date def defgroup deprecated details dir dontinclude dot dotfile e else elseif em endcode endcond enddot endhtmlonly endif endinternal endlatexonly endlink endmanonly endmsc endrtfonly endverbatim endxmlonly enum example exception extends file fn headerfile hideinitializer htmlinclude htmlonly if ifnot image implements include includelineno ingroup inheritDoc interface internal invariant latexonly li line link mainpage manonly memberof msc mscfile n name namespace nosubgrouping note overload p package page par paragraph param post pre private privatesection property protected protectedsection protocol public publicsection ref related relatedalso relates relatesalso remark remarks result return returns retval rtfonly sa section see short showinitializer since skip skipline snippet struct subpage subsection subsubsection tableofcontents test throw throws todo tparam typedef union until var verbatim verbinclude version warning weakgroup xmlonly xrefitem
|
||||
|
||||
[lexer_properties]
|
||||
styling.within.preprocessor=1
|
||||
|
@ -1,4 +1,4 @@
|
||||
.TH "GEANY" "1" "October 02, 2011" "geany @VERSION@" ""
|
||||
.TH "GEANY" "1" "June 18, 2012" "geany @VERSION@" ""
|
||||
.SH "NAME"
|
||||
Geany \(em a small and lightweight IDE
|
||||
.SH "SYNOPSIS"
|
||||
|
@ -5,8 +5,8 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.8.1: http://docutils.sourceforge.net/" />
|
||||
<title>Geany</title>
|
||||
<meta name="authors" content="Enrico Tröger Nick Treleaven Frank Lanitz Colomban Wendling" />
|
||||
<meta name="date" content="2011-10-02" />
|
||||
<meta name="authors" content="Enrico Tröger Nick Treleaven Frank Lanitz Colomban Wendling Matthew Brush" />
|
||||
<meta name="date" content="2012-06-18" />
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
@ -138,14 +138,15 @@ Stylesheet for Geany's documentation based on a version of John Gabriele.
|
||||
<td>Enrico Tröger
|
||||
<br />Nick Treleaven
|
||||
<br />Frank Lanitz
|
||||
<br />Colomban Wendling</td></tr>
|
||||
<br />Colomban Wendling
|
||||
<br />Matthew Brush</td></tr>
|
||||
<tr><th class="docinfo-name">Date:</th>
|
||||
<td>2011-10-02</td></tr>
|
||||
<td>2012-06-18</td></tr>
|
||||
<tr><th class="docinfo-name">Version:</th>
|
||||
<td>1.22</td></tr>
|
||||
<td>1.23</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Copyright © 2005-2011</p>
|
||||
<p>Copyright © 2005-2012</p>
|
||||
<p>This document is distributed under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version. A copy of this
|
||||
@ -2352,6 +2353,8 @@ The choice System default uses whatever icon size is set by GTK.</dd>
|
||||
<dl class="docutils">
|
||||
<dt>Line wrapping</dt>
|
||||
<dd>Show long lines wrapped around to new display lines.</dd>
|
||||
</dl>
|
||||
<dl class="docutils" id="smart-home-key">
|
||||
<dt>"Smart" home key</dt>
|
||||
<dd>Whether to move the cursor to the first non-whitespace character
|
||||
on the line when you hit the home key on your keyboard. Pressing it
|
||||
@ -4195,29 +4198,34 @@ selection. See <a class="reference internal" href="#go-to-tag-declaration">Go to
|
||||
</tr>
|
||||
<tr><td>Go to Start of Line</td>
|
||||
<td>Home</td>
|
||||
<td>Move the caret to the end of the line indentation
|
||||
unless it is already there, in which case it moves
|
||||
it to the start of the line.</td>
|
||||
<td>Move the caret to the start of the line.
|
||||
Behaves differently if <a class="reference internal" href="#smart-home-key">smart_home_key</a> is set.</td>
|
||||
</tr>
|
||||
<tr><td>Go to End of Line</td>
|
||||
<td>End</td>
|
||||
<td>Move the caret to the end of the line.</td>
|
||||
</tr>
|
||||
<tr><td>Go to Start of Display Line</td>
|
||||
<td>Alt-Home</td>
|
||||
<td>Move the caret to the start of the display line.
|
||||
This is useful when you use line wrapping and
|
||||
want to jump to the start of the wrapped, virtual
|
||||
line, not the real start of the whole line.
|
||||
If the line is not wrapped, it behaves like
|
||||
<cite>Go to Start of Line</cite>.</td>
|
||||
</tr>
|
||||
<tr><td>Go to End of Display Line</td>
|
||||
<td>Alt-End</td>
|
||||
<td>Move the caret to the end of the display line.
|
||||
This is useful when you use line wrapping and
|
||||
want to jump to the end of the wrapped, virtual
|
||||
line, not the real end of the whole line.
|
||||
If the line is not wrapped, it behaves like
|
||||
<cite>Go to End of Line</cite>, see above.</td>
|
||||
<cite>Go to End of Line</cite>.</td>
|
||||
</tr>
|
||||
<tr><td>Go to Previous Word Part</td>
|
||||
<td>Ctrl-/</td>
|
||||
<td>Goto the previous part of the current word.</td>
|
||||
</tr>
|
||||
<tr><td>Go to Next Word Part</td>
|
||||
<td>Ctrl-</td>
|
||||
<td>Ctrl-\</td>
|
||||
<td>Goto the next part of the current word.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -5654,7 +5662,7 @@ bsd, gpl, snippets.</td>
|
||||
</tr>
|
||||
<tr><td>geanyversion</td>
|
||||
<td>The actual Geany version, e.g.
|
||||
"Geany 1.22".</td>
|
||||
"Geany 1.23".</td>
|
||||
<td>file templates, file header,
|
||||
function description, ChangeLog entry,
|
||||
bsd, gpl, snippets.</td>
|
||||
@ -5986,7 +5994,7 @@ editing the file, to build the HTML document to see how your changes
|
||||
look, run "<tt class="docutils literal">make doc</tt>" in the subdirectory <tt class="docutils literal">doc</tt> of Geany's source
|
||||
directory. This regenerates the <tt class="docutils literal">geany.html</tt> file. To generate a PDF
|
||||
file, use the command "<tt class="docutils literal">make pdf</tt>" which should generate a file called
|
||||
geany-1.22.pdf.</p>
|
||||
geany-1.23.pdf.</p>
|
||||
<p>After you are happy with your changes, create a patch e.g. by using:</p>
|
||||
<pre class="literal-block">
|
||||
% git diff geany.txt > foo.patch
|
||||
@ -6787,7 +6795,7 @@ USE OR PERFORMANCE OF THIS SOFTWARE.</p>
|
||||
<div class="footer">
|
||||
<hr class="footer" />
|
||||
<a class="reference external" href="geany.txt">View document source</a>.
|
||||
Generated on: 2012-06-04 21:07 UTC.
|
||||
Generated on: 2012-06-25 13:30 UTC.
|
||||
Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
|
||||
|
||||
</div>
|
||||
|
@ -1,4 +1,4 @@
|
||||
.. |(version)| replace:: 1.22
|
||||
.. |(version)| replace:: 1.23
|
||||
|
||||
=======
|
||||
Geany
|
||||
@ -11,11 +11,12 @@
|
||||
:Authors: Enrico Tröger,
|
||||
Nick Treleaven,
|
||||
Frank Lanitz,
|
||||
Colomban Wendling
|
||||
:Date: 2011-10-02
|
||||
Colomban Wendling,
|
||||
Matthew Brush
|
||||
:Date: 2012-06-18
|
||||
:Version: |(version)|
|
||||
|
||||
Copyright © 2005-2011
|
||||
Copyright © 2005-2012
|
||||
|
||||
This document is distributed under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either version 2
|
||||
@ -1976,6 +1977,8 @@ Features
|
||||
Line wrapping
|
||||
Show long lines wrapped around to new display lines.
|
||||
|
||||
.. _smart_home_key:
|
||||
|
||||
"Smart" home key
|
||||
Whether to move the cursor to the first non-whitespace character
|
||||
on the line when you hit the home key on your keyboard. Pressing it
|
||||
@ -3485,22 +3488,25 @@ Go to tag definition Ctrl-T Jump to the definition
|
||||
Go to tag declaration Ctrl-Shift-T Jump to the declaration of the current word or
|
||||
selection. See `Go to tag declaration`_.
|
||||
|
||||
Go to Start of Line Home Move the caret to the end of the line indentation
|
||||
unless it is already there, in which case it moves
|
||||
it to the start of the line.
|
||||
Go to Start of Line Home Move the caret to the start of the line.
|
||||
Behaves differently if smart_home_key_ is set.
|
||||
|
||||
Go to End of Line End Move the caret to the end of the line.
|
||||
|
||||
Go to End of Display Line Alt-End Move the caret to the end of the display line.
|
||||
Go to Start of Display Line Alt-Home Move the caret to the start of the display line.
|
||||
This is useful when you use line wrapping and
|
||||
want to jump to the end of the wrapped, virtual
|
||||
line, not the real end of the whole line.
|
||||
want to jump to the start of the wrapped, virtual
|
||||
line, not the real start of the whole line.
|
||||
If the line is not wrapped, it behaves like
|
||||
`Go to End of Line`, see above.
|
||||
`Go to Start of Line`.
|
||||
|
||||
Go to End of Display Line Alt-End Move the caret to the end of the display line.
|
||||
If the line is not wrapped, it behaves like
|
||||
`Go to End of Line`.
|
||||
|
||||
Go to Previous Word Part Ctrl-/ Goto the previous part of the current word.
|
||||
|
||||
Go to Next Word Part Ctrl-\ Goto the next part of the current word.
|
||||
Go to Next Word Part Ctrl-\\ Goto the next part of the current word.
|
||||
=============================== ========================= ==================================================
|
||||
|
||||
View keybindings
|
||||
|
@ -4,44 +4,45 @@ For major releases:
|
||||
* Try to synchronize release date with geany-plugins.
|
||||
|
||||
Update NEWS file - ideally each committer should review their changes
|
||||
and summarise the interesting ones. Use scripts/changelist.pl to
|
||||
format & filter commits by a particular developer name.
|
||||
and summarize the interesting ones. Use `git log --author='name'`
|
||||
to filter commits by a particular developer name.
|
||||
|
||||
Ensure version numbers are all updated in:
|
||||
configure.ac geany.nsi geany_private.rc win32-config.h wscript
|
||||
doc/geany.txt
|
||||
Ensure release date is updated in:
|
||||
doc/geany.txt doc/geany.1.in
|
||||
NEWS doc/geany.txt doc/geany.1.in
|
||||
Regenerate doc/geany.html.
|
||||
Check GEANY_CODENAME is set in src/geany.h.
|
||||
Update NEWS release date.
|
||||
Add changelog entry for new release.
|
||||
|
||||
Export the code into a new directory (i.e. not usual working copy).
|
||||
Run 'make distcheck'.
|
||||
Delete the created archive and run 'make dist' and 'make dist-bzip2'.
|
||||
Sign the archives with 'make sign'.
|
||||
|
||||
Put the resulting tarballs on uvena.de - upload to home directory
|
||||
and after the upload is finished move them into
|
||||
/home/www/files.uvena.de/geany/.
|
||||
Put the resulting tarballs and signature files on geany.org - upload
|
||||
to home directory and after the upload is finished move them into
|
||||
/srv/www/download.geany.org/.
|
||||
Rename LATEST-IS-... to the new version number in
|
||||
/home/www/files.uvena.de/geany/ and /home/www/www.geany.org/files.
|
||||
Add the GPG signatures - use 'make sign' and check the public key
|
||||
/srv/www/download.geany.org/ and /srv/www/www.geany.org/files.
|
||||
Make sure the public part of the GPG key used to sign the archives
|
||||
can be found on the download page.
|
||||
|
||||
Windows builds (enrico?).
|
||||
|
||||
Tag release in SVN, remove the branch if used.
|
||||
Create a signed tag for the release in Git with 'git tag -s <version>'.
|
||||
|
||||
Website: update Releases, Documentation links and add a News item.
|
||||
Update the manual data and links in the filesystem in
|
||||
/home/www/www.geany.org/manual. Remember to update current/hacking.html
|
||||
/srv/www/www.geany.org/manual. Remember to update current/hacking.html
|
||||
too.
|
||||
|
||||
Announce on geany, devel, i18n mailing lists (check you're subscribed).
|
||||
Put a news item on Sourceforge, add a new release on Freshmeat.net
|
||||
and update the information on gnomefiles.org.
|
||||
Put a news item on SourceForge (https://sourceforge.net/news/?group_id=153444)
|
||||
and a new release on freecode.com (https://freecode.com/projects/geany).
|
||||
|
||||
For non-trunk releases, merge NEWS into trunk and any branch-only
|
||||
For non-master releases, merge NEWS into master and any branch-only
|
||||
commits that need to merged.
|
||||
|
||||
For trunk releases, bump version strings and merge unstable branch.
|
||||
For merge releases, bump version strings and codename and merge unstable
|
||||
branch if any.
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright 2008-2011 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
* Copyright 2008-2011 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
* Copyright 2009-2011 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||
* Copyright 2009-2012 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* pluginsignals.c - this file is part of Geany, a fast and lightweight IDE
|
||||
*
|
||||
* Copyright 2008-2011 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
* Copyright 2008-2011 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
* Copyright 2008-2012 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
* Copyright 2008-2012 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* pluginsymbols.c - this file is part of Geany, a fast and lightweight IDE
|
||||
*
|
||||
* Copyright 2008-2011 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
* Copyright 2008-2011 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
* Copyright 2008-2012 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
* Copyright 2008-2012 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
14
geany.nsi
14
geany.nsi
@ -1,8 +1,8 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; geany.nsi - this file is part of Geany, a fast and lightweight IDE
|
||||
;
|
||||
; Copyright 2007-2011 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
; Copyright 2007-2011 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
; Copyright 2007-2012 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
; Copyright 2007-2012 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
;
|
||||
; This program is free software; you can redistribute it and/or modify
|
||||
; it under the terms of the GNU General Public License as published by
|
||||
@ -32,8 +32,8 @@ RequestExecutionLevel highest ; set execution level for Windows Vista
|
||||
; helper defines ;
|
||||
;;;;;;;;;;;;;;;;;;;
|
||||
!define PRODUCT_NAME "Geany"
|
||||
!define PRODUCT_VERSION "1.22"
|
||||
!define PRODUCT_VERSION_ID "1.22.0.0"
|
||||
!define PRODUCT_VERSION "1.23"
|
||||
!define PRODUCT_VERSION_ID "1.23.0.0"
|
||||
!define PRODUCT_PUBLISHER "The Geany developer team"
|
||||
!define PRODUCT_WEB_SITE "http://www.geany.org/"
|
||||
!define PRODUCT_DIR_REGKEY "Software\Geany"
|
||||
@ -50,7 +50,7 @@ VIProductVersion "${PRODUCT_VERSION_ID}"
|
||||
VIAddVersionKey "ProductName" "${PRODUCT_NAME}"
|
||||
VIAddVersionKey "FileVersion" "${PRODUCT_VERSION}"
|
||||
VIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}"
|
||||
VIAddVersionKey "LegalCopyright" "Copyright 2005-2011 by the Geany developer team"
|
||||
VIAddVersionKey "LegalCopyright" "Copyright 2005-2012 by the Geany developer team"
|
||||
VIAddVersionKey "FileDescription" "${PRODUCT_NAME} Installer"
|
||||
|
||||
BrandingText "$(^NAME) installer (NSIS 2.46)"
|
||||
@ -128,12 +128,16 @@ Section "!Program Files" SEC01
|
||||
SetOutPath "$INSTDIR\data"
|
||||
File "${RESOURCEDIR}\data\GPL-2"
|
||||
File "${RESOURCEDIR}\data\file*"
|
||||
File "${RESOURCEDIR}\data\geany.glade"
|
||||
File "${RESOURCEDIR}\data\snippets.conf"
|
||||
File "${RESOURCEDIR}\data\ui_toolbar.xml"
|
||||
|
||||
SetOutPath "$INSTDIR\data\templates"
|
||||
File /r "${RESOURCEDIR}\data\templates\*"
|
||||
|
||||
SetOutPath "$INSTDIR\data\colorschemes"
|
||||
File /r "${RESOURCEDIR}\data\colorschemes\*"
|
||||
|
||||
SetOutPath "$INSTDIR\share\icons"
|
||||
File /r "${RESOURCEDIR}\share\icons\*"
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
|
||||
#include <windows.h> // include for version info constants
|
||||
|
||||
#define VER_FILEVERSION 1,22,0,0
|
||||
#define VER_FILEVERSION_STR "1.22"
|
||||
#define VER_FILEVERSION 1,23,0,0
|
||||
#define VER_FILEVERSION_STR "1.23"
|
||||
|
||||
A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "../icons/geany.ico"
|
||||
|
||||
@ -21,7 +21,7 @@ FILETYPE VFT_APP
|
||||
VALUE "FileVersion", VER_FILEVERSION_STR
|
||||
VALUE "FileDescription", "Geany"
|
||||
VALUE "InternalName", "Geany"
|
||||
VALUE "LegalCopyright", "Copyright 2005-2011 by the Geany developers"
|
||||
VALUE "LegalCopyright", "Copyright 2005-2012 by the Geany developers"
|
||||
VALUE "LegalTrademarks", ""
|
||||
VALUE "OriginalFilename", "Geany.exe"
|
||||
VALUE "ProductName", "Geany"
|
||||
|
@ -13,10 +13,7 @@ AC_DEFUN([GEANY_I18N],
|
||||
if test -n "${LINGUAS}"; then
|
||||
ALL_LINGUAS="${LINGUAS}"
|
||||
else
|
||||
if test -z "$conf_dir"; then
|
||||
conf_dir="."
|
||||
fi
|
||||
ALL_LINGUAS=`cd "$conf_dir/po" 2>/dev/null && ls *.po 2>/dev/null | $AWK 'BEGIN { FS="."; ORS=" " } { print $[]1 }'`
|
||||
ALL_LINGUAS=`cd "$srcdir/po" 2>/dev/null && ls *.po 2>/dev/null | $AWK 'BEGIN { FS="."; ORS=" " } { print $[]1 }'`
|
||||
fi
|
||||
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
|
@ -1,33 +1,37 @@
|
||||
# See http://www.geany.org/Support/BuildingOnWin32
|
||||
# Running make creates config.h then calls the sub makefiles.
|
||||
#
|
||||
# Other targets are:
|
||||
# deps: delete the dependencies so they are regenerated on next make
|
||||
# clean: clean all generated files
|
||||
# install: install to DESTDIR
|
||||
#
|
||||
# localwin32.mk is an optional file to override make variables.
|
||||
# Use localwin32.mk instead of editing variables as it is included in sub
|
||||
# makefiles.
|
||||
# localwin32.mk to set PREFIX instead of the default C:\libs
|
||||
# For MSYS use localwin32.mk to set CP and RM.
|
||||
# By default this will work in a Windows command prompt.
|
||||
# E.g. use localwin32.mk to set PREFIX=C:/libs instead of the default C:\libs
|
||||
# For MSYS use localwin32.mk to set CP, CP_R, RM, DIRSEP.
|
||||
# By default this should work in a Windows command prompt (cmd.exe).
|
||||
|
||||
WINDRES = windres.exe
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
CP = copy
|
||||
CP = copy /Y
|
||||
CP_R = xcopy /S /Y
|
||||
RM = del
|
||||
MAKE = make
|
||||
MKDIR = mkdir
|
||||
# strip is used to prevent line wrap
|
||||
DIRSEP := $(strip \)
|
||||
DESTDIR = C:/Program Files/Geany
|
||||
-include localwin32.mk
|
||||
|
||||
# Note: && is needed after cd because each line is executed in a different
|
||||
# shell. (cd .. is just for clarity).
|
||||
all: config.h
|
||||
cd tagmanager/ctags && $(MAKE) -f makefile.win32 && cd ../..
|
||||
cd tagmanager/mio && $(MAKE) -f makefile.win32 && cd ../..
|
||||
cd tagmanager/src && $(MAKE) -f makefile.win32 && cd ../..
|
||||
cd scintilla && $(MAKE) -f makefile.win32 && cd ..
|
||||
cd plugins && $(MAKE) -f makefile.win32 && cd ..
|
||||
cd src && $(MAKE) -f makefile.win32 && cd ..
|
||||
$(MAKE) -C tagmanager/ctags -f makefile.win32
|
||||
$(MAKE) -C tagmanager/mio -f makefile.win32
|
||||
$(MAKE) -C tagmanager/src -f makefile.win32
|
||||
$(MAKE) -C scintilla -f makefile.win32
|
||||
$(MAKE) -C plugins -f makefile.win32
|
||||
$(MAKE) -C src -f makefile.win32
|
||||
|
||||
config.h: win32-config.h
|
||||
$(CP) $< $@
|
||||
@ -40,18 +44,23 @@ clean-local:
|
||||
-$(RM) geany_private.res geany.exe
|
||||
|
||||
clean: deps
|
||||
cd tagmanager/ctags && $(MAKE) -f makefile.win32 clean && cd ../..
|
||||
cd tagmanager/mio && $(MAKE) -f makefile.win32 clean && cd ../..
|
||||
cd tagmanager/src && $(MAKE) -f makefile.win32 clean && cd ../..
|
||||
cd scintilla && $(MAKE) -f makefile.win32 clean && cd ..
|
||||
cd plugins && $(MAKE) -f makefile.win32 clean && cd ..
|
||||
cd src && $(MAKE) -f makefile.win32 clean && cd ..
|
||||
$(MAKE) -C tagmanager/ctags -f makefile.win32 clean
|
||||
$(MAKE) -C tagmanager/mio -f makefile.win32 clean
|
||||
$(MAKE) -C tagmanager/src -f makefile.win32 clean
|
||||
$(MAKE) -C scintilla -f makefile.win32 clean
|
||||
$(MAKE) -C plugins -f makefile.win32 clean
|
||||
$(MAKE) -C src -f makefile.win32 clean
|
||||
|
||||
.PHONY: install
|
||||
DESTDIR='C:/Program Files/Geany'
|
||||
|
||||
# requires admin privileges and MSYS
|
||||
# likely requires admin privileges
|
||||
# mkdir output is ignored in case dir exists
|
||||
# 'copy' seems to only accept / in the destination
|
||||
install:
|
||||
cp -r data $(DESTDIR)
|
||||
cp plugins/*.dll $(DESTDIR)/lib
|
||||
cp geany.exe $(DESTDIR)/bin
|
||||
-$(MKDIR) "$(DESTDIR)"
|
||||
-$(MKDIR) "$(DESTDIR)/bin"
|
||||
$(CP) geany.exe "$(DESTDIR)/bin"
|
||||
-$(MKDIR) "$(DESTDIR)/lib"
|
||||
$(CP) plugins$(DIRSEP)*.dll "$(DESTDIR)/lib"
|
||||
-$(MKDIR) "$(DESTDIR)/data"
|
||||
$(CP_R) data "$(DESTDIR)/data"
|
||||
|
@ -94,7 +94,7 @@ splitwindow_la_CFLAGS = -DG_LOG_DOMAIN=\""SplitWindow"\"
|
||||
demoplugin_la_LIBADD = $(GTK_LIBS)
|
||||
classbuilder_la_LIBADD = $(GTK_LIBS)
|
||||
htmlchars_la_LIBADD = $(GTK_LIBS)
|
||||
export_la_LIBADD = $(GTK_LIBS)
|
||||
export_la_LIBADD = $(GTK_LIBS) -lm
|
||||
saveactions_la_LIBADD = $(GTK_LIBS)
|
||||
filebrowser_la_LIBADD = $(GTK_LIBS)
|
||||
splitwindow_la_LIBADD = $(GTK_LIBS)
|
||||
|
@ -2,8 +2,8 @@
|
||||
* classbuilder.c - this file is part of Geany, a fast and lightweight IDE
|
||||
*
|
||||
* Copyright 2007 Alexander Rodin <rodin(dot)alexander(at)gmail(dot)com>
|
||||
* Copyright 2007-2011 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
* Copyright 2007-2011 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
* Copyright 2007-2012 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
* Copyright 2007-2012 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* demoplugin.c - this file is part of Geany, a fast and lightweight IDE
|
||||
*
|
||||
* Copyright 2007-2011 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
* Copyright 2007-2011 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
* Copyright 2007-2012 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
* Copyright 2007-2012 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* export.c - this file is part of Geany, a fast and lightweight IDE
|
||||
*
|
||||
* Copyright 2007-2011 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
* Copyright 2007-2011 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
* Copyright 2007-2012 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
* Copyright 2007-2012 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* filebrowser.c - this file is part of Geany, a fast and lightweight IDE
|
||||
*
|
||||
* Copyright 2007-2011 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
* Copyright 2007-2011 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
* Copyright 2007-2012 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
* Copyright 2007-2012 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* geanyplugin.h - this file is part of Geany, a fast and lightweight IDE
|
||||
*
|
||||
* Copyright 2009-2011 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
* Copyright 2009-2011 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
* Copyright 2009-2012 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
* Copyright 2009-2012 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -1,9 +1,9 @@
|
||||
/*
|
||||
* htmlchars.c - this file is part of Geany, a fast and lightweight IDE
|
||||
*
|
||||
* Copyright 2009-2011 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||
* Copyright 2006-2011 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
* Copyright 2007-2011 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
* Copyright 2009-2012 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||
* Copyright 2006-2012 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
* Copyright 2007-2012 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* saveactions.c - this file is part of Geany, a fast and lightweight IDE
|
||||
*
|
||||
* Copyright 2007-2011 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
* Copyright 2007-2011 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
* Copyright 2007-2012 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
* Copyright 2007-2012 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* splitwindow.c - this file is part of Geany, a fast and lightweight IDE
|
||||
*
|
||||
* Copyright 2008-2011 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
* Copyright 2008-2011 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
* Copyright 2008-2012 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
* Copyright 2008-2012 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
21
po/es.po
21
po/es.po
@ -8,8 +8,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Geany 1.22\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2012-06-04 17:26+0200\n"
|
||||
"PO-Revision-Date: 2012-06-04 09:21+0100\n"
|
||||
"POT-Creation-Date: 2012-06-13 18:44+0200\n"
|
||||
"PO-Revision-Date: 2012-06-12 12:24+0100\n"
|
||||
"Last-Translator: Lucas Vieites <lucas.vieites@gmail.com>\n"
|
||||
"Language-Team: Español <geany-i18n@uvena.de>\n"
|
||||
"Language: es\n"
|
||||
@ -187,11 +187,10 @@ msgstr "Ruta de inicio:"
|
||||
|
||||
#: ../data/geany.glade.h:38
|
||||
msgid ""
|
||||
"Path to start in when opening or saving files. Must be an absolute path. "
|
||||
"Leave blank to use the current working directory."
|
||||
"Path to start in when opening or saving files. Must be an absolute path."
|
||||
msgstr ""
|
||||
"Ruta en la que iniciar cuando se abren o guardan archivos. Debe ser una ruta "
|
||||
"absoluta. Dejar en blanco para usar el directorio de trabajo actual."
|
||||
"absoluta."
|
||||
|
||||
#: ../data/geany.glade.h:39
|
||||
msgid "Project files:"
|
||||
@ -3249,7 +3248,7 @@ msgid "Document"
|
||||
msgstr "Documento"
|
||||
|
||||
#: ../src/keybindings.c:238 ../src/keybindings.c:585 ../src/project.c:444
|
||||
#: ../src/ui_utils.c:1980
|
||||
#: ../src/ui_utils.c:1981
|
||||
msgid "Build"
|
||||
msgstr "Construir"
|
||||
|
||||
@ -5138,23 +5137,23 @@ msgstr "C++ STL"
|
||||
msgid "_Set Custom Date Format"
|
||||
msgstr "_Establecer formato de fecha personalizado"
|
||||
|
||||
#: ../src/ui_utils.c:1819
|
||||
#: ../src/ui_utils.c:1820
|
||||
msgid "Select Folder"
|
||||
msgstr "Seleccionar carpeta"
|
||||
|
||||
#: ../src/ui_utils.c:1819
|
||||
#: ../src/ui_utils.c:1820
|
||||
msgid "Select File"
|
||||
msgstr "Seleccionar archivo"
|
||||
|
||||
#: ../src/ui_utils.c:1978
|
||||
#: ../src/ui_utils.c:1979
|
||||
msgid "Save All"
|
||||
msgstr "Guardar _todo"
|
||||
|
||||
#: ../src/ui_utils.c:1979
|
||||
#: ../src/ui_utils.c:1980
|
||||
msgid "Close All"
|
||||
msgstr "C_errar todo"
|
||||
|
||||
#: ../src/ui_utils.c:2225
|
||||
#: ../src/ui_utils.c:2226
|
||||
msgid "Geany cannot start!"
|
||||
msgstr "Geany no puede iniciarse."
|
||||
|
||||
|
9
po/it.po
9
po/it.po
@ -10,8 +10,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Geany 1.22\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2012-06-06 21:50+0200\n"
|
||||
"PO-Revision-Date: 2012-06-04 23:18+0100\n"
|
||||
"POT-Creation-Date: 2012-06-09 08:57+0200\n"
|
||||
"PO-Revision-Date: 2012-06-07 18:58+0100\n"
|
||||
"Last-Translator: Giuseppe Penone <giuspen@gmail.com>\n"
|
||||
"Language-Team: <geany-i18n@uvena.de>\n"
|
||||
"Language: it\n"
|
||||
@ -188,12 +188,11 @@ msgid "Startup path:"
|
||||
msgstr "Percorso di avvio:"
|
||||
|
||||
#: ../data/geany.glade.h:38
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"Path to start in when opening or saving files. Must be an absolute path."
|
||||
msgstr ""
|
||||
"Percorso iniziale per l'apertura o il salvataggio dei file. Dev'essere un "
|
||||
"percorso assoluto. Lasciare vuoto per usare la cartella di lavoro corrente."
|
||||
"Percorso iniziale per l'apertura o il salvataggio dei file. Deve essere un "
|
||||
"percorso assoluto."
|
||||
|
||||
#: ../data/geany.glade.h:39
|
||||
msgid "Project files:"
|
||||
|
443
po/pt_BR.po
443
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
3935
po/zh_CN.po
3935
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -64,6 +64,11 @@
|
||||
|
||||
#include "Converter.h"
|
||||
|
||||
#if defined(__clang__)
|
||||
// Clang 3.0 incorrectly displays sentinel warnings. Fixed by clang 3.1.
|
||||
#pragma GCC diagnostic ignored "-Wsentinel"
|
||||
#endif
|
||||
|
||||
#if GTK_CHECK_VERSION(2,20,0)
|
||||
#define IS_WIDGET_REALIZED(w) (gtk_widget_get_realized(GTK_WIDGET(w)))
|
||||
#define IS_WIDGET_MAPPED(w) (gtk_widget_get_mapped(GTK_WIDGET(w)))
|
||||
@ -74,8 +79,6 @@
|
||||
#define IS_WIDGET_VISIBLE(w) (GTK_WIDGET_VISIBLE(w))
|
||||
#endif
|
||||
|
||||
#define USE_CAIRO 1
|
||||
|
||||
static GdkWindow *WindowFromWidget(GtkWidget *w) {
|
||||
#if GTK_CHECK_VERSION(3,0,0)
|
||||
return gtk_widget_get_window(w);
|
||||
@ -100,10 +103,6 @@ static GdkWindow *PWindow(const Window &w) {
|
||||
#pragma warning(disable: 4505)
|
||||
#endif
|
||||
|
||||
#if GTK_CHECK_VERSION(2,6,0)
|
||||
#define USE_GTK_CLIPBOARD
|
||||
#endif
|
||||
|
||||
#define OBJECT_CLASS GObjectClass
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
@ -122,11 +121,6 @@ class ScintillaGTK : public ScintillaBase {
|
||||
int scrollBarWidth;
|
||||
int scrollBarHeight;
|
||||
|
||||
// Because clipboard access is asynchronous, copyText is created by Copy
|
||||
#ifndef USE_GTK_CLIPBOARD
|
||||
SelectionText copyText;
|
||||
#endif
|
||||
|
||||
SelectionText primary;
|
||||
|
||||
GdkEventButton evbtn;
|
||||
@ -218,11 +212,9 @@ private:
|
||||
void ReceivedSelection(GtkSelectionData *selection_data);
|
||||
void ReceivedDrop(GtkSelectionData *selection_data);
|
||||
static void GetSelection(GtkSelectionData *selection_data, guint info, SelectionText *selected);
|
||||
#ifdef USE_GTK_CLIPBOARD
|
||||
void StoreOnClipboard(SelectionText *clipText);
|
||||
static void ClipboardGetSelection(GtkClipboard* clip, GtkSelectionData *selection_data, guint info, void *data);
|
||||
static void ClipboardClearSelection(GtkClipboard* clip, void *data);
|
||||
#endif
|
||||
|
||||
void UnclaimSelection(GdkEventSelection *selection_event);
|
||||
void Resize(int width, int height);
|
||||
@ -505,10 +497,6 @@ void ScintillaGTK::RealizeThis(GtkWidget *widget) {
|
||||
|
||||
gtk_selection_add_targets(widget, GDK_SELECTION_PRIMARY,
|
||||
clipboardCopyTargets, nClipboardCopyTargets);
|
||||
#ifndef USE_GTK_CLIPBOARD
|
||||
gtk_selection_add_targets(widget, atomClipboard,
|
||||
clipboardPasteTargets, nClipboardPasteTargets);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ScintillaGTK::Realize(GtkWidget *widget) {
|
||||
@ -519,9 +507,6 @@ void ScintillaGTK::Realize(GtkWidget *widget) {
|
||||
void ScintillaGTK::UnRealizeThis(GtkWidget *widget) {
|
||||
try {
|
||||
gtk_selection_clear_targets(widget, GDK_SELECTION_PRIMARY);
|
||||
#ifndef USE_GTK_CLIPBOARD
|
||||
gtk_selection_clear_targets(widget, atomClipboard);
|
||||
#endif
|
||||
|
||||
if (IS_WIDGET_MAPPED(widget)) {
|
||||
gtk_widget_unmap(widget);
|
||||
@ -594,7 +579,7 @@ void ScintillaGTK::UnMapThis() {
|
||||
#else
|
||||
GTK_WIDGET_UNSET_FLAGS(PWidget(wMain), GTK_MAPPED);
|
||||
#endif
|
||||
DropGraphics();
|
||||
DropGraphics(false);
|
||||
gdk_window_hide(PWindow(wMain));
|
||||
gtk_widget_unmap(PWidget(wText));
|
||||
gtk_widget_unmap(PWidget(scrollbarh));
|
||||
@ -739,6 +724,7 @@ void ScintillaGTK::Initialise() {
|
||||
#endif
|
||||
gtk_widget_set_events(PWidget(wMain),
|
||||
GDK_EXPOSURE_MASK
|
||||
| GDK_SCROLL_MASK
|
||||
| GDK_STRUCTURE_MASK
|
||||
| GDK_KEY_PRESS_MASK
|
||||
| GDK_KEY_RELEASE_MASK
|
||||
@ -765,7 +751,11 @@ void ScintillaGTK::Initialise() {
|
||||
gtk_widget_set_double_buffered(widtxt, FALSE);
|
||||
gtk_widget_set_size_request(widtxt, 100, 100);
|
||||
adjustmentv = GTK_ADJUSTMENT(gtk_adjustment_new(0.0, 0.0, 201.0, 1.0, 20.0, 20.0));
|
||||
#if GTK_CHECK_VERSION(3,0,0)
|
||||
scrollbarv = gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, GTK_ADJUSTMENT(adjustmentv));
|
||||
#else
|
||||
scrollbarv = gtk_vscrollbar_new(GTK_ADJUSTMENT(adjustmentv));
|
||||
#endif
|
||||
#if GTK_CHECK_VERSION(2,20,0)
|
||||
gtk_widget_set_can_focus(PWidget(scrollbarv), FALSE);
|
||||
#else
|
||||
@ -777,7 +767,11 @@ void ScintillaGTK::Initialise() {
|
||||
gtk_widget_show(PWidget(scrollbarv));
|
||||
|
||||
adjustmenth = GTK_ADJUSTMENT(gtk_adjustment_new(0.0, 0.0, 101.0, 1.0, 20.0, 20.0));
|
||||
#if GTK_CHECK_VERSION(3,0,0)
|
||||
scrollbarh = gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_ADJUSTMENT(adjustmenth));
|
||||
#else
|
||||
scrollbarh = gtk_hscrollbar_new(GTK_ADJUSTMENT(adjustmenth));
|
||||
#endif
|
||||
#if GTK_CHECK_VERSION(2,20,0)
|
||||
gtk_widget_set_can_focus(PWidget(scrollbarh), FALSE);
|
||||
#else
|
||||
@ -1085,8 +1079,8 @@ bool ScintillaGTK::PaintContains(PRectangle rc) {
|
||||
rc.right - rc.left, rc.bottom - rc.top};
|
||||
contains = CRectListContains(rgnUpdate, grc);
|
||||
#else
|
||||
GdkRectangle grc = {rc.left, rc.top,
|
||||
rc.right - rc.left, rc.bottom - rc.top};
|
||||
GdkRectangle grc = {static_cast<gint>(rc.left), static_cast<gint>(rc.top),
|
||||
static_cast<gint>(rc.right - rc.left), static_cast<gint>(rc.bottom - rc.top)};
|
||||
if (gdk_region_rect_in(rgnUpdate, &grc) != GDK_OVERLAP_RECTANGLE_IN) {
|
||||
contains = false;
|
||||
}
|
||||
@ -1122,20 +1116,14 @@ void ScintillaGTK::SyncPaint(PRectangle rc) {
|
||||
PRectangle rcClient = GetClientRectangle();
|
||||
paintingAllText = rcPaint.Contains(rcClient);
|
||||
if (PWindow(wText)) {
|
||||
Surface *sw = Surface::Allocate();
|
||||
Surface *sw = Surface::Allocate(SC_TECHNOLOGY_DEFAULT);
|
||||
if (sw) {
|
||||
#if GTK_CHECK_VERSION(3,0,0)
|
||||
cairo_t *cr = gdk_cairo_create(PWindow(wText));
|
||||
sw->Init(cr, PWidget(wText));
|
||||
#else
|
||||
sw->Init(PWindow(wText), PWidget(wText));
|
||||
#endif
|
||||
Paint(sw, rc);
|
||||
sw->Release();
|
||||
delete sw;
|
||||
#if GTK_CHECK_VERSION(3,0,0)
|
||||
cairo_destroy(cr);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if (paintState == paintAbandoned) {
|
||||
@ -1151,8 +1139,10 @@ void ScintillaGTK::ScrollText(int linesToMove) {
|
||||
// rc.left, rc.top, rc.right, rc.bottom);
|
||||
GtkWidget *wi = PWidget(wText);
|
||||
|
||||
gdk_window_scroll(WindowFromWidget(wi), 0, -diff);
|
||||
gdk_window_process_updates(WindowFromWidget(wi), FALSE);
|
||||
if (IS_WIDGET_REALIZED(wi)) {
|
||||
gdk_window_scroll(WindowFromWidget(wi), 0, -diff);
|
||||
gdk_window_process_updates(WindowFromWidget(wi), FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void ScintillaGTK::SetVerticalScrollPos() {
|
||||
@ -1416,48 +1406,22 @@ std::string ScintillaGTK::CaseMapString(const std::string &s, int caseMapping) {
|
||||
}
|
||||
|
||||
int ScintillaGTK::KeyDefault(int key, int modifiers) {
|
||||
if (!(modifiers & SCI_CTRL) && !(modifiers & SCI_ALT)) {
|
||||
if (key < 256) {
|
||||
NotifyKey(key, modifiers);
|
||||
return 0;
|
||||
} else {
|
||||
// Pass up to container in case it is an accelerator
|
||||
NotifyKey(key, modifiers);
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
// Pass up to container in case it is an accelerator
|
||||
NotifyKey(key, modifiers);
|
||||
return 0;
|
||||
}
|
||||
//Platform::DebugPrintf("SK-key: %d %x %x\n",key, modifiers);
|
||||
// Pass up to container in case it is an accelerator
|
||||
NotifyKey(key, modifiers);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ScintillaGTK::CopyToClipboard(const SelectionText &selectedText) {
|
||||
#ifndef USE_GTK_CLIPBOARD
|
||||
copyText.Copy(selectedText);
|
||||
gtk_selection_owner_set(GTK_WIDGET(PWidget(wMain)),
|
||||
atomClipboard,
|
||||
GDK_CURRENT_TIME);
|
||||
#else
|
||||
SelectionText *clipText = new SelectionText();
|
||||
clipText->Copy(selectedText);
|
||||
StoreOnClipboard(clipText);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ScintillaGTK::Copy() {
|
||||
if (!sel.Empty()) {
|
||||
#ifndef USE_GTK_CLIPBOARD
|
||||
CopySelectionRange(©Text);
|
||||
gtk_selection_owner_set(GTK_WIDGET(PWidget(wMain)),
|
||||
atomClipboard,
|
||||
GDK_CURRENT_TIME);
|
||||
#else
|
||||
SelectionText *clipText = new SelectionText();
|
||||
CopySelectionRange(clipText);
|
||||
StoreOnClipboard(clipText);
|
||||
#endif
|
||||
#if PLAT_GTK_WIN32
|
||||
if (sel.IsRectangular()) {
|
||||
::OpenClipboard(NULL);
|
||||
@ -1717,7 +1681,6 @@ void ScintillaGTK::GetSelection(GtkSelectionData *selection_data, guint info, Se
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef USE_GTK_CLIPBOARD
|
||||
void ScintillaGTK::StoreOnClipboard(SelectionText *clipText) {
|
||||
GtkClipboard *clipBoard =
|
||||
gtk_widget_get_clipboard(GTK_WIDGET(PWidget(wMain)), atomClipboard);
|
||||
@ -1738,7 +1701,6 @@ void ScintillaGTK::ClipboardClearSelection(GtkClipboard *, void *data) {
|
||||
SelectionText *obj = static_cast<SelectionText*>(data);
|
||||
delete obj;
|
||||
}
|
||||
#endif
|
||||
|
||||
void ScintillaGTK::UnclaimSelection(GdkEventSelection *selection_event) {
|
||||
try {
|
||||
@ -2010,6 +1972,13 @@ gint ScintillaGTK::ScrollEvent(GtkWidget *widget,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#if GTK_CHECK_VERSION(3,4,0)
|
||||
// Smooth scrolling not supported
|
||||
if (event->direction == GDK_SCROLL_SMOOTH) {
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Horizontal scrolling
|
||||
if (event->direction == GDK_SCROLL_LEFT || event->direction == GDK_SCROLL_RIGHT) {
|
||||
sciThis->HorizontalScrollTo(sciThis->xOffset + cLineScroll);
|
||||
@ -2043,7 +2012,12 @@ gint ScintillaGTK::Motion(GtkWidget *widget, GdkEventMotion *event) {
|
||||
int y = 0;
|
||||
GdkModifierType state;
|
||||
if (event->is_hint) {
|
||||
#if GTK_CHECK_VERSION(3,0,0)
|
||||
gdk_window_get_device_position(event->window,
|
||||
event->device, &x, &y, &state);
|
||||
#else
|
||||
gdk_window_get_pointer(event->window, &x, &y, &state);
|
||||
#endif
|
||||
} else {
|
||||
x = static_cast<int>(event->x);
|
||||
y = static_cast<int>(event->y);
|
||||
@ -2235,8 +2209,7 @@ gboolean ScintillaGTK::KeyThis(GdkEventKey *event) {
|
||||
bool added = KeyDown(key, shift, ctrl, alt, &consumed) != 0;
|
||||
#else
|
||||
bool meta = ctrl;
|
||||
ctrl = alt;
|
||||
alt = (event->state & GDK_MOD5_MASK) != 0;
|
||||
ctrl = (event->state & GDK_META_MASK) != 0;
|
||||
bool added = KeyDownWithModifiers(key, (shift ? SCI_SHIFT : 0) |
|
||||
(ctrl ? SCI_CTRL : 0) |
|
||||
(alt ? SCI_ALT : 0) |
|
||||
@ -2312,28 +2285,10 @@ gboolean ScintillaGTK::ExposePreeditThis(GtkWidget *widget, GdkEventExpose *ose)
|
||||
PangoLayout *layout = gtk_widget_create_pango_layout(PWidget(wText), str);
|
||||
pango_layout_set_attributes(layout, attrs);
|
||||
|
||||
#ifdef USE_CAIRO
|
||||
cairo_t *context = gdk_cairo_create(reinterpret_cast<GdkDrawable *>(WindowFromWidget(widget)));
|
||||
cairo_move_to(context, 0, 0);
|
||||
pango_cairo_show_layout(context, layout);
|
||||
cairo_destroy(context);
|
||||
#else
|
||||
GdkGC *gc = gdk_gc_new(widget->window);
|
||||
GdkColor color[2] = { {0, 0x0000, 0x0000, 0x0000},
|
||||
{0, 0xffff, 0xffff, 0xffff}
|
||||
};
|
||||
gdk_colormap_alloc_color(gdk_colormap_get_system(), color, FALSE, TRUE);
|
||||
gdk_colormap_alloc_color(gdk_colormap_get_system(), color + 1, FALSE, TRUE);
|
||||
|
||||
gdk_gc_set_foreground(gc, color + 1);
|
||||
gdk_draw_rectangle(widget->window, gc, TRUE, ose->area.x, ose->area.y,
|
||||
ose->area.width, ose->area.height);
|
||||
|
||||
gdk_gc_set_foreground(gc, color);
|
||||
gdk_gc_set_background(gc, color + 1);
|
||||
gdk_draw_layout(widget->window, gc, 0, 0, layout);
|
||||
g_object_unref(gc);
|
||||
#endif
|
||||
g_free(str);
|
||||
pango_attr_list_unref(attrs);
|
||||
g_object_unref(layout);
|
||||
@ -2483,7 +2438,7 @@ gboolean ScintillaGTK::DrawTextThis(cairo_t *cr) {
|
||||
rcPaint.bottom = y2;
|
||||
PRectangle rcClient = GetClientRectangle();
|
||||
paintingAllText = rcPaint.Contains(rcClient);
|
||||
Surface *surfaceWindow = Surface::Allocate();
|
||||
Surface *surfaceWindow = Surface::Allocate(SC_TECHNOLOGY_DEFAULT);
|
||||
if (surfaceWindow) {
|
||||
surfaceWindow->Init(cr, PWidget(wText));
|
||||
Paint(surfaceWindow, rcPaint);
|
||||
@ -2544,12 +2499,14 @@ gboolean ScintillaGTK::ExposeTextThis(GtkWidget * /*widget*/, GdkEventExpose *os
|
||||
rgnUpdate = gdk_region_copy(ose->region);
|
||||
PRectangle rcClient = GetClientRectangle();
|
||||
paintingAllText = rcPaint.Contains(rcClient);
|
||||
Surface *surfaceWindow = Surface::Allocate();
|
||||
Surface *surfaceWindow = Surface::Allocate(SC_TECHNOLOGY_DEFAULT);
|
||||
if (surfaceWindow) {
|
||||
surfaceWindow->Init(PWindow(wText), PWidget(wText));
|
||||
cairo_t *cr = gdk_cairo_create(PWindow(wText));
|
||||
surfaceWindow->Init(cr, PWidget(wText));
|
||||
Paint(surfaceWindow, rcPaint);
|
||||
surfaceWindow->Release();
|
||||
delete surfaceWindow;
|
||||
cairo_destroy(cr);
|
||||
}
|
||||
if (paintState == paintAbandoned) {
|
||||
// Painting area was insufficient to cover new styling or brace highlight positions
|
||||
@ -2640,11 +2597,6 @@ void ScintillaGTK::SelectionGet(GtkWidget *widget,
|
||||
}
|
||||
sciThis->GetSelection(selection_data, info, &sciThis->primary);
|
||||
}
|
||||
#ifndef USE_GTK_CLIPBOARD
|
||||
else {
|
||||
sciThis->GetSelection(selection_data, info, &sciThis->copyText);
|
||||
}
|
||||
#endif
|
||||
} catch (...) {
|
||||
sciThis->errorStatus = SC_STATUS_FAILURE;
|
||||
}
|
||||
@ -2841,7 +2793,7 @@ gboolean ScintillaGTK::PressCT(GtkWidget *widget, GdkEventButton *event, Scintil
|
||||
|
||||
gboolean ScintillaGTK::DrawCT(GtkWidget *widget, cairo_t *cr, CallTip *ctip) {
|
||||
try {
|
||||
Surface *surfaceWindow = Surface::Allocate();
|
||||
Surface *surfaceWindow = Surface::Allocate(SC_TECHNOLOGY_DEFAULT);
|
||||
if (surfaceWindow) {
|
||||
surfaceWindow->Init(cr, widget);
|
||||
surfaceWindow->SetUnicodeMode(SC_CP_UTF8 == ctip->codePage);
|
||||
@ -2860,14 +2812,16 @@ gboolean ScintillaGTK::DrawCT(GtkWidget *widget, cairo_t *cr, CallTip *ctip) {
|
||||
|
||||
gboolean ScintillaGTK::ExposeCT(GtkWidget *widget, GdkEventExpose * /*ose*/, CallTip *ctip) {
|
||||
try {
|
||||
Surface *surfaceWindow = Surface::Allocate();
|
||||
Surface *surfaceWindow = Surface::Allocate(SC_TECHNOLOGY_DEFAULT);
|
||||
if (surfaceWindow) {
|
||||
surfaceWindow->Init(WindowFromWidget(widget), widget);
|
||||
cairo_t *cr = gdk_cairo_create(WindowFromWidget(widget));
|
||||
surfaceWindow->Init(cr, widget);
|
||||
surfaceWindow->SetUnicodeMode(SC_CP_UTF8 == ctip->codePage);
|
||||
surfaceWindow->SetDBCSMode(ctip->codePage);
|
||||
ctip->PaintCT(surfaceWindow);
|
||||
surfaceWindow->Release();
|
||||
delete surfaceWindow;
|
||||
cairo_destroy(cr);
|
||||
}
|
||||
} catch (...) {
|
||||
// No pointer back to Scintilla to save status
|
||||
|
@ -62,6 +62,14 @@ public:
|
||||
virtual void * SCI_METHOD PrivateCall(int operation, void *pointer) = 0;
|
||||
};
|
||||
|
||||
class ILoader {
|
||||
public:
|
||||
virtual int SCI_METHOD Release() = 0;
|
||||
// Returns a status code from SC_STATUS_*
|
||||
virtual int SCI_METHOD AddData(char *data, int length) = 0;
|
||||
virtual void * SCI_METHOD ConvertToDocument() = 0;
|
||||
};
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
@ -20,6 +20,7 @@
|
||||
#define PLAT_MACOSX 0
|
||||
#define PLAT_WIN 0
|
||||
#define PLAT_WX 0
|
||||
#define PLAT_QT 0
|
||||
#define PLAT_FOX 0
|
||||
|
||||
#if defined(FOX)
|
||||
@ -34,6 +35,10 @@
|
||||
#undef PLAT_GTK
|
||||
#define PLAT_GTK 1
|
||||
|
||||
#elif defined(SCINTILLA_QT)
|
||||
#undef PLAT_QT
|
||||
#define PLAT_QT 1
|
||||
|
||||
#if defined(__WIN32__) || defined(_MSC_VER)
|
||||
#undef PLAT_GTK_WIN32
|
||||
#define PLAT_GTK_WIN32 1
|
||||
@ -59,6 +64,10 @@
|
||||
namespace Scintilla {
|
||||
#endif
|
||||
|
||||
typedef float XYPOSITION;
|
||||
typedef double XYACCUMULATOR;
|
||||
//#define XYPOSITION int
|
||||
|
||||
// Underlying the implementation of the platform classes are platform specific types.
|
||||
// Sometimes these need to be passed around by client code so they are defined here
|
||||
|
||||
@ -76,10 +85,10 @@ typedef void *IdlerID;
|
||||
*/
|
||||
class Point {
|
||||
public:
|
||||
int x;
|
||||
int y;
|
||||
XYPOSITION x;
|
||||
XYPOSITION y;
|
||||
|
||||
explicit Point(int x_=0, int y_=0) : x(x_), y(y_) {
|
||||
explicit Point(XYPOSITION x_=0, XYPOSITION y_=0) : x(x_), y(y_) {
|
||||
}
|
||||
|
||||
// Other automatically defined methods (assignment, copy constructor, destructor) are fine
|
||||
@ -94,12 +103,12 @@ public:
|
||||
*/
|
||||
class PRectangle {
|
||||
public:
|
||||
int left;
|
||||
int top;
|
||||
int right;
|
||||
int bottom;
|
||||
XYPOSITION left;
|
||||
XYPOSITION top;
|
||||
XYPOSITION right;
|
||||
XYPOSITION bottom;
|
||||
|
||||
PRectangle(int left_=0, int top_=0, int right_=0, int bottom_ = 0) :
|
||||
PRectangle(XYPOSITION left_=0, XYPOSITION top_=0, XYPOSITION right_=0, XYPOSITION bottom_ = 0) :
|
||||
left(left_), top(top_), right(right_), bottom(bottom_) {
|
||||
}
|
||||
|
||||
@ -121,31 +130,19 @@ public:
|
||||
return (right > other.left) && (left < other.right) &&
|
||||
(bottom > other.top) && (top < other.bottom);
|
||||
}
|
||||
void Move(int xDelta, int yDelta) {
|
||||
void Move(XYPOSITION xDelta, XYPOSITION yDelta) {
|
||||
left += xDelta;
|
||||
top += yDelta;
|
||||
right += xDelta;
|
||||
bottom += yDelta;
|
||||
}
|
||||
int Width() { return right - left; }
|
||||
int Height() { return bottom - top; }
|
||||
XYPOSITION Width() { return right - left; }
|
||||
XYPOSITION Height() { return bottom - top; }
|
||||
bool Empty() {
|
||||
return (Height() <= 0) || (Width() <= 0);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* In some circumstances, including Win32 in paletted mode and GTK+, each colour
|
||||
* must be allocated before use. The desired colours are held in the ColourDesired class,
|
||||
* and after allocation the allocation entry is stored in the ColourAllocated class. In other
|
||||
* circumstances, such as Win32 in true colour mode, the allocation process just copies
|
||||
* the RGB values from the desired to the allocated class.
|
||||
* As each desired colour requires allocation before it can be used, the ColourPair class
|
||||
* holds both a ColourDesired and a ColourAllocated
|
||||
* The Palette class is responsible for managing the palette of colours which contains a
|
||||
* list of ColourPair objects and performs the allocation.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Holds a desired RGB colour.
|
||||
*/
|
||||
@ -210,83 +207,40 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Holds an allocated RGB colour which may be an approximation to the desired colour.
|
||||
*/
|
||||
class ColourAllocated {
|
||||
long coAllocated;
|
||||
|
||||
public:
|
||||
|
||||
ColourAllocated(long lcol=0) {
|
||||
coAllocated = lcol;
|
||||
}
|
||||
|
||||
void Set(long lcol) {
|
||||
coAllocated = lcol;
|
||||
}
|
||||
|
||||
long AsLong() const {
|
||||
return coAllocated;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Colour pairs hold a desired colour and an allocated colour.
|
||||
*/
|
||||
struct ColourPair {
|
||||
ColourDesired desired;
|
||||
ColourAllocated allocated;
|
||||
|
||||
ColourPair(ColourDesired desired_=ColourDesired(0,0,0)) {
|
||||
desired = desired_;
|
||||
allocated.Set(desired.AsLong());
|
||||
}
|
||||
void Copy() {
|
||||
allocated.Set(desired.AsLong());
|
||||
}
|
||||
};
|
||||
|
||||
class Window; // Forward declaration for Palette
|
||||
|
||||
/**
|
||||
* Colour palette management.
|
||||
*/
|
||||
class Palette {
|
||||
int used;
|
||||
int size;
|
||||
ColourPair *entries;
|
||||
#if PLAT_GTK
|
||||
void *allocatedPalette; // GdkColor *
|
||||
int allocatedLen;
|
||||
#endif
|
||||
// Private so Palette objects can not be copied
|
||||
Palette(const Palette &);
|
||||
Palette &operator=(const Palette &);
|
||||
public:
|
||||
#if PLAT_WIN
|
||||
void *hpal;
|
||||
#endif
|
||||
bool allowRealization;
|
||||
|
||||
Palette();
|
||||
~Palette();
|
||||
|
||||
void Release();
|
||||
|
||||
/**
|
||||
* This method either adds a colour to the list of wanted colours (want==true)
|
||||
* or retrieves the allocated colour back to the ColourPair.
|
||||
* This is one method to make it easier to keep the code for wanting and retrieving in sync.
|
||||
*/
|
||||
void WantFind(ColourPair &cp, bool want);
|
||||
|
||||
void Allocate(Window &w);
|
||||
};
|
||||
|
||||
/**
|
||||
* Font management.
|
||||
*/
|
||||
|
||||
struct FontParameters {
|
||||
const char *faceName;
|
||||
float size;
|
||||
int weight;
|
||||
bool italic;
|
||||
int extraFontFlag;
|
||||
int technology;
|
||||
int characterSet;
|
||||
|
||||
FontParameters(
|
||||
const char *faceName_,
|
||||
float size_=10,
|
||||
int weight_=400,
|
||||
bool italic_=false,
|
||||
int extraFontFlag_=0,
|
||||
int technology_=0,
|
||||
int characterSet_=0) :
|
||||
|
||||
faceName(faceName_),
|
||||
size(size_),
|
||||
weight(weight_),
|
||||
italic(italic_),
|
||||
extraFontFlag(extraFontFlag_),
|
||||
technology(technology_),
|
||||
characterSet(characterSet_)
|
||||
{
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class Font {
|
||||
protected:
|
||||
FontID fid;
|
||||
@ -300,8 +254,7 @@ public:
|
||||
Font();
|
||||
virtual ~Font();
|
||||
|
||||
virtual void Create(const char *faceName, int characterSet, int size,
|
||||
bool bold, bool italic, int extraFontFlag=0);
|
||||
virtual void Create(const FontParameters &fp);
|
||||
virtual void Release();
|
||||
|
||||
FontID GetID() { return fid; }
|
||||
@ -325,7 +278,7 @@ private:
|
||||
public:
|
||||
Surface() {}
|
||||
virtual ~Surface() {}
|
||||
static Surface *Allocate();
|
||||
static Surface *Allocate(int technology);
|
||||
|
||||
virtual void Init(WindowID wid)=0;
|
||||
virtual void Init(SurfaceID sid, WindowID wid)=0;
|
||||
@ -333,36 +286,35 @@ public:
|
||||
|
||||
virtual void Release()=0;
|
||||
virtual bool Initialised()=0;
|
||||
virtual void PenColour(ColourAllocated fore)=0;
|
||||
virtual void PenColour(ColourDesired fore)=0;
|
||||
virtual int LogPixelsY()=0;
|
||||
virtual int DeviceHeightFont(int points)=0;
|
||||
virtual void MoveTo(int x_, int y_)=0;
|
||||
virtual void LineTo(int x_, int y_)=0;
|
||||
virtual void Polygon(Point *pts, int npts, ColourAllocated fore, ColourAllocated back)=0;
|
||||
virtual void RectangleDraw(PRectangle rc, ColourAllocated fore, ColourAllocated back)=0;
|
||||
virtual void FillRectangle(PRectangle rc, ColourAllocated back)=0;
|
||||
virtual void Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired back)=0;
|
||||
virtual void RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back)=0;
|
||||
virtual void FillRectangle(PRectangle rc, ColourDesired back)=0;
|
||||
virtual void FillRectangle(PRectangle rc, Surface &surfacePattern)=0;
|
||||
virtual void RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAllocated back)=0;
|
||||
virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourAllocated fill, int alphaFill,
|
||||
ColourAllocated outline, int alphaOutline, int flags)=0;
|
||||
virtual void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back)=0;
|
||||
virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill,
|
||||
ColourDesired outline, int alphaOutline, int flags)=0;
|
||||
virtual void DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage) = 0;
|
||||
virtual void Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back)=0;
|
||||
virtual void Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back)=0;
|
||||
virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource)=0;
|
||||
|
||||
virtual void DrawTextNoClip(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back)=0;
|
||||
virtual void DrawTextClipped(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back)=0;
|
||||
virtual void DrawTextTransparent(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore)=0;
|
||||
virtual void MeasureWidths(Font &font_, const char *s, int len, int *positions)=0;
|
||||
virtual int WidthText(Font &font_, const char *s, int len)=0;
|
||||
virtual int WidthChar(Font &font_, char ch)=0;
|
||||
virtual int Ascent(Font &font_)=0;
|
||||
virtual int Descent(Font &font_)=0;
|
||||
virtual int InternalLeading(Font &font_)=0;
|
||||
virtual int ExternalLeading(Font &font_)=0;
|
||||
virtual int Height(Font &font_)=0;
|
||||
virtual int AverageCharWidth(Font &font_)=0;
|
||||
virtual void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back)=0;
|
||||
virtual void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back)=0;
|
||||
virtual void DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore)=0;
|
||||
virtual void MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions)=0;
|
||||
virtual XYPOSITION WidthText(Font &font_, const char *s, int len)=0;
|
||||
virtual XYPOSITION WidthChar(Font &font_, char ch)=0;
|
||||
virtual XYPOSITION Ascent(Font &font_)=0;
|
||||
virtual XYPOSITION Descent(Font &font_)=0;
|
||||
virtual XYPOSITION InternalLeading(Font &font_)=0;
|
||||
virtual XYPOSITION ExternalLeading(Font &font_)=0;
|
||||
virtual XYPOSITION Height(Font &font_)=0;
|
||||
virtual XYPOSITION AverageCharWidth(Font &font_)=0;
|
||||
|
||||
virtual int SetPalette(Palette *pal, bool inBackGround)=0;
|
||||
virtual void SetClip(PRectangle rc)=0;
|
||||
virtual void FlushCachedState()=0;
|
||||
|
||||
@ -439,7 +391,7 @@ public:
|
||||
static ListBox *Allocate();
|
||||
|
||||
virtual void SetFont(Font &font)=0;
|
||||
virtual void Create(Window &parent, int ctrlID, Point location, int lineHeight_, bool unicodeMode_)=0;
|
||||
virtual void Create(Window &parent, int ctrlID, Point location, int lineHeight_, bool unicodeMode_, int technology_)=0;
|
||||
virtual void SetAverageCharWidth(int width)=0;
|
||||
virtual void SetVisibleRows(int rows)=0;
|
||||
virtual int GetVisibleRows() const=0;
|
||||
@ -564,4 +516,10 @@ public:
|
||||
#pragma warning(disable: 4244 4309 4514 4710)
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(SCINTILLA_QT)
|
||||
#pragma GCC diagnostic ignored "-Wmissing-braces"
|
||||
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
||||
#pragma GCC diagnostic ignored "-Wchar-subscripts"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -114,6 +114,12 @@
|
||||
#define SCLEX_TXT2TAGS 99
|
||||
#define SCLEX_A68K 100
|
||||
#define SCLEX_MODULA 101
|
||||
#define SCLEX_COFFEESCRIPT 102
|
||||
#define SCLEX_TCMD 103
|
||||
#define SCLEX_AVS 104
|
||||
#define SCLEX_ECL 105
|
||||
#define SCLEX_OSCRIPT 106
|
||||
#define SCLEX_VISUALPROLOG 107
|
||||
#define SCLEX_AUTOMATIC 1000
|
||||
#define SCE_P_DEFAULT 0
|
||||
#define SCE_P_COMMENTLINE 1
|
||||
@ -153,6 +159,7 @@
|
||||
#define SCE_C_GLOBALCLASS 19
|
||||
#define SCE_C_STRINGRAW 20
|
||||
#define SCE_C_TRIPLEVERBATIM 21
|
||||
#define SCE_C_HASHQUOTEDSTRING 22
|
||||
#define SCE_D_DEFAULT 0
|
||||
#define SCE_D_COMMENT 1
|
||||
#define SCE_D_COMMENTLINE 2
|
||||
@ -477,6 +484,17 @@
|
||||
#define SCE_BAT_COMMAND 5
|
||||
#define SCE_BAT_IDENTIFIER 6
|
||||
#define SCE_BAT_OPERATOR 7
|
||||
#define SCE_TCMD_DEFAULT 0
|
||||
#define SCE_TCMD_COMMENT 1
|
||||
#define SCE_TCMD_WORD 2
|
||||
#define SCE_TCMD_LABEL 3
|
||||
#define SCE_TCMD_HIDE 4
|
||||
#define SCE_TCMD_COMMAND 5
|
||||
#define SCE_TCMD_IDENTIFIER 6
|
||||
#define SCE_TCMD_OPERATOR 7
|
||||
#define SCE_TCMD_ENVIRONMENT 8
|
||||
#define SCE_TCMD_EXPANSION 9
|
||||
#define SCE_TCMD_CLABEL 10
|
||||
#define SCE_MAKE_DEFAULT 0
|
||||
#define SCE_MAKE_COMMENT 1
|
||||
#define SCE_MAKE_PREPROCESSOR 2
|
||||
@ -663,6 +681,7 @@
|
||||
#define SCE_CSS_EXTENDED_PSEUDOCLASS 20
|
||||
#define SCE_CSS_EXTENDED_PSEUDOELEMENT 21
|
||||
#define SCE_CSS_MEDIA 22
|
||||
#define SCE_CSS_VARIABLE 23
|
||||
#define SCE_POV_DEFAULT 0
|
||||
#define SCE_POV_COMMENT 1
|
||||
#define SCE_POV_COMMENTLINE 2
|
||||
@ -1476,6 +1495,117 @@
|
||||
#define SCE_MODULA_PRGKEY 15
|
||||
#define SCE_MODULA_OPERATOR 16
|
||||
#define SCE_MODULA_BADSTR 17
|
||||
#define SCE_COFFEESCRIPT_DEFAULT 0
|
||||
#define SCE_COFFEESCRIPT_COMMENT 1
|
||||
#define SCE_COFFEESCRIPT_COMMENTLINE 2
|
||||
#define SCE_COFFEESCRIPT_COMMENTDOC 3
|
||||
#define SCE_COFFEESCRIPT_NUMBER 4
|
||||
#define SCE_COFFEESCRIPT_WORD 5
|
||||
#define SCE_COFFEESCRIPT_STRING 6
|
||||
#define SCE_COFFEESCRIPT_CHARACTER 7
|
||||
#define SCE_COFFEESCRIPT_UUID 8
|
||||
#define SCE_COFFEESCRIPT_PREPROCESSOR 9
|
||||
#define SCE_COFFEESCRIPT_OPERATOR 10
|
||||
#define SCE_COFFEESCRIPT_IDENTIFIER 11
|
||||
#define SCE_COFFEESCRIPT_STRINGEOL 12
|
||||
#define SCE_COFFEESCRIPT_VERBATIM 13
|
||||
#define SCE_COFFEESCRIPT_REGEX 14
|
||||
#define SCE_COFFEESCRIPT_COMMENTLINEDOC 15
|
||||
#define SCE_COFFEESCRIPT_WORD2 16
|
||||
#define SCE_COFFEESCRIPT_COMMENTDOCKEYWORD 17
|
||||
#define SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR 18
|
||||
#define SCE_COFFEESCRIPT_GLOBALCLASS 19
|
||||
#define SCE_COFFEESCRIPT_STRINGRAW 20
|
||||
#define SCE_COFFEESCRIPT_TRIPLEVERBATIM 21
|
||||
#define SCE_COFFEESCRIPT_HASHQUOTEDSTRING 22
|
||||
#define SCE_COFFEESCRIPT_COMMENTBLOCK 22
|
||||
#define SCE_COFFEESCRIPT_VERBOSE_REGEX 23
|
||||
#define SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT 24
|
||||
#define SCE_AVS_DEFAULT 0
|
||||
#define SCE_AVS_COMMENTBLOCK 1
|
||||
#define SCE_AVS_COMMENTBLOCKN 2
|
||||
#define SCE_AVS_COMMENTLINE 3
|
||||
#define SCE_AVS_NUMBER 4
|
||||
#define SCE_AVS_OPERATOR 5
|
||||
#define SCE_AVS_IDENTIFIER 6
|
||||
#define SCE_AVS_STRING 7
|
||||
#define SCE_AVS_TRIPLESTRING 8
|
||||
#define SCE_AVS_KEYWORD 9
|
||||
#define SCE_AVS_FILTER 10
|
||||
#define SCE_AVS_PLUGIN 11
|
||||
#define SCE_AVS_FUNCTION 12
|
||||
#define SCE_AVS_CLIPPROP 13
|
||||
#define SCE_AVS_USERDFN 14
|
||||
#define SCE_ECL_DEFAULT 0
|
||||
#define SCE_ECL_COMMENT 1
|
||||
#define SCE_ECL_COMMENTLINE 2
|
||||
#define SCE_ECL_NUMBER 3
|
||||
#define SCE_ECL_STRING 4
|
||||
#define SCE_ECL_WORD0 5
|
||||
#define SCE_ECL_OPERATOR 6
|
||||
#define SCE_ECL_CHARACTER 7
|
||||
#define SCE_ECL_UUID 8
|
||||
#define SCE_ECL_PREPROCESSOR 9
|
||||
#define SCE_ECL_UNKNOWN 10
|
||||
#define SCE_ECL_IDENTIFIER 11
|
||||
#define SCE_ECL_STRINGEOL 12
|
||||
#define SCE_ECL_VERBATIM 13
|
||||
#define SCE_ECL_REGEX 14
|
||||
#define SCE_ECL_COMMENTLINEDOC 15
|
||||
#define SCE_ECL_WORD1 16
|
||||
#define SCE_ECL_COMMENTDOCKEYWORD 17
|
||||
#define SCE_ECL_COMMENTDOCKEYWORDERROR 18
|
||||
#define SCE_ECL_WORD2 19
|
||||
#define SCE_ECL_WORD3 20
|
||||
#define SCE_ECL_WORD4 21
|
||||
#define SCE_ECL_WORD5 22
|
||||
#define SCE_ECL_COMMENTDOC 23
|
||||
#define SCE_ECL_ADDED 24
|
||||
#define SCE_ECL_DELETED 25
|
||||
#define SCE_ECL_CHANGED 26
|
||||
#define SCE_ECL_MOVED 27
|
||||
#define SCE_OSCRIPT_DEFAULT 0
|
||||
#define SCE_OSCRIPT_LINE_COMMENT 1
|
||||
#define SCE_OSCRIPT_BLOCK_COMMENT 2
|
||||
#define SCE_OSCRIPT_DOC_COMMENT 3
|
||||
#define SCE_OSCRIPT_PREPROCESSOR 4
|
||||
#define SCE_OSCRIPT_NUMBER 5
|
||||
#define SCE_OSCRIPT_SINGLEQUOTE_STRING 6
|
||||
#define SCE_OSCRIPT_DOUBLEQUOTE_STRING 7
|
||||
#define SCE_OSCRIPT_CONSTANT 8
|
||||
#define SCE_OSCRIPT_IDENTIFIER 9
|
||||
#define SCE_OSCRIPT_GLOBAL 10
|
||||
#define SCE_OSCRIPT_KEYWORD 11
|
||||
#define SCE_OSCRIPT_OPERATOR 12
|
||||
#define SCE_OSCRIPT_LABEL 13
|
||||
#define SCE_OSCRIPT_TYPE 14
|
||||
#define SCE_OSCRIPT_FUNCTION 15
|
||||
#define SCE_OSCRIPT_OBJECT 16
|
||||
#define SCE_OSCRIPT_PROPERTY 17
|
||||
#define SCE_OSCRIPT_METHOD 18
|
||||
#define SCE_VISUALPROLOG_DEFAULT 0
|
||||
#define SCE_VISUALPROLOG_KEY_MAJOR 1
|
||||
#define SCE_VISUALPROLOG_KEY_MINOR 2
|
||||
#define SCE_VISUALPROLOG_KEY_DIRECTIVE 3
|
||||
#define SCE_VISUALPROLOG_COMMENT_BLOCK 4
|
||||
#define SCE_VISUALPROLOG_COMMENT_LINE 5
|
||||
#define SCE_VISUALPROLOG_COMMENT_KEY 6
|
||||
#define SCE_VISUALPROLOG_COMMENT_KEY_ERROR 7
|
||||
#define SCE_VISUALPROLOG_IDENTIFIER 8
|
||||
#define SCE_VISUALPROLOG_VARIABLE 9
|
||||
#define SCE_VISUALPROLOG_ANONYMOUS 10
|
||||
#define SCE_VISUALPROLOG_NUMBER 11
|
||||
#define SCE_VISUALPROLOG_OPERATOR 12
|
||||
#define SCE_VISUALPROLOG_CHARACTER 13
|
||||
#define SCE_VISUALPROLOG_CHARACTER_TOO_MANY 14
|
||||
#define SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR 15
|
||||
#define SCE_VISUALPROLOG_STRING 16
|
||||
#define SCE_VISUALPROLOG_STRING_ESCAPE 17
|
||||
#define SCE_VISUALPROLOG_STRING_ESCAPE_ERROR 18
|
||||
#define SCE_VISUALPROLOG_STRING_EOL_OPEN 19
|
||||
#define SCE_VISUALPROLOG_STRING_VERBATIM 20
|
||||
#define SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL 21
|
||||
#define SCE_VISUALPROLOG_STRING_VERBATIM_EOL 22
|
||||
/* --Autogenerated -- end of section automatically generated from Scintilla.iface */
|
||||
|
||||
#endif
|
||||
|
@ -51,6 +51,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SCI_ADDSTYLEDTEXT 2002
|
||||
#define SCI_INSERTTEXT 2003
|
||||
#define SCI_CLEARALL 2004
|
||||
#define SCI_DELETERANGE 2645
|
||||
#define SCI_CLEARDOCUMENTSTYLE 2005
|
||||
#define SCI_GETLENGTH 2006
|
||||
#define SCI_GETCHARAT 2007
|
||||
@ -92,7 +93,6 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SCI_GETTABWIDTH 2121
|
||||
#define SC_CP_UTF8 65001
|
||||
#define SCI_SETCODEPAGE 2037
|
||||
#define SCI_SETUSEPALETTE 2039
|
||||
#define MARKER_MAX 31
|
||||
#define SC_MARK_CIRCLE 0
|
||||
#define SC_MARK_ROUNDRECT 1
|
||||
@ -221,6 +221,14 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SCI_STYLEGETCHANGEABLE 2492
|
||||
#define SCI_STYLEGETHOTSPOT 2493
|
||||
#define SCI_STYLESETCASE 2060
|
||||
#define SC_FONT_SIZE_MULTIPLIER 100
|
||||
#define SCI_STYLESETSIZEFRACTIONAL 2061
|
||||
#define SCI_STYLEGETSIZEFRACTIONAL 2062
|
||||
#define SC_WEIGHT_NORMAL 400
|
||||
#define SC_WEIGHT_SEMIBOLD 600
|
||||
#define SC_WEIGHT_BOLD 700
|
||||
#define SCI_STYLESETWEIGHT 2063
|
||||
#define SCI_STYLEGETWEIGHT 2064
|
||||
#define SCI_STYLESETCHARACTERSET 2066
|
||||
#define SCI_STYLESETHOTSPOT 2409
|
||||
#define SCI_SETSELFORE 2067
|
||||
@ -316,6 +324,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SCI_GETLINEINDENTATION 2127
|
||||
#define SCI_GETLINEINDENTPOSITION 2128
|
||||
#define SCI_GETCOLUMN 2129
|
||||
#define SCI_COUNTCHARACTERS 2633
|
||||
#define SCI_SETHSCROLLBAR 2130
|
||||
#define SCI_GETHSCROLLBAR 2131
|
||||
#define SC_IV_NONE 0
|
||||
@ -329,7 +338,6 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SCI_GETLINEENDPOSITION 2136
|
||||
#define SCI_GETCODEPAGE 2137
|
||||
#define SCI_GETCARETFORE 2138
|
||||
#define SCI_GETUSEPALETTE 2139
|
||||
#define SCI_GETREADONLY 2140
|
||||
#define SCI_SETCURRENTPOS 2141
|
||||
#define SCI_SETSELECTIONSTART 2142
|
||||
@ -409,6 +417,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SCI_CALLTIPSETFORE 2206
|
||||
#define SCI_CALLTIPSETFOREHLT 2207
|
||||
#define SCI_CALLTIPUSESTYLE 2212
|
||||
#define SCI_CALLTIPSETPOSITION 2213
|
||||
#define SCI_VISIBLEFROMDOCLINE 2220
|
||||
#define SCI_DOCLINEFROMVISIBLE 2221
|
||||
#define SCI_WRAPCOUNT 2235
|
||||
@ -423,6 +432,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SCI_SHOWLINES 2226
|
||||
#define SCI_HIDELINES 2227
|
||||
#define SCI_GETLINEVISIBLE 2228
|
||||
#define SCI_GETALLLINESVISIBLE 2236
|
||||
#define SCI_SETFOLDEXPANDED 2229
|
||||
#define SCI_GETFOLDEXPANDED 2230
|
||||
#define SCI_TOGGLEFOLD 2231
|
||||
@ -451,6 +461,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SC_WRAPVISUALFLAG_NONE 0x0000
|
||||
#define SC_WRAPVISUALFLAG_END 0x0001
|
||||
#define SC_WRAPVISUALFLAG_START 0x0002
|
||||
#define SC_WRAPVISUALFLAG_MARGIN 0x0004
|
||||
#define SCI_SETWRAPVISUALFLAGS 2460
|
||||
#define SCI_GETWRAPVISUALFLAGS 2461
|
||||
#define SC_WRAPVISUALFLAGLOC_DEFAULT 0x0000
|
||||
@ -676,6 +687,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SCI_SETCHARSDEFAULT 2444
|
||||
#define SCI_AUTOCGETCURRENT 2445
|
||||
#define SCI_AUTOCGETCURRENTTEXT 2610
|
||||
#define SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE 0
|
||||
#define SC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE 1
|
||||
#define SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR 2634
|
||||
#define SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR 2635
|
||||
#define SCI_ALLOCATE 2446
|
||||
#define SCI_TARGETASUTF8 2447
|
||||
#define SCI_SETLENGTHFORENCODE 2448
|
||||
@ -714,6 +729,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SCI_GETPOSITIONCACHE 2515
|
||||
#define SCI_COPYALLOWLINE 2519
|
||||
#define SCI_GETCHARACTERPOINTER 2520
|
||||
#define SCI_GETRANGEPOINTER 2643
|
||||
#define SCI_GETGAPPOSITION 2644
|
||||
#define SCI_SETKEYSUNICODE 2521
|
||||
#define SCI_GETKEYSUNICODE 2522
|
||||
#define SCI_INDICSETALPHA 2523
|
||||
@ -819,6 +836,14 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SCI_REGISTERRGBAIMAGE 2627
|
||||
#define SCI_SCROLLTOSTART 2628
|
||||
#define SCI_SCROLLTOEND 2629
|
||||
#define SC_TECHNOLOGY_DEFAULT 0
|
||||
#define SC_TECHNOLOGY_DIRECTWRITE 1
|
||||
#define SCI_SETTECHNOLOGY 2630
|
||||
#define SCI_GETTECHNOLOGY 2631
|
||||
#define SCI_CREATELOADER 2632
|
||||
#define SCI_FINDINDICATORSHOW 2640
|
||||
#define SCI_FINDINDICATORFLASH 2641
|
||||
#define SCI_FINDINDICATORHIDE 2642
|
||||
#define SCI_STARTRECORD 3001
|
||||
#define SCI_STOPRECORD 3002
|
||||
#define SCI_SETLEXER 4001
|
||||
@ -1028,6 +1053,8 @@ struct SCNotification {
|
||||
#ifdef INCLUDE_DEPRECATED_FEATURES
|
||||
|
||||
#define SC_CP_DBCS 1
|
||||
#define SCI_SETUSEPALETTE 2039
|
||||
#define SCI_GETUSEPALETTE 2139
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -101,6 +101,9 @@ fun void InsertText=2003(position pos, string text)
|
||||
# Delete all text in the document.
|
||||
fun void ClearAll=2004(,)
|
||||
|
||||
# Delete a range of text in the document.
|
||||
fun void DeleteRange=2645(position pos, int deleteLength)
|
||||
|
||||
# Set all style bytes to 0, remove all folding information.
|
||||
fun void ClearDocumentStyle=2005(,)
|
||||
|
||||
@ -228,10 +231,6 @@ val SC_CP_UTF8=65001
|
||||
# The SC_CP_UTF8 value can be used to enter Unicode mode.
|
||||
set void SetCodePage=2037(int codePage,)
|
||||
|
||||
# In palette mode, Scintilla uses the environment's palette calls to display
|
||||
# more colours. This may lead to ugly displays.
|
||||
set void SetUsePalette=2039(bool usePalette,)
|
||||
|
||||
enu MarkerSymbol=SC_MARK_
|
||||
val MARKER_MAX=31
|
||||
val SC_MARK_CIRCLE=0
|
||||
@ -482,6 +481,25 @@ get bool StyleGetHotSpot=2493(int style,)
|
||||
# Set a style to be mixed case, or to force upper or lower case.
|
||||
set void StyleSetCase=2060(int style, int caseForce)
|
||||
|
||||
val SC_FONT_SIZE_MULTIPLIER=100
|
||||
|
||||
# Set the size of characters of a style. Size is in points multiplied by 100.
|
||||
set void StyleSetSizeFractional=2061(int style, int caseForce)
|
||||
|
||||
# Get the size of characters of a style in points multiplied by 100
|
||||
get int StyleGetSizeFractional=2062(int style,)
|
||||
|
||||
enu FontWeight=SC_WEIGHT_
|
||||
val SC_WEIGHT_NORMAL=400
|
||||
val SC_WEIGHT_SEMIBOLD=600
|
||||
val SC_WEIGHT_BOLD=700
|
||||
|
||||
# Set the weight of characters of a style.
|
||||
set void StyleSetWeight=2063(int style, int weight)
|
||||
|
||||
# Get the weight of characters of a style.
|
||||
get int StyleGetWeight=2064(int style,)
|
||||
|
||||
# Set the character set of the font in a style.
|
||||
set void StyleSetCharacterSet=2066(int style, int characterSet)
|
||||
|
||||
@ -748,9 +766,11 @@ get position GetLineIndentPosition=2128(int line,)
|
||||
# Retrieve the column number of a position, taking tab width into account.
|
||||
get int GetColumn=2129(position pos,)
|
||||
|
||||
# Count characters between two positions.
|
||||
fun int CountCharacters=2633(int startPos, int endPos)
|
||||
|
||||
# Show or hide the horizontal scroll bar.
|
||||
set void SetHScrollBar=2130(bool show,)
|
||||
|
||||
# Is the horizontal scroll bar visible?
|
||||
get bool GetHScrollBar=2131(,)
|
||||
|
||||
@ -774,7 +794,7 @@ set void SetHighlightGuide=2134(int column,)
|
||||
get int GetHighlightGuide=2135(,)
|
||||
|
||||
# Get the position after the last visible characters on a line.
|
||||
get int GetLineEndPosition=2136(int line,)
|
||||
get position GetLineEndPosition=2136(int line,)
|
||||
|
||||
# Get the code page used to interpret the bytes of the document as characters.
|
||||
get int GetCodePage=2137(,)
|
||||
@ -782,9 +802,6 @@ get int GetCodePage=2137(,)
|
||||
# Get the foreground colour of the caret.
|
||||
get colour GetCaretFore=2138(,)
|
||||
|
||||
# In palette mode?
|
||||
get bool GetUsePalette=2139(,)
|
||||
|
||||
# In read-only mode?
|
||||
get bool GetReadOnly=2140(,)
|
||||
|
||||
@ -1027,6 +1044,9 @@ set void CallTipSetForeHlt=2207(colour fore,)
|
||||
# Enable use of STYLE_CALLTIP and set call tip tab size in pixels.
|
||||
set void CallTipUseStyle=2212(int tabSize,)
|
||||
|
||||
# Set position of calltip, above or below text.
|
||||
set void CallTipSetPosition=2213(bool above,)
|
||||
|
||||
# Find the display line of a document line taking hidden lines into account.
|
||||
fun int VisibleFromDocLine=2220(int line,)
|
||||
|
||||
@ -1065,6 +1085,9 @@ fun void HideLines=2227(int lineStart, int lineEnd)
|
||||
# Is a line visible?
|
||||
get bool GetLineVisible=2228(int line,)
|
||||
|
||||
# Are all lines visible?
|
||||
get bool GetAllLinesVisible=2236(,)
|
||||
|
||||
# Show the children of a header line.
|
||||
set void SetFoldExpanded=2229(int line, bool expanded)
|
||||
|
||||
@ -1132,6 +1155,7 @@ enu WrapVisualFlag=SC_WRAPVISUALFLAG_
|
||||
val SC_WRAPVISUALFLAG_NONE=0x0000
|
||||
val SC_WRAPVISUALFLAG_END=0x0001
|
||||
val SC_WRAPVISUALFLAG_START=0x0002
|
||||
val SC_WRAPVISUALFLAG_MARGIN=0x0004
|
||||
|
||||
# Set the display mode of visual flags for wrapped lines.
|
||||
set void SetWrapVisualFlags=2460(int wrapVisualFlags,)
|
||||
@ -1786,6 +1810,16 @@ fun int AutoCGetCurrent=2445(,)
|
||||
# Returns the length of the item text
|
||||
fun int AutoCGetCurrentText=2610(, stringresult s)
|
||||
|
||||
enu CaseInsensitiveBehaviour=SC_CASEINSENSITIVEBEHAVIOUR_
|
||||
val SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE=0
|
||||
val SC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE=1
|
||||
|
||||
# Set auto-completion case insensitive behaviour to either prefer case-sensitive matches or have no preference.
|
||||
set void AutoCSetCaseInsensitiveBehaviour=2634(int behaviour,)
|
||||
|
||||
# Get auto-completion case insensitive behaviour.
|
||||
get int AutoCGetCaseInsensitiveBehaviour=2635(,)
|
||||
|
||||
# Enlarge the document to a particular size of text bytes.
|
||||
fun void Allocate=2446(int bytes,)
|
||||
|
||||
@ -1893,6 +1927,15 @@ fun void CopyAllowLine=2519(,)
|
||||
# characters in the document.
|
||||
get int GetCharacterPointer=2520(,)
|
||||
|
||||
# Return a read-only pointer to a range of characters in the document.
|
||||
# May move the gap so that the range is contiguous, but will only move up
|
||||
# to rangeLength bytes.
|
||||
get int GetRangePointer=2643(int position, int rangeLength)
|
||||
|
||||
# Return a position which, to avoid performance costs, should not be within
|
||||
# the range of a call to GetRangePointer.
|
||||
get position GetGapPosition=2644(,)
|
||||
|
||||
# Always interpret keyboard input as Unicode
|
||||
set void SetKeysUnicode=2521(bool keysUnicode,)
|
||||
|
||||
@ -2175,6 +2218,27 @@ fun void ScrollToStart=2628(,)
|
||||
# Scroll to end of document.
|
||||
fun void ScrollToEnd=2629(,)
|
||||
|
||||
val SC_TECHNOLOGY_DEFAULT=0
|
||||
val SC_TECHNOLOGY_DIRECTWRITE=1
|
||||
|
||||
# Set the technolgy used.
|
||||
set void SetTechnology=2630(int technology,)
|
||||
|
||||
# Get the tech.
|
||||
get int GetTechnology=2631(,)
|
||||
|
||||
# Create an ILoader*.
|
||||
fun int CreateLoader=2632(int bytes,)
|
||||
|
||||
# On OS X, show a find indicator.
|
||||
fun void FindIndicatorShow=2640(position start, position end)
|
||||
|
||||
# On OS X, flash a find indicator, then fade out.
|
||||
fun void FindIndicatorFlash=2641(position start, position end)
|
||||
|
||||
# On OS X, hide the find indicator.
|
||||
fun void FindIndicatorHide=2642(,)
|
||||
|
||||
# Start notifying the container of all key presses and commands.
|
||||
fun void StartRecord=3001(,)
|
||||
|
||||
@ -2421,6 +2485,12 @@ val SCLEX_MARKDOWN=98
|
||||
val SCLEX_TXT2TAGS=99
|
||||
val SCLEX_A68K=100
|
||||
val SCLEX_MODULA=101
|
||||
val SCLEX_COFFEESCRIPT=102
|
||||
val SCLEX_TCMD=103
|
||||
val SCLEX_AVS=104
|
||||
val SCLEX_ECL=105
|
||||
val SCLEX_OSCRIPT=106
|
||||
val SCLEX_VISUALPROLOG=107
|
||||
|
||||
# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
|
||||
# value assigned in sequence from SCLEX_AUTOMATIC+1.
|
||||
@ -2469,6 +2539,7 @@ val SCE_C_COMMENTDOCKEYWORDERROR=18
|
||||
val SCE_C_GLOBALCLASS=19
|
||||
val SCE_C_STRINGRAW=20
|
||||
val SCE_C_TRIPLEVERBATIM=21
|
||||
val SCE_C_HASHQUOTEDSTRING=22
|
||||
# Lexical states for SCLEX_D
|
||||
lex D=SCLEX_D SCE_D_
|
||||
val SCE_D_DEFAULT=0
|
||||
@ -2832,6 +2903,19 @@ val SCE_BAT_HIDE=4
|
||||
val SCE_BAT_COMMAND=5
|
||||
val SCE_BAT_IDENTIFIER=6
|
||||
val SCE_BAT_OPERATOR=7
|
||||
# Lexical states for SCLEX_TCMD
|
||||
lex TCMD=SCLEX_TCMD SCE_TCMD_
|
||||
val SCE_TCMD_DEFAULT=0
|
||||
val SCE_TCMD_COMMENT=1
|
||||
val SCE_TCMD_WORD=2
|
||||
val SCE_TCMD_LABEL=3
|
||||
val SCE_TCMD_HIDE=4
|
||||
val SCE_TCMD_COMMAND=5
|
||||
val SCE_TCMD_IDENTIFIER=6
|
||||
val SCE_TCMD_OPERATOR=7
|
||||
val SCE_TCMD_ENVIRONMENT=8
|
||||
val SCE_TCMD_EXPANSION=9
|
||||
val SCE_TCMD_CLABEL=10
|
||||
# Lexical states for SCLEX_MAKEFILE
|
||||
lex MakeFile=SCLEX_MAKEFILE SCE_MAKE_
|
||||
val SCE_MAKE_DEFAULT=0
|
||||
@ -3051,6 +3135,7 @@ val SCE_CSS_EXTENDED_IDENTIFIER=19
|
||||
val SCE_CSS_EXTENDED_PSEUDOCLASS=20
|
||||
val SCE_CSS_EXTENDED_PSEUDOELEMENT=21
|
||||
val SCE_CSS_MEDIA=22
|
||||
val SCE_CSS_VARIABLE=23
|
||||
# Lexical states for SCLEX_POV
|
||||
lex POV=SCLEX_POV SCE_POV_
|
||||
val SCE_POV_DEFAULT=0
|
||||
@ -3968,6 +4053,127 @@ val SCE_MODULA_PRAGMA=14
|
||||
val SCE_MODULA_PRGKEY=15
|
||||
val SCE_MODULA_OPERATOR=16
|
||||
val SCE_MODULA_BADSTR=17
|
||||
# Lexical states for SCLEX_COFFEESCRIPT
|
||||
lex CoffeeScript=SCLEX_COFFEESCRIPT SCE_COFFEESCRIPT_
|
||||
val SCE_COFFEESCRIPT_DEFAULT=0
|
||||
val SCE_COFFEESCRIPT_COMMENT=1
|
||||
val SCE_COFFEESCRIPT_COMMENTLINE=2
|
||||
val SCE_COFFEESCRIPT_COMMENTDOC=3
|
||||
val SCE_COFFEESCRIPT_NUMBER=4
|
||||
val SCE_COFFEESCRIPT_WORD=5
|
||||
val SCE_COFFEESCRIPT_STRING=6
|
||||
val SCE_COFFEESCRIPT_CHARACTER=7
|
||||
val SCE_COFFEESCRIPT_UUID=8
|
||||
val SCE_COFFEESCRIPT_PREPROCESSOR=9
|
||||
val SCE_COFFEESCRIPT_OPERATOR=10
|
||||
val SCE_COFFEESCRIPT_IDENTIFIER=11
|
||||
val SCE_COFFEESCRIPT_STRINGEOL=12
|
||||
val SCE_COFFEESCRIPT_VERBATIM=13
|
||||
val SCE_COFFEESCRIPT_REGEX=14
|
||||
val SCE_COFFEESCRIPT_COMMENTLINEDOC=15
|
||||
val SCE_COFFEESCRIPT_WORD2=16
|
||||
val SCE_COFFEESCRIPT_COMMENTDOCKEYWORD=17
|
||||
val SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR=18
|
||||
val SCE_COFFEESCRIPT_GLOBALCLASS=19
|
||||
val SCE_COFFEESCRIPT_STRINGRAW=20
|
||||
val SCE_COFFEESCRIPT_TRIPLEVERBATIM=21
|
||||
val SCE_COFFEESCRIPT_HASHQUOTEDSTRING=22
|
||||
val SCE_COFFEESCRIPT_COMMENTBLOCK=22
|
||||
val SCE_COFFEESCRIPT_VERBOSE_REGEX=23
|
||||
val SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT=24
|
||||
# Lexical states for SCLEX_AVS
|
||||
lex AVS=SCLEX_AVS SCE_AVS_
|
||||
val SCE_AVS_DEFAULT=0
|
||||
val SCE_AVS_COMMENTBLOCK=1
|
||||
val SCE_AVS_COMMENTBLOCKN=2
|
||||
val SCE_AVS_COMMENTLINE=3
|
||||
val SCE_AVS_NUMBER=4
|
||||
val SCE_AVS_OPERATOR=5
|
||||
val SCE_AVS_IDENTIFIER=6
|
||||
val SCE_AVS_STRING=7
|
||||
val SCE_AVS_TRIPLESTRING=8
|
||||
val SCE_AVS_KEYWORD=9
|
||||
val SCE_AVS_FILTER=10
|
||||
val SCE_AVS_PLUGIN=11
|
||||
val SCE_AVS_FUNCTION=12
|
||||
val SCE_AVS_CLIPPROP=13
|
||||
val SCE_AVS_USERDFN=14
|
||||
# Lexical states for SCLEX_ECL
|
||||
lex ECL=SCLEX_ECL SCE_ECL_
|
||||
val SCE_ECL_DEFAULT=0
|
||||
val SCE_ECL_COMMENT=1
|
||||
val SCE_ECL_COMMENTLINE=2
|
||||
val SCE_ECL_NUMBER=3
|
||||
val SCE_ECL_STRING=4
|
||||
val SCE_ECL_WORD0=5
|
||||
val SCE_ECL_OPERATOR=6
|
||||
val SCE_ECL_CHARACTER=7
|
||||
val SCE_ECL_UUID=8
|
||||
val SCE_ECL_PREPROCESSOR=9
|
||||
val SCE_ECL_UNKNOWN=10
|
||||
val SCE_ECL_IDENTIFIER=11
|
||||
val SCE_ECL_STRINGEOL=12
|
||||
val SCE_ECL_VERBATIM=13
|
||||
val SCE_ECL_REGEX=14
|
||||
val SCE_ECL_COMMENTLINEDOC=15
|
||||
val SCE_ECL_WORD1=16
|
||||
val SCE_ECL_COMMENTDOCKEYWORD=17
|
||||
val SCE_ECL_COMMENTDOCKEYWORDERROR=18
|
||||
val SCE_ECL_WORD2=19
|
||||
val SCE_ECL_WORD3=20
|
||||
val SCE_ECL_WORD4=21
|
||||
val SCE_ECL_WORD5=22
|
||||
val SCE_ECL_COMMENTDOC=23
|
||||
val SCE_ECL_ADDED=24
|
||||
val SCE_ECL_DELETED=25
|
||||
val SCE_ECL_CHANGED=26
|
||||
val SCE_ECL_MOVED=27
|
||||
# Lexical states for SCLEX_OSCRIPT
|
||||
lex OScript=SCLEX_OSCRIPT SCE_OSCRIPT_
|
||||
val SCE_OSCRIPT_DEFAULT=0
|
||||
val SCE_OSCRIPT_LINE_COMMENT=1
|
||||
val SCE_OSCRIPT_BLOCK_COMMENT=2
|
||||
val SCE_OSCRIPT_DOC_COMMENT=3
|
||||
val SCE_OSCRIPT_PREPROCESSOR=4
|
||||
val SCE_OSCRIPT_NUMBER=5
|
||||
val SCE_OSCRIPT_SINGLEQUOTE_STRING=6
|
||||
val SCE_OSCRIPT_DOUBLEQUOTE_STRING=7
|
||||
val SCE_OSCRIPT_CONSTANT=8
|
||||
val SCE_OSCRIPT_IDENTIFIER=9
|
||||
val SCE_OSCRIPT_GLOBAL=10
|
||||
val SCE_OSCRIPT_KEYWORD=11
|
||||
val SCE_OSCRIPT_OPERATOR=12
|
||||
val SCE_OSCRIPT_LABEL=13
|
||||
val SCE_OSCRIPT_TYPE=14
|
||||
val SCE_OSCRIPT_FUNCTION=15
|
||||
val SCE_OSCRIPT_OBJECT=16
|
||||
val SCE_OSCRIPT_PROPERTY=17
|
||||
val SCE_OSCRIPT_METHOD=18
|
||||
# Lexical states for SCLEX_VISUALPROLOG
|
||||
lex VisualProlog=SCLEX_VISUALPROLOG SCE_VISUALPROLOG_
|
||||
val SCE_VISUALPROLOG_DEFAULT=0
|
||||
val SCE_VISUALPROLOG_KEY_MAJOR=1
|
||||
val SCE_VISUALPROLOG_KEY_MINOR=2
|
||||
val SCE_VISUALPROLOG_KEY_DIRECTIVE=3
|
||||
val SCE_VISUALPROLOG_COMMENT_BLOCK=4
|
||||
val SCE_VISUALPROLOG_COMMENT_LINE=5
|
||||
val SCE_VISUALPROLOG_COMMENT_KEY=6
|
||||
val SCE_VISUALPROLOG_COMMENT_KEY_ERROR=7
|
||||
val SCE_VISUALPROLOG_IDENTIFIER=8
|
||||
val SCE_VISUALPROLOG_VARIABLE=9
|
||||
val SCE_VISUALPROLOG_ANONYMOUS=10
|
||||
val SCE_VISUALPROLOG_NUMBER=11
|
||||
val SCE_VISUALPROLOG_OPERATOR=12
|
||||
val SCE_VISUALPROLOG_CHARACTER=13
|
||||
val SCE_VISUALPROLOG_CHARACTER_TOO_MANY=14
|
||||
val SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR=15
|
||||
val SCE_VISUALPROLOG_STRING=16
|
||||
val SCE_VISUALPROLOG_STRING_ESCAPE=17
|
||||
val SCE_VISUALPROLOG_STRING_ESCAPE_ERROR=18
|
||||
val SCE_VISUALPROLOG_STRING_EOL_OPEN=19
|
||||
val SCE_VISUALPROLOG_STRING_VERBATIM=20
|
||||
val SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL=21
|
||||
val SCE_VISUALPROLOG_STRING_VERBATIM_EOL=22
|
||||
|
||||
# Events
|
||||
|
||||
@ -4005,3 +4211,12 @@ cat Deprecated
|
||||
# Deprecated in 2.21
|
||||
# The SC_CP_DBCS value can be used to indicate a DBCS mode for GTK+.
|
||||
val SC_CP_DBCS=1
|
||||
|
||||
# Deprecated in 2.30
|
||||
|
||||
# In palette mode?
|
||||
get bool GetUsePalette=2139(,)
|
||||
|
||||
# In palette mode, Scintilla uses the environment's palette calls to display
|
||||
# more colours. This may lead to ugly displays.
|
||||
set void SetUsePalette=2039(bool usePalette,)
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
|
@ -16,10 +16,6 @@
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable: 4786)
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <set>
|
||||
@ -157,7 +153,7 @@ class LexerAsm : public ILexer {
|
||||
public:
|
||||
LexerAsm() {
|
||||
}
|
||||
~LexerAsm() {
|
||||
virtual ~LexerAsm() {
|
||||
}
|
||||
void SCI_METHOD Release() {
|
||||
delete this;
|
||||
|
@ -425,7 +425,6 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
||||
}
|
||||
break;
|
||||
case SCE_SH_STRING: // delimited styles
|
||||
case SCE_SH_CHARACTER:
|
||||
case SCE_SH_BACKTICKS:
|
||||
case SCE_SH_PARAM:
|
||||
if (sc.ch == '\\' && Quote.Up != '\\') {
|
||||
@ -439,6 +438,14 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
||||
Quote.Count++;
|
||||
}
|
||||
break;
|
||||
case SCE_SH_CHARACTER: // singly-quoted strings
|
||||
if (sc.ch == Quote.Down) {
|
||||
Quote.Count--;
|
||||
if (Quote.Count == 0) {
|
||||
sc.ForwardSetState(SCE_SH_DEFAULT);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Must check end of HereDoc state 1 before default state is handled
|
||||
@ -507,7 +514,7 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
|
||||
if (sc.ch == '{') {
|
||||
sc.ChangeState(SCE_SH_PARAM);
|
||||
} else if (sc.ch == '\'') {
|
||||
sc.ChangeState(SCE_SH_CHARACTER);
|
||||
sc.ChangeState(SCE_SH_STRING);
|
||||
} else if (sc.ch == '"') {
|
||||
sc.ChangeState(SCE_SH_STRING);
|
||||
} else if (sc.ch == '(' || sc.ch == '`') {
|
||||
|
@ -24,10 +24,6 @@
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable: 4786)
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
@ -227,7 +223,7 @@ public:
|
||||
CheckFoldPoint(CheckFoldPoint_),
|
||||
osBasic(wordListDescriptions) {
|
||||
}
|
||||
~LexerBasic() {
|
||||
virtual ~LexerBasic() {
|
||||
}
|
||||
void SCI_METHOD Release() {
|
||||
delete this;
|
||||
|
@ -13,10 +13,6 @@
|
||||
#include <stdarg.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable: 4786)
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
@ -90,7 +86,7 @@ static bool followsReturnKeyword(StyleContext &sc, LexAccessor &styler) {
|
||||
static std::string GetRestOfLine(LexAccessor &styler, int start, bool allowSpace) {
|
||||
std::string restOfLine;
|
||||
int i =0;
|
||||
char ch = styler.SafeGetCharAt(start + i, '\n');
|
||||
char ch = styler.SafeGetCharAt(start, '\n');
|
||||
while ((ch != '\r') && (ch != '\n')) {
|
||||
if (allowSpace || (ch != ' '))
|
||||
restOfLine += ch;
|
||||
@ -209,6 +205,7 @@ struct OptionsCPP {
|
||||
bool trackPreprocessor;
|
||||
bool updatePreprocessor;
|
||||
bool triplequotedStrings;
|
||||
bool hashquotedStrings;
|
||||
bool fold;
|
||||
bool foldSyntaxBased;
|
||||
bool foldComment;
|
||||
@ -226,6 +223,7 @@ struct OptionsCPP {
|
||||
trackPreprocessor = true;
|
||||
updatePreprocessor = true;
|
||||
triplequotedStrings = false;
|
||||
hashquotedStrings = false;
|
||||
fold = false;
|
||||
foldSyntaxBased = true;
|
||||
foldComment = false;
|
||||
@ -268,6 +266,9 @@ struct OptionSetCPP : public OptionSet<OptionsCPP> {
|
||||
DefineProperty("lexer.cpp.triplequoted.strings", &OptionsCPP::triplequotedStrings,
|
||||
"Set to 1 to enable highlighting of triple-quoted strings.");
|
||||
|
||||
DefineProperty("lexer.cpp.hashquoted.strings", &OptionsCPP::hashquotedStrings,
|
||||
"Set to 1 to enable highlighting of hash-quoted strings.");
|
||||
|
||||
DefineProperty("fold", &OptionsCPP::fold);
|
||||
|
||||
DefineProperty("fold.cpp.syntax.based", &OptionsCPP::foldSyntaxBased,
|
||||
@ -334,7 +335,7 @@ public:
|
||||
setRelOp(CharacterSet::setNone, "=!<>"),
|
||||
setLogicalOp(CharacterSet::setNone, "|&") {
|
||||
}
|
||||
~LexerCPP() {
|
||||
virtual ~LexerCPP() {
|
||||
}
|
||||
void SCI_METHOD Release() {
|
||||
delete this;
|
||||
@ -463,9 +464,9 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
||||
bool isIncludePreprocessor = false;
|
||||
|
||||
int lineCurrent = styler.GetLine(startPos);
|
||||
if ((initStyle == SCE_C_PREPROCESSOR) ||
|
||||
(initStyle == SCE_C_COMMENTLINE) ||
|
||||
(initStyle == SCE_C_COMMENTLINEDOC)) {
|
||||
if ((MaskActive(initStyle) == SCE_C_PREPROCESSOR) ||
|
||||
(MaskActive(initStyle) == SCE_C_COMMENTLINE) ||
|
||||
(MaskActive(initStyle) == SCE_C_COMMENTLINEDOC)) {
|
||||
// Set continuationLine if last character of previous line is '\'
|
||||
if (lineCurrent > 0) {
|
||||
int chBack = styler.SafeGetCharAt(startPos-1, 0);
|
||||
@ -483,9 +484,9 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
||||
// look back to set chPrevNonWhite properly for better regex colouring
|
||||
if (startPos > 0) {
|
||||
int back = startPos;
|
||||
while (--back && IsSpaceEquiv(styler.StyleAt(back)))
|
||||
while (--back && IsSpaceEquiv(MaskActive(styler.StyleAt(back))))
|
||||
;
|
||||
if (styler.StyleAt(back) == SCE_C_OPERATOR) {
|
||||
if (MaskActive(styler.StyleAt(back)) == SCE_C_OPERATOR) {
|
||||
chPrevNonWhite = styler.SafeGetCharAt(back);
|
||||
}
|
||||
}
|
||||
@ -519,6 +520,8 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
||||
for (; sc.More(); sc.Forward()) {
|
||||
|
||||
if (sc.atLineStart) {
|
||||
// Using MaskActive() is not needed in the following statement.
|
||||
// Inside inactive preprocessor declaration, state will be reset anyway at the end of this block.
|
||||
if ((sc.state == SCE_C_STRING) || (sc.state == SCE_C_CHARACTER)) {
|
||||
// Prevent SCE_C_STRINGEOL from leaking back to previous line which
|
||||
// ends with a line continuation by locking in the state upto this position.
|
||||
@ -533,13 +536,6 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
||||
activitySet = activeFlag;
|
||||
sc.SetState(sc.state | activitySet);
|
||||
}
|
||||
if (activitySet) {
|
||||
if (sc.ch == '#') {
|
||||
if (sc.Match("#else") || sc.Match("#end") || sc.Match("#if")) {
|
||||
//activitySet = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sc.atLineEnd) {
|
||||
@ -553,6 +549,8 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
||||
// Handle line continuation generically.
|
||||
if (sc.ch == '\\') {
|
||||
if (sc.chNext == '\n' || sc.chNext == '\r') {
|
||||
lineCurrent++;
|
||||
vlls.Add(lineCurrent, preproc);
|
||||
sc.Forward();
|
||||
if (sc.ch == '\r' && sc.chNext == '\n') {
|
||||
sc.Forward();
|
||||
@ -673,7 +671,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
||||
if (!IsASpace(sc.ch) || !keywords3.InList(s + 1)) {
|
||||
sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR|activitySet);
|
||||
}
|
||||
sc.SetState(styleBeforeDCKeyword);
|
||||
sc.SetState(styleBeforeDCKeyword|activitySet);
|
||||
}
|
||||
break;
|
||||
case SCE_C_STRING:
|
||||
@ -692,6 +690,15 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
||||
sc.ForwardSetState(SCE_C_DEFAULT|activitySet);
|
||||
}
|
||||
break;
|
||||
case SCE_C_HASHQUOTEDSTRING:
|
||||
if (sc.ch == '\\') {
|
||||
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
|
||||
sc.Forward();
|
||||
}
|
||||
} else if (sc.ch == '\"') {
|
||||
sc.ForwardSetState(SCE_C_DEFAULT|activitySet);
|
||||
}
|
||||
break;
|
||||
case SCE_C_STRINGRAW:
|
||||
if (sc.Match(rawStringTerminator.c_str())) {
|
||||
for (size_t termPos=rawStringTerminator.size(); termPos; termPos--)
|
||||
@ -768,6 +775,9 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
|
||||
} else if (options.triplequotedStrings && sc.Match("\"\"\"")) {
|
||||
sc.SetState(SCE_C_TRIPLEVERBATIM|activitySet);
|
||||
sc.Forward(2);
|
||||
} else if (options.hashquotedStrings && sc.Match('#', '\"')) {
|
||||
sc.SetState(SCE_C_HASHQUOTEDSTRING|activitySet);
|
||||
sc.Forward();
|
||||
} else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
|
||||
if (lastWordWasUUID) {
|
||||
sc.SetState(SCE_C_UUID|activitySet);
|
||||
@ -1037,7 +1047,7 @@ void LexerCPP::EvaluateTokens(std::vector<std::string> &tokens) {
|
||||
if (tokens[i+2] == ")") {
|
||||
// defined()
|
||||
tokens.erase(tokens.begin() + i + 1, tokens.begin() + i + 3);
|
||||
} else if (((i+2)<tokens.size()) && (tokens[i+3] == ")")) {
|
||||
} else if (((i+3)<tokens.size()) && (tokens[i+3] == ")")) {
|
||||
// defined(<int>)
|
||||
tokens.erase(tokens.begin() + i + 1, tokens.begin() + i + 4);
|
||||
val = "1";
|
||||
|
@ -3,10 +3,16 @@
|
||||
** Lexer for Cascading Style Sheets
|
||||
** Written by Jakub Vrána
|
||||
** Improved by Philippe Lhoste (CSS2)
|
||||
** Improved by Ross McKay (SCSS mode; see http://sass-lang.com/ )
|
||||
**/
|
||||
// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
// TODO: handle SCSS nested properties like font: { weight: bold; size: 1em; }
|
||||
// TODO: handle SCSS interpolation: #{}
|
||||
// TODO: add features for Less if somebody feels like contributing; http://lesscss.org/
|
||||
// TODO: refactor this monster so that the next poor slob can read it!
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
@ -51,6 +57,22 @@ inline bool IsCssOperator(const int ch) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// look behind (from start of document to our start position) to determine current nesting level
|
||||
inline int NestingLevelLookBehind(unsigned int startPos, Accessor &styler) {
|
||||
int ch;
|
||||
int nestingLevel = 0;
|
||||
|
||||
for (unsigned int i = 0; i < startPos; i++) {
|
||||
ch = styler.SafeGetCharAt(i);
|
||||
if (ch == '{')
|
||||
nestingLevel++;
|
||||
else if (ch == '}')
|
||||
nestingLevel--;
|
||||
}
|
||||
|
||||
return nestingLevel;
|
||||
}
|
||||
|
||||
static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) {
|
||||
WordList &css1Props = *keywordlists[0];
|
||||
WordList &pseudoClasses = *keywordlists[1];
|
||||
@ -66,11 +88,35 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo
|
||||
int lastState = -1; // before operator
|
||||
int lastStateC = -1; // before comment
|
||||
int lastStateS = -1; // before single-quoted/double-quoted string
|
||||
int lastStateVar = -1; // before variable (SCSS)
|
||||
int lastStateVal = -1; // before value (SCSS)
|
||||
int op = ' '; // last operator
|
||||
int opPrev = ' '; // last operator
|
||||
bool insideParentheses = false; // true if currently in a CSS url() or similar construct
|
||||
|
||||
// property lexer.css.scss.language
|
||||
// Set to 1 for Sassy CSS (.scss)
|
||||
bool isScssDocument = styler.GetPropertyInt("lexer.css.scss.language") != 0;
|
||||
|
||||
// TODO: implement Less support
|
||||
bool isLessDocument = false;
|
||||
|
||||
// SCSS and Less both support single-line comments
|
||||
typedef enum _CommentModes { eCommentBlock = 0, eCommentLine = 1} CommentMode;
|
||||
CommentMode comment_mode = eCommentBlock;
|
||||
bool hasSingleLineComments = isScssDocument || isLessDocument;
|
||||
|
||||
// must keep track of nesting level in document types that support it (SCSS, Less)
|
||||
bool hasNesting = false;
|
||||
int nestingLevel = 0;
|
||||
if (isScssDocument || isLessDocument) {
|
||||
hasNesting = true;
|
||||
nestingLevel = NestingLevelLookBehind(startPos, styler);
|
||||
}
|
||||
|
||||
// "the loop"
|
||||
for (; sc.More(); sc.Forward()) {
|
||||
if (sc.state == SCE_CSS_COMMENT && sc.Match('*', '/')) {
|
||||
if (sc.state == SCE_CSS_COMMENT && ((comment_mode == eCommentBlock && sc.Match('*', '/')) || (comment_mode == eCommentLine && sc.atLineEnd))) {
|
||||
if (lastStateC == -1) {
|
||||
// backtrack to get last state:
|
||||
// comments are like whitespace, so we must return to the previous state
|
||||
@ -94,8 +140,12 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo
|
||||
if (i == 0)
|
||||
lastStateC = SCE_CSS_DEFAULT;
|
||||
}
|
||||
sc.Forward();
|
||||
sc.ForwardSetState(lastStateC);
|
||||
if (comment_mode == eCommentBlock) {
|
||||
sc.Forward();
|
||||
sc.ForwardSetState(lastStateC);
|
||||
} else /* eCommentLine */ {
|
||||
sc.SetState(lastStateC);
|
||||
}
|
||||
}
|
||||
|
||||
if (sc.state == SCE_CSS_COMMENT)
|
||||
@ -125,7 +175,7 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo
|
||||
}
|
||||
switch (op) {
|
||||
case '@':
|
||||
if (lastState == SCE_CSS_DEFAULT)
|
||||
if (lastState == SCE_CSS_DEFAULT || hasNesting)
|
||||
sc.SetState(SCE_CSS_DIRECTIVE);
|
||||
break;
|
||||
case '>':
|
||||
@ -144,15 +194,33 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo
|
||||
sc.SetState(SCE_CSS_TAG);
|
||||
break;
|
||||
case '{':
|
||||
if (lastState == SCE_CSS_MEDIA)
|
||||
nestingLevel++;
|
||||
switch (lastState) {
|
||||
case SCE_CSS_MEDIA:
|
||||
sc.SetState(SCE_CSS_DEFAULT);
|
||||
else if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_DIRECTIVE)
|
||||
break;
|
||||
case SCE_CSS_TAG:
|
||||
case SCE_CSS_DIRECTIVE:
|
||||
sc.SetState(SCE_CSS_IDENTIFIER);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case '}':
|
||||
if (lastState == SCE_CSS_DEFAULT || lastState == SCE_CSS_VALUE || lastState == SCE_CSS_IMPORTANT ||
|
||||
lastState == SCE_CSS_IDENTIFIER || lastState == SCE_CSS_IDENTIFIER2 || lastState == SCE_CSS_IDENTIFIER3)
|
||||
sc.SetState(SCE_CSS_DEFAULT);
|
||||
if (--nestingLevel < 0)
|
||||
nestingLevel = 0;
|
||||
switch (lastState) {
|
||||
case SCE_CSS_DEFAULT:
|
||||
case SCE_CSS_VALUE:
|
||||
case SCE_CSS_IMPORTANT:
|
||||
case SCE_CSS_IDENTIFIER:
|
||||
case SCE_CSS_IDENTIFIER2:
|
||||
case SCE_CSS_IDENTIFIER3:
|
||||
if (hasNesting)
|
||||
sc.SetState(nestingLevel > 0 ? SCE_CSS_IDENTIFIER : SCE_CSS_DEFAULT);
|
||||
else
|
||||
sc.SetState(SCE_CSS_DEFAULT);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case '(':
|
||||
if (lastState == SCE_CSS_PSEUDOCLASS)
|
||||
@ -167,14 +235,28 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo
|
||||
sc.SetState(SCE_CSS_TAG);
|
||||
break;
|
||||
case ':':
|
||||
if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_DEFAULT || lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID ||
|
||||
lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_EXTENDED_PSEUDOCLASS || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS ||
|
||||
lastState == SCE_CSS_PSEUDOELEMENT || lastState == SCE_CSS_EXTENDED_PSEUDOELEMENT)
|
||||
switch (lastState) {
|
||||
case SCE_CSS_TAG:
|
||||
case SCE_CSS_DEFAULT:
|
||||
case SCE_CSS_CLASS:
|
||||
case SCE_CSS_ID:
|
||||
case SCE_CSS_PSEUDOCLASS:
|
||||
case SCE_CSS_EXTENDED_PSEUDOCLASS:
|
||||
case SCE_CSS_UNKNOWN_PSEUDOCLASS:
|
||||
case SCE_CSS_PSEUDOELEMENT:
|
||||
case SCE_CSS_EXTENDED_PSEUDOELEMENT:
|
||||
sc.SetState(SCE_CSS_PSEUDOCLASS);
|
||||
else if (lastState == SCE_CSS_IDENTIFIER || lastState == SCE_CSS_IDENTIFIER2 ||
|
||||
lastState == SCE_CSS_IDENTIFIER3 || lastState == SCE_CSS_EXTENDED_IDENTIFIER ||
|
||||
lastState == SCE_CSS_UNKNOWN_IDENTIFIER)
|
||||
break;
|
||||
case SCE_CSS_IDENTIFIER:
|
||||
case SCE_CSS_IDENTIFIER2:
|
||||
case SCE_CSS_IDENTIFIER3:
|
||||
case SCE_CSS_EXTENDED_IDENTIFIER:
|
||||
case SCE_CSS_UNKNOWN_IDENTIFIER:
|
||||
case SCE_CSS_VARIABLE:
|
||||
sc.SetState(SCE_CSS_VALUE);
|
||||
lastStateVal = lastState;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case '.':
|
||||
if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_DEFAULT || lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID ||
|
||||
@ -193,10 +275,40 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo
|
||||
sc.SetState(SCE_CSS_DEFAULT);
|
||||
break;
|
||||
case ';':
|
||||
if (lastState == SCE_CSS_DIRECTIVE)
|
||||
sc.SetState(SCE_CSS_DEFAULT);
|
||||
else if (lastState == SCE_CSS_VALUE || lastState == SCE_CSS_IMPORTANT)
|
||||
sc.SetState(SCE_CSS_IDENTIFIER);
|
||||
switch (lastState) {
|
||||
case SCE_CSS_DIRECTIVE:
|
||||
if (hasNesting) {
|
||||
sc.SetState(nestingLevel > 0 ? SCE_CSS_IDENTIFIER : SCE_CSS_DEFAULT);
|
||||
} else {
|
||||
sc.SetState(SCE_CSS_DEFAULT);
|
||||
}
|
||||
break;
|
||||
case SCE_CSS_VALUE:
|
||||
case SCE_CSS_IMPORTANT:
|
||||
// data URLs can have semicolons; simplistically check for wrapping parentheses and move along
|
||||
if (insideParentheses) {
|
||||
sc.SetState(lastState);
|
||||
} else {
|
||||
if (lastStateVal == SCE_CSS_VARIABLE) {
|
||||
sc.SetState(SCE_CSS_DEFAULT);
|
||||
} else {
|
||||
sc.SetState(SCE_CSS_IDENTIFIER);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SCE_CSS_VARIABLE:
|
||||
if (lastStateVar == SCE_CSS_VALUE) {
|
||||
// data URLs can have semicolons; simplistically check for wrapping parentheses and move along
|
||||
if (insideParentheses) {
|
||||
sc.SetState(SCE_CSS_VALUE);
|
||||
} else {
|
||||
sc.SetState(SCE_CSS_IDENTIFIER);
|
||||
}
|
||||
} else {
|
||||
sc.SetState(SCE_CSS_DEFAULT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case '!':
|
||||
if (lastState == SCE_CSS_VALUE)
|
||||
@ -205,14 +317,75 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo
|
||||
}
|
||||
}
|
||||
|
||||
if (IsAWordChar(sc.ch)) {
|
||||
if (sc.state == SCE_CSS_DEFAULT)
|
||||
sc.SetState(SCE_CSS_TAG);
|
||||
if (sc.ch == '*' && sc.state == SCE_CSS_DEFAULT) {
|
||||
sc.SetState(SCE_CSS_TAG);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (sc.ch == '*' && sc.state == SCE_CSS_DEFAULT) {
|
||||
sc.SetState(SCE_CSS_TAG);
|
||||
// check for inside parentheses (whether part of an "operator" or not)
|
||||
if (sc.ch == '(')
|
||||
insideParentheses = true;
|
||||
else if (sc.ch == ')')
|
||||
insideParentheses = false;
|
||||
|
||||
// SCSS special modes
|
||||
if (isScssDocument) {
|
||||
// variable name
|
||||
if (sc.ch == '$') {
|
||||
switch (sc.state) {
|
||||
case SCE_CSS_DEFAULT:
|
||||
case SCE_CSS_VALUE:
|
||||
lastStateVar = sc.state;
|
||||
sc.SetState(SCE_CSS_VARIABLE);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (sc.state == SCE_CSS_VARIABLE) {
|
||||
if (IsAWordChar(sc.ch)) {
|
||||
// still looking at the variable name
|
||||
continue;
|
||||
}
|
||||
if (lastStateVar == SCE_CSS_VALUE) {
|
||||
// not looking at the variable name any more, and it was part of a value
|
||||
sc.SetState(SCE_CSS_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
// nested rule parent selector
|
||||
if (sc.ch == '&') {
|
||||
switch (sc.state) {
|
||||
case SCE_CSS_DEFAULT:
|
||||
case SCE_CSS_IDENTIFIER:
|
||||
sc.SetState(SCE_CSS_TAG);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// nesting rules that apply to SCSS and Less
|
||||
if (hasNesting) {
|
||||
// check for nested rule selector
|
||||
if (sc.state == SCE_CSS_IDENTIFIER && (IsAWordChar(sc.ch) || sc.ch == ':' || sc.ch == '.' || sc.ch == '#')) {
|
||||
// look ahead to see whether { comes before next ; and }
|
||||
unsigned int endPos = startPos + length;
|
||||
int ch;
|
||||
|
||||
for (unsigned int i = sc.currentPos; i < endPos; i++) {
|
||||
ch = styler.SafeGetCharAt(i);
|
||||
if (ch == ';' || ch == '}')
|
||||
break;
|
||||
if (ch == '{') {
|
||||
sc.SetState(SCE_CSS_DEFAULT);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (IsAWordChar(sc.ch)) {
|
||||
if (sc.state == SCE_CSS_DEFAULT)
|
||||
sc.SetState(SCE_CSS_TAG);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -287,6 +460,13 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo
|
||||
|
||||
if (sc.Match('/', '*')) {
|
||||
lastStateC = sc.state;
|
||||
comment_mode = eCommentBlock;
|
||||
sc.SetState(SCE_CSS_COMMENT);
|
||||
sc.Forward();
|
||||
} else if (hasSingleLineComments && sc.Match('/', '/') && !insideParentheses) {
|
||||
// note that we've had to treat ([...]// as the start of a URL not a comment, e.g. url(http://example.com), url(//example.com)
|
||||
lastStateC = sc.state;
|
||||
comment_mode = eCommentLine;
|
||||
sc.SetState(SCE_CSS_COMMENT);
|
||||
sc.Forward();
|
||||
} else if ((sc.state == SCE_CSS_VALUE || sc.state == SCE_CSS_ATTRIBUTE)
|
||||
|
@ -14,10 +14,6 @@
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable: 4786)
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
@ -164,7 +160,7 @@ public:
|
||||
LexerD(bool caseSensitive_) :
|
||||
caseSensitive(caseSensitive_) {
|
||||
}
|
||||
~LexerD() {
|
||||
virtual ~LexerD() {
|
||||
}
|
||||
void SCI_METHOD Release() {
|
||||
delete this;
|
||||
|
@ -261,28 +261,29 @@ static void classifyAttribHTML(unsigned int start, unsigned int end, WordList &k
|
||||
static int classifyTagHTML(unsigned int start, unsigned int end,
|
||||
WordList &keywords, Accessor &styler, bool &tagDontFold,
|
||||
bool caseSensitive, bool isXml, bool allowScripts) {
|
||||
char s[30 + 2];
|
||||
char withSpace[30 + 2] = " ";
|
||||
const char *s = withSpace + 1;
|
||||
// Copy after the '<'
|
||||
unsigned int i = 0;
|
||||
unsigned int i = 1;
|
||||
for (unsigned int cPos = start; cPos <= end && i < 30; cPos++) {
|
||||
char ch = styler[cPos];
|
||||
if ((ch != '<') && (ch != '/')) {
|
||||
s[i++] = caseSensitive ? ch : static_cast<char>(MakeLowerCase(ch));
|
||||
withSpace[i++] = caseSensitive ? ch : static_cast<char>(MakeLowerCase(ch));
|
||||
}
|
||||
}
|
||||
|
||||
//The following is only a quick hack, to see if this whole thing would work
|
||||
//we first need the tagname with a trailing space...
|
||||
s[i] = ' ';
|
||||
s[i+1] = '\0';
|
||||
withSpace[i] = ' ';
|
||||
withSpace[i+1] = '\0';
|
||||
|
||||
// if the current language is XML, I can fold any tag
|
||||
// if the current language is HTML, I don't want to fold certain tags (input, meta, etc.)
|
||||
//...to find it in the list of no-container-tags
|
||||
tagDontFold = (!isXml) && (NULL != strstr("meta link img area br hr input ", s));
|
||||
tagDontFold = (!isXml) && (NULL != strstr(" area base basefont br col command embed frame hr img input isindex keygen link meta param source track wbr ", withSpace));
|
||||
|
||||
//now we can remove the trailing space
|
||||
s[i] = '\0';
|
||||
withSpace[i] = '\0';
|
||||
|
||||
// No keywords -> all are known
|
||||
char chAttr = SCE_H_TAGUNKNOWN;
|
||||
@ -597,11 +598,12 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
char djangoBlockType[2];
|
||||
djangoBlockType[0] = '\0';
|
||||
|
||||
// If inside a tag, it may be a script tag, so reread from the start to ensure any language tags are seen
|
||||
// If inside a tag, it may be a script tag, so reread from the start of line starting tag to ensure any language tags are seen
|
||||
if (InTagState(state)) {
|
||||
while ((startPos > 0) && (InTagState(styler.StyleAt(startPos - 1)))) {
|
||||
startPos--;
|
||||
length++;
|
||||
int backLineStart = styler.LineStart(styler.GetLine(startPos-1));
|
||||
length += startPos - backLineStart;
|
||||
startPos = backLineStart;
|
||||
}
|
||||
state = SCE_H_DEFAULT;
|
||||
}
|
||||
@ -902,7 +904,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
(chNext == '?') &&
|
||||
!IsScriptCommentState(state)) {
|
||||
beforeLanguage = scriptLanguage;
|
||||
scriptLanguage = segIsScriptingIndicator(styler, i + 2, i + 6, eScriptPHP);
|
||||
scriptLanguage = segIsScriptingIndicator(styler, i + 2, i + 6, isXml ? eScriptXML : eScriptPHP);
|
||||
if (scriptLanguage != eScriptPHP && isStringState(state)) continue;
|
||||
styler.ColourTo(i - 1, StateToPrint);
|
||||
beforePreProc = state;
|
||||
@ -1583,6 +1585,10 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
state = SCE_HJ_COMMENTDOC;
|
||||
else
|
||||
state = SCE_HJ_COMMENT;
|
||||
if (chNext2 == '/') {
|
||||
// Eat the * so it isn't used for the end of the comment
|
||||
i++;
|
||||
}
|
||||
} else if (ch == '/' && chNext == '/') {
|
||||
styler.ColourTo(i - 1, StateToPrint);
|
||||
state = SCE_HJ_COMMENTLINE;
|
||||
@ -2128,7 +2134,8 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
|
||||
break;
|
||||
default:
|
||||
StateToPrint = statePrintForState(state, inScriptType);
|
||||
styler.ColourTo(lengthDoc - 1, StateToPrint);
|
||||
if (static_cast<int>(styler.GetStartSegment()) < lengthDoc)
|
||||
styler.ColourTo(lengthDoc - 1, StateToPrint);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -142,6 +142,7 @@ static int calculateFoldNsis(unsigned int start, unsigned int end, int foldlevel
|
||||
bIgnoreCase = true;
|
||||
|
||||
char s[20]; // The key word we are looking for has atmost 13 characters
|
||||
s[0] = '\0';
|
||||
for (unsigned int i = 0; i < end - start + 1 && i < 19; i++)
|
||||
{
|
||||
s[i] = static_cast<char>( styler[ start + i ] );
|
||||
|
@ -500,6 +500,10 @@ static void ColouriseBatchDoc(
|
||||
}
|
||||
}
|
||||
|
||||
#define DIFF_BUFFER_START_SIZE 16
|
||||
// Note that ColouriseDiffLine analyzes only the first DIFF_BUFFER_START_SIZE
|
||||
// characters of each line to classify the line.
|
||||
|
||||
static void ColouriseDiffLine(char *lineBuffer, int endLine, Accessor &styler) {
|
||||
// It is needed to remember the current state to recognize starting
|
||||
// comment lines before the first "diff " or "--- ". If a real
|
||||
@ -556,20 +560,27 @@ static void ColouriseDiffLine(char *lineBuffer, int endLine, Accessor &styler) {
|
||||
}
|
||||
|
||||
static void ColouriseDiffDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
|
||||
char lineBuffer[1024];
|
||||
char lineBuffer[DIFF_BUFFER_START_SIZE];
|
||||
styler.StartAt(startPos);
|
||||
styler.StartSegment(startPos);
|
||||
unsigned int linePos = 0;
|
||||
for (unsigned int i = startPos; i < startPos + length; i++) {
|
||||
lineBuffer[linePos++] = styler[i];
|
||||
if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) {
|
||||
// End of line (or of line buffer) met, colourise it
|
||||
lineBuffer[linePos] = '\0';
|
||||
if (AtEOL(styler, i)) {
|
||||
if (linePos < DIFF_BUFFER_START_SIZE) {
|
||||
lineBuffer[linePos] = 0;
|
||||
}
|
||||
ColouriseDiffLine(lineBuffer, i, styler);
|
||||
linePos = 0;
|
||||
} else if (linePos < DIFF_BUFFER_START_SIZE - 1) {
|
||||
lineBuffer[linePos++] = styler[i];
|
||||
} else if (linePos == DIFF_BUFFER_START_SIZE - 1) {
|
||||
lineBuffer[linePos++] = 0;
|
||||
}
|
||||
}
|
||||
if (linePos > 0) { // Last line does not have ending characters
|
||||
if (linePos < DIFF_BUFFER_START_SIZE) {
|
||||
lineBuffer[linePos] = 0;
|
||||
}
|
||||
ColouriseDiffLine(lineBuffer, startPos + length - 1, styler);
|
||||
}
|
||||
}
|
||||
@ -1015,7 +1026,7 @@ static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLin
|
||||
bool initialTab = (lineBuffer[0] == '\t');
|
||||
bool initialColonPart = false;
|
||||
enum { stInitial,
|
||||
stGccStart, stGccDigit, stGcc,
|
||||
stGccStart, stGccDigit, stGccColumn, stGcc,
|
||||
stMsStart, stMsDigit, stMsBracket, stMsVc, stMsDigitComma, stMsDotNet,
|
||||
stCtagsStart, stCtagsStartString, stCtagsStringDollar, stCtags,
|
||||
stUnrecognized
|
||||
@ -1047,12 +1058,18 @@ static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLin
|
||||
state = Is1To9(ch) ? stGccDigit : stUnrecognized;
|
||||
} else if (state == stGccDigit) { // <filename>:<line>
|
||||
if (ch == ':') {
|
||||
state = stGcc; // :9.*: is GCC
|
||||
state = stGccColumn; // :9.*: is GCC
|
||||
startValue = i + 1;
|
||||
break;
|
||||
} else if (!Is0To9(ch)) {
|
||||
state = stUnrecognized;
|
||||
}
|
||||
} else if (state == stGccColumn) { // <filename>:<line>:<column>
|
||||
if (!Is0To9(ch)) {
|
||||
state = stGcc;
|
||||
if (ch == ':')
|
||||
startValue = i + 1;
|
||||
break;
|
||||
}
|
||||
} else if (state == stMsStart) { // <filename>(
|
||||
state = Is0To9(ch) ? stMsDigit : stUnrecognized;
|
||||
} else if (state == stMsDigit) { // <filename>(<line>
|
||||
|
@ -54,6 +54,8 @@ are ignored as fold points
|
||||
4. Every other situation when class keyword doesn't actually start class
|
||||
declaration ("class procedure", "class function", "class of", "class var",
|
||||
"class property" and "class operator")
|
||||
5. Forward (disp)interface declarations ("type IMyInterface = interface;") are
|
||||
ignored as fold points
|
||||
|
||||
- Folding of code blocks inside preprocessor blocks is disabled (any comments
|
||||
inside them will be folded fine) because there is no guarantee that complete
|
||||
@ -483,6 +485,24 @@ static void ClassifyPascalWordFoldPoint(int &levelCurrent, int &lineFoldStateCur
|
||||
if (j >= startPos && styler.SafeGetCharAt(j) == '=') {
|
||||
ignoreKeyword = false;
|
||||
}
|
||||
if (!ignoreKeyword) {
|
||||
unsigned int k = SkipWhiteSpace(currentPos, endPos, styler);
|
||||
if (k < endPos && styler.SafeGetCharAt(k) == ';') {
|
||||
// Handle forward interface declarations ("type IMyInterface = interface;")
|
||||
ignoreKeyword = true;
|
||||
}
|
||||
}
|
||||
if (!ignoreKeyword) {
|
||||
levelCurrent++;
|
||||
}
|
||||
} else if (strcmp(s, "dispinterface") == 0) {
|
||||
// "dispinterface" keyword requires special handling...
|
||||
bool ignoreKeyword = false;
|
||||
unsigned int j = SkipWhiteSpace(currentPos, endPos, styler);
|
||||
if (j < endPos && styler.SafeGetCharAt(j) == ';') {
|
||||
// Handle forward dispinterface declarations ("type IMyInterface = dispinterface;")
|
||||
ignoreKeyword = true;
|
||||
}
|
||||
if (!ignoreKeyword) {
|
||||
levelCurrent++;
|
||||
}
|
||||
|
@ -14,10 +14,6 @@
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable: 4786)
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
@ -370,7 +366,7 @@ public:
|
||||
setSpecialVar(CharacterSet::setNone, "\"$;<>&`'+,./\\%:=~!?@[]"),
|
||||
setControlVar(CharacterSet::setNone, "ACDEFHILMNOPRSTVWX") {
|
||||
}
|
||||
~LexerPerl() {
|
||||
virtual ~LexerPerl() {
|
||||
}
|
||||
void SCI_METHOD Release() {
|
||||
delete this;
|
||||
@ -949,8 +945,7 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
|
||||
sc.SetState(SCE_PL_POD);
|
||||
} else
|
||||
fw = fw2;
|
||||
} else
|
||||
pod = SCE_PL_POD;
|
||||
}
|
||||
} else {
|
||||
if (pod == SCE_PL_POD_VERB // still part of current paragraph
|
||||
&& (styler.GetLineState(ln - 1) == SCE_PL_POD)) {
|
||||
|
@ -788,13 +788,13 @@ static void ColouriseRbDoc(unsigned int startPos, int length, int initStyle,
|
||||
state = SCE_RB_COMMENTLINE;
|
||||
} else if (ch == '=') {
|
||||
// =begin indicates the start of a comment (doc) block
|
||||
if (i == 0 || (isEOLChar(chPrev)
|
||||
if ((i == 0 || isEOLChar(chPrev))
|
||||
&& chNext == 'b'
|
||||
&& styler.SafeGetCharAt(i + 2) == 'e'
|
||||
&& styler.SafeGetCharAt(i + 3) == 'g'
|
||||
&& styler.SafeGetCharAt(i + 4) == 'i'
|
||||
&& styler.SafeGetCharAt(i + 5) == 'n'
|
||||
&& !isSafeWordcharOrHigh(styler.SafeGetCharAt(i + 6)))) {
|
||||
&& !isSafeWordcharOrHigh(styler.SafeGetCharAt(i + 6))) {
|
||||
styler.ColourTo(i - 1, state);
|
||||
state = SCE_RB_POD;
|
||||
} else {
|
||||
@ -1192,7 +1192,6 @@ static void ColouriseRbDoc(unsigned int startPos, int length, int initStyle,
|
||||
state = SCE_RB_DEFAULT;
|
||||
i--;
|
||||
chNext = ch;
|
||||
chNext2 = chNext;
|
||||
preferRE = false;
|
||||
} else if (HereDoc.Quoted) {
|
||||
if (ch == HereDoc.Quote) { // closing quote => end of delimiter
|
||||
@ -1349,7 +1348,6 @@ static void ColouriseRbDoc(unsigned int startPos, int length, int initStyle,
|
||||
}
|
||||
}
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
chNext2 = styler.SafeGetCharAt(i + 2);
|
||||
}
|
||||
}
|
||||
// Quotes of all kinds...
|
||||
|
@ -1,8 +1,10 @@
|
||||
//-*- coding: utf-8 -*-
|
||||
// Scintilla source code edit control
|
||||
/** @file LexSQL.cxx
|
||||
** Lexer for SQL, including PL/SQL and SQL*Plus.
|
||||
** Improved by Jérôme LAFORGE <jerome.laforge_AT_gmail_DOT_com> from 2010 to 2012.
|
||||
**/
|
||||
// Copyright 1998-2011 by Neil Hodgson <neilh@scintilla.org>
|
||||
// Copyright 1998-2012 by Neil Hodgson <neilh@scintilla.org>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -12,10 +14,6 @@
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable: 4786)
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
@ -32,6 +30,7 @@
|
||||
#include "CharacterSet.h"
|
||||
#include "LexerModule.h"
|
||||
#include "OptionSet.h"
|
||||
#include "SparseState.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
@ -67,10 +66,7 @@ static inline bool IsANumberChar(int ch) {
|
||||
class SQLStates {
|
||||
public :
|
||||
void Set(int lineNumber, unsigned short int sqlStatesLine) {
|
||||
if (!sqlStatement.size() == 0 || !sqlStatesLine == 0) {
|
||||
sqlStatement.resize(lineNumber + 1, 0);
|
||||
sqlStatement[lineNumber] = sqlStatesLine;
|
||||
}
|
||||
sqlStatement.Set(lineNumber, sqlStatesLine);
|
||||
}
|
||||
|
||||
unsigned short int IgnoreWhen (unsigned short int sqlStatesLine, bool enable) {
|
||||
@ -109,6 +105,33 @@ public :
|
||||
return sqlStatesLine;
|
||||
}
|
||||
|
||||
unsigned short int IntoMergeStatement (unsigned short int sqlStatesLine, bool enable) {
|
||||
if (enable)
|
||||
sqlStatesLine |= MASK_MERGE_STATEMENT;
|
||||
else
|
||||
sqlStatesLine &= ~MASK_MERGE_STATEMENT;
|
||||
|
||||
return sqlStatesLine;
|
||||
}
|
||||
|
||||
unsigned short int CaseMergeWithoutWhenFound (unsigned short int sqlStatesLine, bool found) {
|
||||
if (found)
|
||||
sqlStatesLine |= MASK_CASE_MERGE_WITHOUT_WHEN_FOUND;
|
||||
else
|
||||
sqlStatesLine &= ~MASK_CASE_MERGE_WITHOUT_WHEN_FOUND;
|
||||
|
||||
return sqlStatesLine;
|
||||
}
|
||||
|
||||
unsigned short int IntoSelectStatement (unsigned short int sqlStatesLine, bool found) {
|
||||
if (found)
|
||||
sqlStatesLine |= MASK_INTO_SELECT_STATEMENT;
|
||||
else
|
||||
sqlStatesLine &= ~MASK_INTO_SELECT_STATEMENT;
|
||||
|
||||
return sqlStatesLine;
|
||||
}
|
||||
|
||||
unsigned short int BeginCaseBlock (unsigned short int sqlStatesLine) {
|
||||
if ((sqlStatesLine & MASK_NESTED_CASES) < MASK_NESTED_CASES) {
|
||||
sqlStatesLine++;
|
||||
@ -139,28 +162,39 @@ public :
|
||||
return (sqlStatesLine & MASK_INTO_EXCEPTION) != 0;
|
||||
}
|
||||
|
||||
bool IsIntoSelectStatement (unsigned short int sqlStatesLine) {
|
||||
return (sqlStatesLine & MASK_INTO_SELECT_STATEMENT) != 0;
|
||||
}
|
||||
|
||||
bool IsCaseMergeWithoutWhenFound (unsigned short int sqlStatesLine) {
|
||||
return (sqlStatesLine & MASK_CASE_MERGE_WITHOUT_WHEN_FOUND) != 0;
|
||||
}
|
||||
|
||||
bool IsIntoDeclareBlock (unsigned short int sqlStatesLine) {
|
||||
return (sqlStatesLine & MASK_INTO_DECLARE) != 0;
|
||||
}
|
||||
|
||||
bool IsIntoMergeStatement (unsigned short int sqlStatesLine) {
|
||||
return (sqlStatesLine & MASK_MERGE_STATEMENT) != 0;
|
||||
}
|
||||
|
||||
unsigned short int ForLine(int lineNumber) {
|
||||
if ((lineNumber > 0) && (sqlStatement.size() > static_cast<size_t>(lineNumber))) {
|
||||
return sqlStatement[lineNumber];
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
return sqlStatement.ValueAt(lineNumber);
|
||||
}
|
||||
|
||||
SQLStates() {}
|
||||
|
||||
private :
|
||||
std::vector <unsigned short int> sqlStatement;
|
||||
SparseState <unsigned short int> sqlStatement;
|
||||
enum {
|
||||
MASK_NESTED_CASES = 0x01FF,
|
||||
MASK_INTO_SELECT_STATEMENT = 0x0200,
|
||||
MASK_CASE_MERGE_WITHOUT_WHEN_FOUND = 0x0400,
|
||||
MASK_MERGE_STATEMENT = 0x0800,
|
||||
MASK_INTO_DECLARE = 0x1000,
|
||||
MASK_INTO_EXCEPTION = 0x2000,
|
||||
MASK_INTO_CONDITION = 0x4000,
|
||||
MASK_IGNORE_WHEN = 0x8000,
|
||||
MASK_NESTED_CASES = 0x0FFF
|
||||
MASK_IGNORE_WHEN = 0x8000
|
||||
};
|
||||
};
|
||||
|
||||
@ -233,6 +267,8 @@ class LexerSQL : public ILexer {
|
||||
public :
|
||||
LexerSQL() {}
|
||||
|
||||
virtual ~LexerSQL() {}
|
||||
|
||||
int SCI_METHOD Version () const {
|
||||
return lvOriginal;
|
||||
}
|
||||
@ -297,6 +333,20 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
bool IsCommentLine (int line, LexAccessor &styler) {
|
||||
int pos = styler.LineStart(line);
|
||||
int eol_pos = styler.LineStart(line + 1) - 1;
|
||||
for (int i = pos; i + 1 < eol_pos; i++) {
|
||||
int style = styler.StyleAt(i);
|
||||
// MySQL needs -- comments to be followed by space or control char
|
||||
if (style == SCE_SQL_COMMENTLINE && styler.Match(i, "--"))
|
||||
return true;
|
||||
else if (!IsASpaceOrTab(styler[i]))
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
OptionsSQL options;
|
||||
OptionSetSQL osSQL;
|
||||
SQLStates sqlStates;
|
||||
@ -512,8 +562,14 @@ void SCI_METHOD LexerSQL::Fold(unsigned int startPos, int length, int initStyle,
|
||||
int visibleChars = 0;
|
||||
int lineCurrent = styler.GetLine(startPos);
|
||||
int levelCurrent = SC_FOLDLEVELBASE;
|
||||
|
||||
if (lineCurrent > 0) {
|
||||
levelCurrent = styler.LevelAt(lineCurrent - 1) >> 16;
|
||||
// Backtrack to previous line in case need to fix its fold status for folding block of single-line comments (i.e. '--').
|
||||
lineCurrent -= 1;
|
||||
startPos = styler.LineStart(lineCurrent);
|
||||
|
||||
if (lineCurrent > 0)
|
||||
levelCurrent = styler.LevelAt(lineCurrent - 1) >> 16;
|
||||
}
|
||||
int levelNext = levelCurrent;
|
||||
char chNext = styler[startPos];
|
||||
@ -544,6 +600,17 @@ void SCI_METHOD LexerSQL::Fold(unsigned int startPos, int length, int initStyle,
|
||||
endFound = false;
|
||||
isUnfoldingIgnored = false;
|
||||
}
|
||||
if ((!IsCommentStyle(style) && ch == ';')) {
|
||||
if (sqlStates.IsIntoMergeStatement(sqlStatesCurrentLine)) {
|
||||
// This is the end of "MERGE" statement.
|
||||
if (!sqlStates.IsCaseMergeWithoutWhenFound(sqlStatesCurrentLine))
|
||||
levelNext--;
|
||||
sqlStatesCurrentLine = sqlStates.IntoMergeStatement(sqlStatesCurrentLine, false);
|
||||
levelNext--;
|
||||
}
|
||||
if (sqlStates.IsIntoSelectStatement(sqlStatesCurrentLine))
|
||||
sqlStatesCurrentLine = sqlStates.IntoSelectStatement(sqlStatesCurrentLine, false);
|
||||
}
|
||||
if (options.foldComment && IsStreamCommentStyle(style)) {
|
||||
if (!IsStreamCommentStyle(stylePrev)) {
|
||||
levelNext++;
|
||||
@ -564,6 +631,13 @@ void SCI_METHOD LexerSQL::Fold(unsigned int startPos, int length, int initStyle,
|
||||
}
|
||||
}
|
||||
}
|
||||
// Fold block of single-line comments (i.e. '--').
|
||||
if (options.foldComment && atEOL && IsCommentLine(lineCurrent, styler)) {
|
||||
if (!IsCommentLine(lineCurrent - 1, styler) && IsCommentLine(lineCurrent + 1, styler))
|
||||
levelNext++;
|
||||
else if (IsCommentLine(lineCurrent - 1, styler) && !IsCommentLine(lineCurrent + 1, styler))
|
||||
levelNext--;
|
||||
}
|
||||
if (style == SCE_SQL_OPERATOR) {
|
||||
if (ch == '(') {
|
||||
if (levelCurrent > levelNext)
|
||||
@ -593,7 +667,10 @@ void SCI_METHOD LexerSQL::Fold(unsigned int startPos, int length, int initStyle,
|
||||
s[j] = '\0';
|
||||
}
|
||||
|
||||
if (strcmp(s, "if") == 0) {
|
||||
if (!options.foldOnlyBegin &&
|
||||
strcmp(s, "select") == 0) {
|
||||
sqlStatesCurrentLine = sqlStates.IntoSelectStatement(sqlStatesCurrentLine, true);
|
||||
} else if (strcmp(s, "if") == 0) {
|
||||
if (endFound) {
|
||||
endFound = false;
|
||||
if (options.foldOnlyBegin && !isUnfoldingIgnored) {
|
||||
@ -638,23 +715,20 @@ void SCI_METHOD LexerSQL::Fold(unsigned int startPos, int length, int initStyle,
|
||||
}
|
||||
if ((!options.foldOnlyBegin) && strcmp(s, "case") == 0) {
|
||||
sqlStatesCurrentLine = sqlStates.EndCaseBlock(sqlStatesCurrentLine);
|
||||
levelNext--; //again for the "end case;" and block when
|
||||
if (!sqlStates.IsCaseMergeWithoutWhenFound(sqlStatesCurrentLine))
|
||||
levelNext--; //again for the "end case;" and block when
|
||||
}
|
||||
} else if (!options.foldOnlyBegin) {
|
||||
if (strcmp(s, "case") == 0) {
|
||||
if (strcmp(s, "case") == 0)
|
||||
sqlStatesCurrentLine = sqlStates.BeginCaseBlock(sqlStatesCurrentLine);
|
||||
|
||||
//for case block increment 2 times
|
||||
if (!statementFound)
|
||||
levelNext++;
|
||||
}
|
||||
|
||||
if (levelCurrent > levelNext) {
|
||||
if (levelCurrent > levelNext)
|
||||
levelCurrent = levelNext;
|
||||
}
|
||||
|
||||
if (!statementFound)
|
||||
levelNext++;
|
||||
|
||||
sqlStatesCurrentLine = sqlStates.CaseMergeWithoutWhenFound(sqlStatesCurrentLine, true);
|
||||
statementFound = true;
|
||||
} else if (levelCurrent > levelNext) {
|
||||
// doesn't include this line into the folding block
|
||||
@ -674,9 +748,13 @@ void SCI_METHOD LexerSQL::Fold(unsigned int startPos, int length, int initStyle,
|
||||
options.foldAtElse && !statementFound) && strcmp(s, "else") == 0) {
|
||||
// prevent also ELSE is on the same line (eg. "ELSE ... END IF;")
|
||||
statementFound = true;
|
||||
// we are in same case "} ELSE {" in C language
|
||||
levelCurrent--;
|
||||
|
||||
if (sqlStates.IsIntoCaseBlock(sqlStatesCurrentLine) && sqlStates.IsCaseMergeWithoutWhenFound(sqlStatesCurrentLine)) {
|
||||
sqlStatesCurrentLine = sqlStates.CaseMergeWithoutWhenFound(sqlStatesCurrentLine, false);
|
||||
levelNext++;
|
||||
} else {
|
||||
// we are in same case "} ELSE {" in C language
|
||||
levelCurrent--;
|
||||
}
|
||||
} else if (strcmp(s, "begin") == 0) {
|
||||
levelNext++;
|
||||
sqlStatesCurrentLine = sqlStates.IntoDeclareBlock(sqlStatesCurrentLine, false);
|
||||
@ -687,6 +765,8 @@ void SCI_METHOD LexerSQL::Fold(unsigned int startPos, int length, int initStyle,
|
||||
(strcmp(s, "endif") == 0)) {
|
||||
endFound = true;
|
||||
levelNext--;
|
||||
if (sqlStates.IsIntoSelectStatement(sqlStatesCurrentLine) && !sqlStates.IsCaseMergeWithoutWhenFound(sqlStatesCurrentLine))
|
||||
levelNext--;
|
||||
if (levelNext < SC_FOLDLEVELBASE) {
|
||||
levelNext = SC_FOLDLEVELBASE;
|
||||
isUnfoldingIgnored = true;
|
||||
@ -694,14 +774,21 @@ void SCI_METHOD LexerSQL::Fold(unsigned int startPos, int length, int initStyle,
|
||||
} else if ((!options.foldOnlyBegin) &&
|
||||
strcmp(s, "when") == 0 &&
|
||||
!sqlStates.IsIgnoreWhen(sqlStatesCurrentLine) &&
|
||||
!sqlStates.IsIntoExceptionBlock(sqlStatesCurrentLine) &&
|
||||
sqlStates.IsIntoCaseBlock(sqlStatesCurrentLine)) {
|
||||
!sqlStates.IsIntoExceptionBlock(sqlStatesCurrentLine) && (
|
||||
sqlStates.IsIntoCaseBlock(sqlStatesCurrentLine) ||
|
||||
sqlStates.IsIntoMergeStatement(sqlStatesCurrentLine)
|
||||
)
|
||||
) {
|
||||
sqlStatesCurrentLine = sqlStates.IntoCondition(sqlStatesCurrentLine, true);
|
||||
|
||||
// Don't foldind when CASE and WHEN are on the same line (with flag statementFound) (eg. "CASE selector WHEN expression1 THEN sequence_of_statements1;\n")
|
||||
// and same way for MERGE statement.
|
||||
if (!statementFound) {
|
||||
levelCurrent--;
|
||||
levelNext--;
|
||||
if (!sqlStates.IsCaseMergeWithoutWhenFound(sqlStatesCurrentLine)) {
|
||||
levelCurrent--;
|
||||
levelNext--;
|
||||
}
|
||||
sqlStatesCurrentLine = sqlStates.CaseMergeWithoutWhenFound(sqlStatesCurrentLine, false);
|
||||
}
|
||||
} else if ((!options.foldOnlyBegin) && strcmp(s, "exit") == 0) {
|
||||
sqlStatesCurrentLine = sqlStates.IgnoreWhen(sqlStatesCurrentLine, true);
|
||||
@ -713,6 +800,12 @@ void SCI_METHOD LexerSQL::Fold(unsigned int startPos, int length, int initStyle,
|
||||
strcmp(s, "procedure") == 0 ||
|
||||
strcmp(s, "package") == 0)) {
|
||||
sqlStatesCurrentLine = sqlStates.IntoDeclareBlock(sqlStatesCurrentLine, true);
|
||||
} else if ((!options.foldOnlyBegin) &&
|
||||
strcmp(s, "merge") == 0) {
|
||||
sqlStatesCurrentLine = sqlStates.IntoMergeStatement(sqlStatesCurrentLine, true);
|
||||
sqlStatesCurrentLine = sqlStates.CaseMergeWithoutWhenFound(sqlStatesCurrentLine, true);
|
||||
levelNext++;
|
||||
statementFound = true;
|
||||
}
|
||||
}
|
||||
if (atEOL) {
|
||||
|
@ -127,9 +127,6 @@ static void ColouriseVHDLDoc(
|
||||
sc.SetState(SCE_VHDL_NUMBER);
|
||||
} else if (IsAWordStart(sc.ch)) {
|
||||
sc.SetState(SCE_VHDL_IDENTIFIER);
|
||||
} else if (sc.Match('-', '-')) {
|
||||
sc.SetState(SCE_VHDL_COMMENT);
|
||||
sc.Forward();
|
||||
} else if (sc.Match('-', '-')) {
|
||||
if (sc.Match("--!")) // Nice to have a different comment style
|
||||
sc.SetState(SCE_VHDL_COMMENTLINEBANG);
|
||||
|
@ -146,7 +146,7 @@ public:
|
||||
} else {
|
||||
if (chAttr != chWhile)
|
||||
chFlags = 0;
|
||||
chAttr |= chFlags;
|
||||
chAttr = static_cast<char>(chAttr | chFlags);
|
||||
for (unsigned int i = startSeg; i <= pos; i++) {
|
||||
assert((startPosStyling + validLen) < Length());
|
||||
styleBuf[validLen++] = static_cast<char>(chAttr);
|
||||
|
@ -12,8 +12,8 @@
|
||||
#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)
|
||||
// Visual C++ doesn't like unreachable code in its own headers.
|
||||
#pragma warning(disable: 4018 4100 4245 4511 4512 4663 4702)
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
|
@ -27,11 +27,12 @@ diff -Naur scintilla_orig/gtk/scintilla-marshal.c scintilla/gtk/scintilla-marsha
|
||||
gpointer marshal_data)
|
||||
{
|
||||
typedef void (*GMarshalFunc_VOID__INT_POINTER) (gpointer data1,
|
||||
diff -Naur scintilla_orig/src/Catalogue.cxx scintilla/src/Catalogue.cxx
|
||||
--- scintilla_orig/src/Catalogue.cxx 2011-03-17 23:41:24.000000000 +0100
|
||||
+++ scintilla/src/Catalogue.cxx 2011-04-03 17:43:45.000000000 +0200
|
||||
@@ -81,100 +81,42 @@
|
||||
|
||||
diff --git b/scintilla/src/Catalogue.cxx a/scintilla/src/Catalogue.cxx
|
||||
index 2f75247..a34f834 100644
|
||||
+++ scintilla/src/Catalogue.cxx
|
||||
--- scintilla/src/Catalogue.cxx
|
||||
@@ -81,108 +81,44 @@ int Scintilla_LinkLexers() {
|
||||
|
||||
//++Autogenerated -- run src/LexGen.py to regenerate
|
||||
//**\(\tLINK_LEXER(\*);\n\)
|
||||
- LINK_LEXER(lmA68k);
|
||||
@ -43,6 +44,7 @@ diff -Naur scintilla_orig/src/Catalogue.cxx scintilla/src/Catalogue.cxx
|
||||
- LINK_LEXER(lmASY);
|
||||
- LINK_LEXER(lmAU3);
|
||||
- LINK_LEXER(lmAVE);
|
||||
- LINK_LEXER(lmAVS);
|
||||
- LINK_LEXER(lmBaan);
|
||||
LINK_LEXER(lmBash);
|
||||
- LINK_LEXER(lmBatch);
|
||||
@ -53,6 +55,7 @@ diff -Naur scintilla_orig/src/Catalogue.cxx scintilla/src/Catalogue.cxx
|
||||
- LINK_LEXER(lmClwNoCase);
|
||||
LINK_LEXER(lmCmake);
|
||||
LINK_LEXER(lmCOBOL);
|
||||
- LINK_LEXER(lmCoffeeScript);
|
||||
- LINK_LEXER(lmConf);
|
||||
LINK_LEXER(lmCPP);
|
||||
- LINK_LEXER(lmCPPNoCase);
|
||||
@ -60,6 +63,7 @@ diff -Naur scintilla_orig/src/Catalogue.cxx scintilla/src/Catalogue.cxx
|
||||
LINK_LEXER(lmCss);
|
||||
LINK_LEXER(lmD);
|
||||
LINK_LEXER(lmDiff);
|
||||
- LINK_LEXER(lmECL);
|
||||
- LINK_LEXER(lmEiffel);
|
||||
- LINK_LEXER(lmEiffelkw);
|
||||
LINK_LEXER(lmErlang);
|
||||
@ -97,6 +101,7 @@ diff -Naur scintilla_orig/src/Catalogue.cxx scintilla/src/Catalogue.cxx
|
||||
LINK_LEXER(lmNull);
|
||||
LINK_LEXER(lmOctave);
|
||||
- LINK_LEXER(lmOpal);
|
||||
- LINK_LEXER(lmOScript);
|
||||
LINK_LEXER(lmPascal);
|
||||
- LINK_LEXER(lmPB);
|
||||
LINK_LEXER(lmPerl);
|
||||
@ -125,10 +130,14 @@ diff -Naur scintilla_orig/src/Catalogue.cxx scintilla/src/Catalogue.cxx
|
||||
- LINK_LEXER(lmTADS3);
|
||||
- LINK_LEXER(lmTAL);
|
||||
LINK_LEXER(lmTCL);
|
||||
- LINK_LEXER(lmTCMD);
|
||||
- LINK_LEXER(lmTeX);
|
||||
LINK_LEXER(lmTxt2tags);
|
||||
- LINK_LEXER(lmVB);
|
||||
- LINK_LEXER(lmVBScript);
|
||||
LINK_LEXER(lmVerilog);
|
||||
LINK_LEXER(lmVHDL);
|
||||
- LINK_LEXER(lmVisualProlog);
|
||||
LINK_LEXER(lmXML);
|
||||
LINK_LEXER(lmYAML);
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
|
||||
#include "CharacterSet.h"
|
||||
#include "AutoComplete.h"
|
||||
#include "Scintilla.h"
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
using namespace Scintilla;
|
||||
@ -30,7 +31,8 @@ AutoComplete::AutoComplete() :
|
||||
startLen(0),
|
||||
cancelAtStartPos(true),
|
||||
autoHide(true),
|
||||
dropRestOfWord(false) {
|
||||
dropRestOfWord(false),
|
||||
ignoreCaseBehaviour(SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE) {
|
||||
lb = ListBox::Allocate();
|
||||
stopChars[0] = '\0';
|
||||
fillUpChars[0] = '\0';
|
||||
@ -50,11 +52,11 @@ bool AutoComplete::Active() const {
|
||||
|
||||
void AutoComplete::Start(Window &parent, int ctrlID,
|
||||
int position, Point location, int startLen_,
|
||||
int lineHeight, bool unicodeMode) {
|
||||
int lineHeight, bool unicodeMode, int technology) {
|
||||
if (active) {
|
||||
Cancel();
|
||||
}
|
||||
lb->Create(parent, ctrlID, location, lineHeight, unicodeMode);
|
||||
lb->Create(parent, ctrlID, location, lineHeight, unicodeMode, technology);
|
||||
lb->Clear();
|
||||
active = true;
|
||||
startLen = startLen_;
|
||||
@ -153,7 +155,8 @@ void AutoComplete::Select(const char *word) {
|
||||
--pivot;
|
||||
}
|
||||
location = pivot;
|
||||
if (ignoreCase) {
|
||||
if (ignoreCase
|
||||
&& ignoreCaseBehaviour == SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE) {
|
||||
// Check for exact-case match
|
||||
for (; pivot <= end; pivot++) {
|
||||
lb->GetValue(pivot, item, maxItemLen);
|
||||
|
@ -31,6 +31,7 @@ public:
|
||||
bool cancelAtStartPos;
|
||||
bool autoHide;
|
||||
bool dropRestOfWord;
|
||||
unsigned int ignoreCaseBehaviour;
|
||||
|
||||
AutoComplete();
|
||||
~AutoComplete();
|
||||
@ -40,7 +41,7 @@ public:
|
||||
|
||||
/// Display the auto completion list positioned to be near a character position
|
||||
void Start(Window &parent, int ctrlID, int position, Point location,
|
||||
int startLen_, int lineHeight, bool unicodeMode);
|
||||
int startLen_, int lineHeight, bool unicodeMode, int technology);
|
||||
|
||||
/// The stop chars are characters which, when typed, cause the auto completion list to disappear
|
||||
void SetStopChars(const char *stopChars_);
|
||||
|
@ -33,19 +33,20 @@ CallTip::CallTip() {
|
||||
startHighlight = 0;
|
||||
endHighlight = 0;
|
||||
tabSize = 0;
|
||||
above = false;
|
||||
useStyleCallTip = false; // for backwards compatibility
|
||||
|
||||
#ifdef __APPLE__
|
||||
// proper apple colours for the default
|
||||
colourBG.desired = ColourDesired(0xff, 0xff, 0xc6);
|
||||
colourUnSel.desired = ColourDesired(0, 0, 0);
|
||||
colourBG = ColourDesired(0xff, 0xff, 0xc6);
|
||||
colourUnSel = ColourDesired(0, 0, 0);
|
||||
#else
|
||||
colourBG.desired = ColourDesired(0xff, 0xff, 0xff);
|
||||
colourUnSel.desired = ColourDesired(0x80, 0x80, 0x80);
|
||||
colourBG = ColourDesired(0xff, 0xff, 0xff);
|
||||
colourUnSel = ColourDesired(0x80, 0x80, 0x80);
|
||||
#endif
|
||||
colourSel.desired = ColourDesired(0, 0, 0x80);
|
||||
colourShade.desired = ColourDesired(0, 0, 0);
|
||||
colourLight.desired = ColourDesired(0xc0, 0xc0, 0xc0);
|
||||
colourSel = ColourDesired(0, 0, 0x80);
|
||||
colourShade = ColourDesired(0, 0, 0);
|
||||
colourLight = ColourDesired(0xc0, 0xc0, 0xc0);
|
||||
codePage = 0;
|
||||
clickPlace = 0;
|
||||
}
|
||||
@ -57,14 +58,6 @@ CallTip::~CallTip() {
|
||||
val = 0;
|
||||
}
|
||||
|
||||
void CallTip::RefreshColourPalette(Palette &pal, bool want) {
|
||||
pal.WantFind(colourBG, want);
|
||||
pal.WantFind(colourUnSel, want);
|
||||
pal.WantFind(colourSel, want);
|
||||
pal.WantFind(colourShade, want);
|
||||
pal.WantFind(colourLight, want);
|
||||
}
|
||||
|
||||
// Although this test includes 0, we should never see a \0 character.
|
||||
static bool IsArrowCharacter(char ch) {
|
||||
return (ch == 0) || (ch == '\001') || (ch == '\002');
|
||||
@ -120,10 +113,10 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s,
|
||||
const int halfWidth = widthArrow / 2 - 3;
|
||||
const int centreX = rcClient.left + widthArrow / 2 - 1;
|
||||
const int centreY = (rcClient.top + rcClient.bottom) / 2;
|
||||
surface->FillRectangle(rcClient, colourBG.allocated);
|
||||
surface->FillRectangle(rcClient, colourBG);
|
||||
PRectangle rcClientInner(rcClient.left + 1, rcClient.top + 1,
|
||||
rcClient.right - 2, rcClient.bottom - 1);
|
||||
surface->FillRectangle(rcClientInner, colourUnSel.allocated);
|
||||
surface->FillRectangle(rcClientInner, colourUnSel);
|
||||
|
||||
if (upArrow) { // Up arrow
|
||||
Point pts[] = {
|
||||
@ -132,7 +125,7 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s,
|
||||
Point(centreX, centreY - halfWidth + halfWidth / 2),
|
||||
};
|
||||
surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
|
||||
colourBG.allocated, colourBG.allocated);
|
||||
colourBG, colourBG);
|
||||
} else { // Down arrow
|
||||
Point pts[] = {
|
||||
Point(centreX - halfWidth, centreY - halfWidth / 2),
|
||||
@ -140,7 +133,7 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s,
|
||||
Point(centreX, centreY + halfWidth - halfWidth / 2),
|
||||
};
|
||||
surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
|
||||
colourBG.allocated, colourBG.allocated);
|
||||
colourBG, colourBG);
|
||||
}
|
||||
}
|
||||
xEnd = rcClient.right;
|
||||
@ -159,7 +152,7 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s,
|
||||
rcClient.right = xEnd;
|
||||
surface->DrawTextTransparent(rcClient, font, ytext,
|
||||
s+startSeg, endSeg - startSeg,
|
||||
highlight ? colourSel.allocated : colourUnSel.allocated);
|
||||
highlight ? colourSel : colourUnSel);
|
||||
}
|
||||
}
|
||||
x = xEnd;
|
||||
@ -227,7 +220,7 @@ void CallTip::PaintCT(Surface *surfaceWindow) {
|
||||
rcClientPos.bottom - rcClientPos.top);
|
||||
PRectangle rcClient(1, 1, rcClientSize.right - 1, rcClientSize.bottom - 1);
|
||||
|
||||
surfaceWindow->FillRectangle(rcClient, colourBG.allocated);
|
||||
surfaceWindow->FillRectangle(rcClient, colourBG);
|
||||
|
||||
offsetMain = insetX; // initial alignment assuming no arrows
|
||||
PaintContents(surfaceWindow, true);
|
||||
@ -236,10 +229,10 @@ void CallTip::PaintCT(Surface *surfaceWindow) {
|
||||
// OSX doesn't put borders on "help tags"
|
||||
// Draw a raised border around the edges of the window
|
||||
surfaceWindow->MoveTo(0, rcClientSize.bottom - 1);
|
||||
surfaceWindow->PenColour(colourShade.allocated);
|
||||
surfaceWindow->PenColour(colourShade);
|
||||
surfaceWindow->LineTo(rcClientSize.right - 1, rcClientSize.bottom - 1);
|
||||
surfaceWindow->LineTo(rcClientSize.right - 1, 0);
|
||||
surfaceWindow->PenColour(colourLight.allocated);
|
||||
surfaceWindow->PenColour(colourLight);
|
||||
surfaceWindow->LineTo(0, 0);
|
||||
surfaceWindow->LineTo(0, rcClientSize.bottom - 1);
|
||||
#endif
|
||||
@ -253,16 +246,17 @@ void CallTip::MouseClick(Point pt) {
|
||||
clickPlace = 2;
|
||||
}
|
||||
|
||||
PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn,
|
||||
PRectangle CallTip::CallTipStart(int pos, Point pt, int textHeight, const char *defn,
|
||||
const char *faceName, int size,
|
||||
int codePage_, int characterSet, Window &wParent) {
|
||||
int codePage_, int characterSet,
|
||||
int technology, Window &wParent) {
|
||||
clickPlace = 0;
|
||||
delete []val;
|
||||
val = 0;
|
||||
val = new char[strlen(defn) + 1];
|
||||
strcpy(val, defn);
|
||||
codePage = codePage_;
|
||||
Surface *surfaceMeasure = Surface::Allocate();
|
||||
Surface *surfaceMeasure = Surface::Allocate(technology);
|
||||
if (!surfaceMeasure)
|
||||
return PRectangle();
|
||||
surfaceMeasure->Init(wParent.GetID());
|
||||
@ -273,7 +267,8 @@ PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn,
|
||||
inCallTipMode = true;
|
||||
posStartCallTip = pos;
|
||||
int deviceHeight = surfaceMeasure->DeviceHeightFont(size);
|
||||
font.Create(faceName, characterSet, deviceHeight, false, false);
|
||||
FontParameters fp(faceName, deviceHeight / SC_FONT_SIZE_MULTIPLIER, SC_WEIGHT_NORMAL, false, 0, technology, characterSet);
|
||||
font.Create(fp);
|
||||
// Look for multiple lines in the text
|
||||
// Only support \n here - simply means container must avoid \r!
|
||||
int numLines = 1;
|
||||
@ -294,7 +289,11 @@ PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn,
|
||||
// the tip text, else to the tip text left edge.
|
||||
int height = lineHeight * numLines - surfaceMeasure->InternalLeading(font) + 2 + 2;
|
||||
delete surfaceMeasure;
|
||||
return PRectangle(pt.x - offsetMain, pt.y + 1, pt.x + width - offsetMain, pt.y + 1 + height);
|
||||
if (above) {
|
||||
return PRectangle(pt.x - offsetMain, pt.y - 1 - height, pt.x + width - offsetMain, pt.y - 1);
|
||||
} else {
|
||||
return PRectangle(pt.x - offsetMain, pt.y + 1 + textHeight, pt.x + width - offsetMain, pt.y + 1 + textHeight + height);
|
||||
}
|
||||
}
|
||||
|
||||
void CallTip::CallTipCancel() {
|
||||
@ -322,9 +321,15 @@ void CallTip::SetTabSize(int tabSz) {
|
||||
useStyleCallTip = true;
|
||||
}
|
||||
|
||||
// Set the calltip position, below the text by default or if above is false
|
||||
// else above the text.
|
||||
void CallTip::SetPosition(bool aboveText) {
|
||||
above = aboveText;
|
||||
}
|
||||
|
||||
// It might be better to have two access functions for this and to use
|
||||
// them for all settings of colours.
|
||||
void CallTip::SetForeBack(const ColourPair &fore, const ColourPair &back) {
|
||||
void CallTip::SetForeBack(const ColourDesired &fore, const ColourDesired &back) {
|
||||
colourBG = back;
|
||||
colourUnSel = fore;
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ class CallTip {
|
||||
int offsetMain; // The alignment point of the call tip
|
||||
int tabSize; // Tab size in pixels, <=0 no TAB expand
|
||||
bool useStyleCallTip; // if true, STYLE_CALLTIP should be used
|
||||
bool above; // if true, display calltip above text
|
||||
|
||||
// Private so CallTip objects can not be copied
|
||||
CallTip(const CallTip &);
|
||||
@ -41,28 +42,25 @@ public:
|
||||
Window wDraw;
|
||||
bool inCallTipMode;
|
||||
int posStartCallTip;
|
||||
ColourPair colourBG;
|
||||
ColourPair colourUnSel;
|
||||
ColourPair colourSel;
|
||||
ColourPair colourShade;
|
||||
ColourPair colourLight;
|
||||
ColourDesired colourBG;
|
||||
ColourDesired colourUnSel;
|
||||
ColourDesired colourSel;
|
||||
ColourDesired colourShade;
|
||||
ColourDesired colourLight;
|
||||
int codePage;
|
||||
int clickPlace;
|
||||
|
||||
CallTip();
|
||||
~CallTip();
|
||||
|
||||
/// Claim or accept palette entries for the colours required to paint a calltip.
|
||||
void RefreshColourPalette(Palette &pal, bool want);
|
||||
|
||||
void PaintCT(Surface *surfaceWindow);
|
||||
|
||||
void MouseClick(Point pt);
|
||||
|
||||
/// Setup the calltip and return a rectangle of the area required.
|
||||
PRectangle CallTipStart(int pos, Point pt, const char *defn,
|
||||
PRectangle CallTipStart(int pos, Point pt, int textHeight, const char *defn,
|
||||
const char *faceName, int size, int codePage_,
|
||||
int characterSet, Window &wParent);
|
||||
int characterSet, int technology, Window &wParent);
|
||||
|
||||
void CallTipCancel();
|
||||
|
||||
@ -73,11 +71,14 @@ public:
|
||||
/// Set the tab size in pixels for the call tip. 0 or -ve means no tab expand.
|
||||
void SetTabSize(int tabSz);
|
||||
|
||||
/// Set calltip position.
|
||||
void SetPosition(bool aboveText);
|
||||
|
||||
/// Used to determine which STYLE_xxxx to use for call tip information
|
||||
bool UseStyleCallTip() const { return useStyleCallTip;}
|
||||
|
||||
// Modify foreground and background colours
|
||||
void SetForeBack(const ColourPair &fore, const ColourPair &back);
|
||||
void SetForeBack(const ColourDesired &fore, const ColourDesired &back);
|
||||
};
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
|
@ -375,6 +375,14 @@ const char *CellBuffer::BufferPointer() {
|
||||
return substance.BufferPointer();
|
||||
}
|
||||
|
||||
const char *CellBuffer::RangePointer(int position, int rangeLength) {
|
||||
return substance.RangePointer(position, rangeLength);
|
||||
}
|
||||
|
||||
int CellBuffer::GapPosition() const {
|
||||
return substance.GapPosition();
|
||||
}
|
||||
|
||||
// The char* returned is to an allocation owned by the undo history
|
||||
const char *CellBuffer::InsertString(int position, const char *s, int insertLength, bool &startSequence) {
|
||||
char *data = 0;
|
||||
|
@ -157,6 +157,8 @@ public:
|
||||
char StyleAt(int position) const;
|
||||
void GetStyleRange(unsigned char *buffer, int position, int lengthRetrieve) const;
|
||||
const char *BufferPointer();
|
||||
const char *RangePointer(int position, int rangeLength);
|
||||
int GapPosition() const;
|
||||
|
||||
int Length() const;
|
||||
void Allocate(int newSize);
|
||||
|
@ -28,7 +28,7 @@ Decoration::~Decoration() {
|
||||
}
|
||||
|
||||
bool Decoration::Empty() {
|
||||
return rs.Runs() == 1;
|
||||
return (rs.Runs() == 1) && (rs.AllSameAs(0));
|
||||
}
|
||||
|
||||
DecorationList::DecorationList() : currentIndicator(0), currentValue(1), current(0),
|
||||
@ -148,7 +148,7 @@ void DecorationList::DeleteRange(int position, int deleteLength) {
|
||||
void DecorationList::DeleteAnyEmpty() {
|
||||
Decoration *deco = root;
|
||||
while (deco) {
|
||||
if (deco->Empty()) {
|
||||
if ((lengthDocument == 0) || deco->Empty()) {
|
||||
Delete(deco->indicator);
|
||||
deco = root;
|
||||
} else {
|
||||
|
@ -57,7 +57,6 @@ static inline bool IsUpperCase(char ch) {
|
||||
}
|
||||
|
||||
void LexInterface::Colourise(int start, int end) {
|
||||
ElapsedTime et;
|
||||
if (pdoc && instance && !performingStyle) {
|
||||
// Protect against reentrance, which may occur, for example, when
|
||||
// fold points are discovered while performing styling and the folding
|
||||
@ -113,6 +112,8 @@ Document::Document() {
|
||||
matchesValid = false;
|
||||
regex = 0;
|
||||
|
||||
UTF8BytesOfLeadInitialise();
|
||||
|
||||
perLineData[ldMarkers] = new LineMarkers();
|
||||
perLineData[ldLevels] = new LineLevels();
|
||||
perLineData[ldState] = new LineState();
|
||||
@ -169,7 +170,7 @@ int Document::AddRef() {
|
||||
|
||||
// Decrease reference count and return its previous value.
|
||||
// Delete the document if reference count reaches zero.
|
||||
int Document::Release() {
|
||||
int SCI_METHOD Document::Release() {
|
||||
int curRefCount = --refCount;
|
||||
if (curRefCount == 0)
|
||||
delete this;
|
||||
@ -185,6 +186,10 @@ int Document::GetMark(int line) {
|
||||
return static_cast<LineMarkers *>(perLineData[ldMarkers])->MarkValue(line);
|
||||
}
|
||||
|
||||
int Document::MarkerNext(int lineStart, int mask) const {
|
||||
return static_cast<LineMarkers *>(perLineData[ldMarkers])->MarkerNext(lineStart, mask);
|
||||
}
|
||||
|
||||
int Document::AddMark(int line, int markerNum) {
|
||||
if (line >= 0 && line <= LinesTotal()) {
|
||||
int prev = static_cast<LineMarkers *>(perLineData[ldMarkers])->
|
||||
@ -446,19 +451,13 @@ int Document::LenChar(int pos) {
|
||||
} else if (IsCrLf(pos)) {
|
||||
return 2;
|
||||
} else if (SC_CP_UTF8 == dbcsCodePage) {
|
||||
unsigned char ch = static_cast<unsigned char>(cb.CharAt(pos));
|
||||
if (ch < 0x80)
|
||||
return 1;
|
||||
int len = 2;
|
||||
if (ch >= (0x80 + 0x40 + 0x20 + 0x10))
|
||||
len = 4;
|
||||
else if (ch >= (0x80 + 0x40 + 0x20))
|
||||
len = 3;
|
||||
const unsigned char leadByte = static_cast<unsigned char>(cb.CharAt(pos));
|
||||
const int widthCharBytes = UTF8BytesOfLead[leadByte];
|
||||
int lengthDoc = Length();
|
||||
if ((pos + len) > lengthDoc)
|
||||
return lengthDoc -pos;
|
||||
if ((pos + widthCharBytes) > lengthDoc)
|
||||
return lengthDoc - pos;
|
||||
else
|
||||
return len;
|
||||
return widthCharBytes;
|
||||
} else if (dbcsCodePage) {
|
||||
return IsDBCSLeadByte(cb.CharAt(pos)) ? 2 : 1;
|
||||
} else {
|
||||
@ -466,51 +465,29 @@ int Document::LenChar(int pos) {
|
||||
}
|
||||
}
|
||||
|
||||
static bool IsTrailByte(int ch) {
|
||||
return (ch >= 0x80) && (ch < (0x80 + 0x40));
|
||||
}
|
||||
|
||||
static int BytesFromLead(int leadByte) {
|
||||
if (leadByte > 0xF4) {
|
||||
// Characters longer than 4 bytes not possible in current UTF-8
|
||||
return 0;
|
||||
} else if (leadByte >= 0xF0) {
|
||||
return 4;
|
||||
} else if (leadByte >= 0xE0) {
|
||||
return 3;
|
||||
} else if (leadByte >= 0xC2) {
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool Document::InGoodUTF8(int pos, int &start, int &end) const {
|
||||
int lead = pos;
|
||||
while ((lead>0) && (pos-lead < 4) && IsTrailByte(static_cast<unsigned char>(cb.CharAt(lead-1))))
|
||||
lead--;
|
||||
start = 0;
|
||||
if (lead > 0) {
|
||||
start = lead-1;
|
||||
}
|
||||
int leadByte = static_cast<unsigned char>(cb.CharAt(start));
|
||||
int bytes = BytesFromLead(leadByte);
|
||||
if (bytes == 0) {
|
||||
int trail = pos;
|
||||
while ((trail>0) && (pos-trail < UTF8MaxBytes) && UTF8IsTrailByte(static_cast<unsigned char>(cb.CharAt(trail-1))))
|
||||
trail--;
|
||||
start = (trail > 0) ? trail-1 : trail;
|
||||
|
||||
const unsigned char leadByte = static_cast<unsigned char>(cb.CharAt(start));
|
||||
const int widthCharBytes = UTF8BytesOfLead[leadByte];
|
||||
if (widthCharBytes == 1) {
|
||||
return false;
|
||||
} else {
|
||||
int trailBytes = bytes - 1;
|
||||
int len = pos - lead + 1;
|
||||
int trailBytes = widthCharBytes - 1;
|
||||
int len = pos - start;
|
||||
if (len > trailBytes)
|
||||
// pos too far from lead
|
||||
return false;
|
||||
// Check that there are enough trails for this lead
|
||||
int trail = pos + 1;
|
||||
while ((trail-lead<trailBytes) && (trail < Length())) {
|
||||
if (!IsTrailByte(static_cast<unsigned char>(cb.CharAt(trail)))) {
|
||||
return false;
|
||||
}
|
||||
trail++;
|
||||
}
|
||||
end = start + bytes;
|
||||
char charBytes[UTF8MaxBytes] = {static_cast<char>(leadByte),0,0,0};
|
||||
for (int b=1; b<widthCharBytes && ((start+b) < Length()); b++)
|
||||
charBytes[b] = cb.CharAt(static_cast<int>(start+b));
|
||||
int utf8status = UTF8Classify(reinterpret_cast<const unsigned char *>(charBytes), widthCharBytes);
|
||||
if (utf8status & UTF8MaskInvalid)
|
||||
return false;
|
||||
end = start + widthCharBytes;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -539,14 +516,18 @@ int Document::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) {
|
||||
if (dbcsCodePage) {
|
||||
if (SC_CP_UTF8 == dbcsCodePage) {
|
||||
unsigned char ch = static_cast<unsigned char>(cb.CharAt(pos));
|
||||
int startUTF = pos;
|
||||
int endUTF = pos;
|
||||
if (IsTrailByte(ch) && InGoodUTF8(pos, startUTF, endUTF)) {
|
||||
// ch is a trail byte within a UTF-8 character
|
||||
if (moveDir > 0)
|
||||
pos = endUTF;
|
||||
else
|
||||
pos = startUTF;
|
||||
// If ch is not a trail byte then pos is valid intercharacter position
|
||||
if (UTF8IsTrailByte(ch)) {
|
||||
int startUTF = pos;
|
||||
int endUTF = pos;
|
||||
if (InGoodUTF8(pos, startUTF, endUTF)) {
|
||||
// ch is a trail byte within a UTF-8 character
|
||||
if (moveDir > 0)
|
||||
pos = endUTF;
|
||||
else
|
||||
pos = startUTF;
|
||||
}
|
||||
// Else invalid UTF-8 so return position of isolated trail byte
|
||||
}
|
||||
} else {
|
||||
// Anchor DBCS calculations at start of line because start of line can
|
||||
@ -593,16 +574,37 @@ int Document::NextPosition(int pos, int moveDir) const {
|
||||
|
||||
if (dbcsCodePage) {
|
||||
if (SC_CP_UTF8 == dbcsCodePage) {
|
||||
pos += increment;
|
||||
unsigned char ch = static_cast<unsigned char>(cb.CharAt(pos));
|
||||
int startUTF = pos;
|
||||
int endUTF = pos;
|
||||
if (IsTrailByte(ch) && InGoodUTF8(pos, startUTF, endUTF)) {
|
||||
// ch is a trail byte within a UTF-8 character
|
||||
if (moveDir > 0)
|
||||
pos = endUTF;
|
||||
else
|
||||
pos = startUTF;
|
||||
if (increment == 1) {
|
||||
// Simple forward movement case so can avoid some checks
|
||||
const unsigned char leadByte = static_cast<unsigned char>(cb.CharAt(pos));
|
||||
if (UTF8IsAscii(leadByte)) {
|
||||
// Single byte character or invalid
|
||||
pos++;
|
||||
} else {
|
||||
const int widthCharBytes = UTF8BytesOfLead[leadByte];
|
||||
char charBytes[UTF8MaxBytes] = {static_cast<char>(leadByte),0,0,0};
|
||||
for (int b=1; b<widthCharBytes; b++)
|
||||
charBytes[b] = cb.CharAt(static_cast<int>(pos+b));
|
||||
int utf8status = UTF8Classify(reinterpret_cast<const unsigned char *>(charBytes), widthCharBytes);
|
||||
if (utf8status & UTF8MaskInvalid)
|
||||
pos++;
|
||||
else
|
||||
pos += utf8status & UTF8MaskWidth;
|
||||
}
|
||||
} else {
|
||||
// Examine byte before position
|
||||
pos--;
|
||||
unsigned char ch = static_cast<unsigned char>(cb.CharAt(pos));
|
||||
// If ch is not a trail byte then pos is valid intercharacter position
|
||||
if (UTF8IsTrailByte(ch)) {
|
||||
// If ch is a trail byte in a valid UTF-8 character then return start of character
|
||||
int startUTF = pos;
|
||||
int endUTF = pos;
|
||||
if (InGoodUTF8(pos, startUTF, endUTF)) {
|
||||
pos = startUTF;
|
||||
}
|
||||
// Else invalid UTF-8 so return position of isolated trail byte
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (moveDir > 0) {
|
||||
@ -683,7 +685,7 @@ bool SCI_METHOD Document::IsDBCSLeadByte(char ch) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool IsSpaceOrTab(int ch) {
|
||||
static inline bool IsSpaceOrTab(int ch) {
|
||||
return ch == ' ' || ch == '\t';
|
||||
}
|
||||
|
||||
@ -717,7 +719,7 @@ int Document::SafeSegment(const char *text, int length, int lengthSegment) {
|
||||
lastEncodingAllowedBreak = j;
|
||||
|
||||
if (dbcsCodePage == SC_CP_UTF8) {
|
||||
j += (ch < 0x80) ? 1 : BytesFromLead(ch);
|
||||
j += UTF8BytesOfLead[ch];
|
||||
} else if (dbcsCodePage) {
|
||||
j += IsDBCSLeadByte(ch) ? 2 : 1;
|
||||
} else {
|
||||
@ -821,6 +823,22 @@ bool Document::InsertString(int position, const char *s, int insertLength) {
|
||||
return !cb.IsReadOnly();
|
||||
}
|
||||
|
||||
int SCI_METHOD Document::AddData(char *data, int length) {
|
||||
try {
|
||||
int position = Length();
|
||||
InsertString(position,data, length);
|
||||
} catch (std::bad_alloc &) {
|
||||
return SC_STATUS_BADALLOC;
|
||||
} catch (...) {
|
||||
return SC_STATUS_FAILURE;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void * SCI_METHOD Document::ConvertToDocument() {
|
||||
return this;
|
||||
}
|
||||
|
||||
int Document::Undo() {
|
||||
int newPos = -1;
|
||||
CheckReadOnly();
|
||||
@ -956,7 +974,7 @@ bool Document::InsertChar(int pos, char ch) {
|
||||
* Insert a null terminated string.
|
||||
*/
|
||||
bool Document::InsertCString(int position, const char *s) {
|
||||
return InsertString(position, s, static_cast<int>(strlen(s)));
|
||||
return InsertString(position, s, static_cast<int>(s ? strlen(s) : 0));
|
||||
}
|
||||
|
||||
void Document::ChangeChar(int pos, char ch) {
|
||||
@ -981,10 +999,6 @@ void Document::DelCharBack(int pos) {
|
||||
}
|
||||
}
|
||||
|
||||
static bool isindentchar(char ch) {
|
||||
return (ch == ' ') || (ch == '\t');
|
||||
}
|
||||
|
||||
static int NextTab(int pos, int tabSize) {
|
||||
return ((pos / tabSize) + 1) * tabSize;
|
||||
}
|
||||
@ -1044,7 +1058,7 @@ int Document::GetLineIndentPosition(int line) const {
|
||||
return 0;
|
||||
int pos = LineStart(line);
|
||||
int length = Length();
|
||||
while ((pos < length) && isindentchar(cb.CharAt(pos))) {
|
||||
while ((pos < length) && IsSpaceOrTab(cb.CharAt(pos))) {
|
||||
pos++;
|
||||
}
|
||||
return pos;
|
||||
@ -1074,6 +1088,20 @@ int Document::GetColumn(int pos) {
|
||||
return column;
|
||||
}
|
||||
|
||||
int Document::CountCharacters(int startPos, int endPos) {
|
||||
startPos = MovePositionOutsideChar(startPos, 1, false);
|
||||
endPos = MovePositionOutsideChar(endPos, -1, false);
|
||||
int count = 0;
|
||||
int i = startPos;
|
||||
while (i < endPos) {
|
||||
count++;
|
||||
if (IsCrLf(i))
|
||||
i++;
|
||||
i = NextPosition(i, 1);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
int Document::FindColumn(int line, int column) {
|
||||
int position = LineStart(line);
|
||||
if ((line >= 0) && (line < LinesTotal())) {
|
||||
@ -1082,6 +1110,8 @@ int Document::FindColumn(int line, int column) {
|
||||
char ch = cb.CharAt(position);
|
||||
if (ch == '\t') {
|
||||
columnCurrent = NextTab(columnCurrent, tabInChars);
|
||||
if (columnCurrent > column)
|
||||
return position;
|
||||
position++;
|
||||
} else if (ch == '\r') {
|
||||
return position;
|
||||
@ -1219,7 +1249,7 @@ int Document::ParaDown(int pos) {
|
||||
}
|
||||
|
||||
CharClassify::cc Document::WordCharClass(unsigned char ch) {
|
||||
if ((SC_CP_UTF8 == dbcsCodePage) && (ch >= 0x80))
|
||||
if ((SC_CP_UTF8 == dbcsCodePage) && (!UTF8IsAscii(ch)))
|
||||
return CharClassify::ccWord;
|
||||
return charClass.GetClass(ch);
|
||||
}
|
||||
@ -1346,23 +1376,6 @@ static inline char MakeLowerCase(char ch) {
|
||||
return static_cast<char>(ch - 'A' + 'a');
|
||||
}
|
||||
|
||||
static bool GoodTrailByte(int v) {
|
||||
return (v >= 0x80) && (v < 0xc0);
|
||||
}
|
||||
|
||||
size_t Document::ExtractChar(int pos, char *bytes) {
|
||||
unsigned char ch = static_cast<unsigned char>(cb.CharAt(pos));
|
||||
size_t widthChar = UTF8CharLength(ch);
|
||||
bytes[0] = ch;
|
||||
for (size_t i=1; i<widthChar; i++) {
|
||||
bytes[i] = cb.CharAt(static_cast<int>(pos+i));
|
||||
if (!GoodTrailByte(static_cast<unsigned char>(bytes[i]))) { // Bad byte
|
||||
widthChar = 1;
|
||||
}
|
||||
}
|
||||
return widthChar;
|
||||
}
|
||||
|
||||
CaseFolderTable::CaseFolderTable() {
|
||||
for (size_t iChar=0; iChar<sizeof(mapping); iChar++) {
|
||||
mapping[iChar] = static_cast<char>(iChar);
|
||||
@ -1427,7 +1440,7 @@ long Document::FindText(int minPos, int maxPos, const char *search,
|
||||
const int endPos = MovePositionOutsideChar(maxPos, increment, false);
|
||||
|
||||
// Compute actual search ranges needed
|
||||
const int lengthFind = (*length == -1) ? static_cast<int>(strlen(search)) : *length;
|
||||
const int lengthFind = *length;
|
||||
|
||||
//Platform::DebugPrintf("Find %d %d %s %d\n", startPos, endPos, ft->lpstrText, lengthFind);
|
||||
const int limitPos = Platform::Maximum(startPos, endPos);
|
||||
@ -1438,49 +1451,61 @@ long Document::FindText(int minPos, int maxPos, const char *search,
|
||||
}
|
||||
if (caseSensitive) {
|
||||
const int endSearch = (startPos <= endPos) ? endPos - lengthFind + 1 : endPos;
|
||||
const char charStartSearch = search[0];
|
||||
while (forward ? (pos < endSearch) : (pos >= endSearch)) {
|
||||
bool found = (pos + lengthFind) <= limitPos;
|
||||
for (int indexSearch = 0; (indexSearch < lengthFind) && found; indexSearch++) {
|
||||
found = CharAt(pos + indexSearch) == search[indexSearch];
|
||||
}
|
||||
if (found && MatchesWordOptions(word, wordStart, pos, lengthFind)) {
|
||||
return pos;
|
||||
if (CharAt(pos) == charStartSearch) {
|
||||
bool found = (pos + lengthFind) <= limitPos;
|
||||
for (int indexSearch = 1; (indexSearch < lengthFind) && found; indexSearch++) {
|
||||
found = CharAt(pos + indexSearch) == search[indexSearch];
|
||||
}
|
||||
if (found && MatchesWordOptions(word, wordStart, pos, lengthFind)) {
|
||||
return pos;
|
||||
}
|
||||
}
|
||||
if (!NextCharacter(pos, increment))
|
||||
break;
|
||||
}
|
||||
} else if (SC_CP_UTF8 == dbcsCodePage) {
|
||||
const size_t maxBytesCharacter = 4;
|
||||
const size_t maxFoldingExpansion = 4;
|
||||
std::vector<char> searchThing(lengthFind * maxBytesCharacter * maxFoldingExpansion + 1);
|
||||
std::vector<char> searchThing(lengthFind * UTF8MaxBytes * maxFoldingExpansion + 1);
|
||||
const int lenSearch = static_cast<int>(
|
||||
pcf->Fold(&searchThing[0], searchThing.size(), search, lengthFind));
|
||||
char bytes[UTF8MaxBytes + 1];
|
||||
char folded[UTF8MaxBytes * maxFoldingExpansion + 1];
|
||||
while (forward ? (pos < endPos) : (pos >= endPos)) {
|
||||
int widthFirstCharacter = 0;
|
||||
int indexDocument = 0;
|
||||
int posIndexDocument = pos;
|
||||
int indexSearch = 0;
|
||||
bool characterMatches = true;
|
||||
while (characterMatches &&
|
||||
((pos + indexDocument) < limitPos) &&
|
||||
(indexSearch < lenSearch)) {
|
||||
char bytes[maxBytesCharacter + 1];
|
||||
bytes[maxBytesCharacter] = 0;
|
||||
const int widthChar = static_cast<int>(ExtractChar(pos + indexDocument, bytes));
|
||||
for (;;) {
|
||||
const unsigned char leadByte = static_cast<unsigned char>(cb.CharAt(posIndexDocument));
|
||||
bytes[0] = leadByte;
|
||||
int widthChar = 1;
|
||||
if (!UTF8IsAscii(leadByte)) {
|
||||
const int widthCharBytes = UTF8BytesOfLead[leadByte];
|
||||
for (int b=1; b<widthCharBytes; b++) {
|
||||
bytes[b] = cb.CharAt(posIndexDocument+b);
|
||||
}
|
||||
widthChar = UTF8Classify(reinterpret_cast<const unsigned char *>(bytes), widthCharBytes) & UTF8MaskWidth;
|
||||
}
|
||||
if (!widthFirstCharacter)
|
||||
widthFirstCharacter = widthChar;
|
||||
if ((pos + indexDocument + widthChar) > limitPos)
|
||||
if ((posIndexDocument + widthChar) > limitPos)
|
||||
break;
|
||||
char folded[maxBytesCharacter * maxFoldingExpansion + 1];
|
||||
const int lenFlat = static_cast<int>(pcf->Fold(folded, sizeof(folded), bytes, widthChar));
|
||||
folded[lenFlat] = 0;
|
||||
// Does folded match the buffer
|
||||
characterMatches = 0 == memcmp(folded, &searchThing[0] + indexSearch, lenFlat);
|
||||
indexDocument += widthChar;
|
||||
if (!characterMatches)
|
||||
break;
|
||||
posIndexDocument += widthChar;
|
||||
indexSearch += lenFlat;
|
||||
if (indexSearch >= lenSearch)
|
||||
break;
|
||||
}
|
||||
if (characterMatches && (indexSearch == static_cast<int>(lenSearch))) {
|
||||
if (MatchesWordOptions(word, wordStart, pos, indexDocument)) {
|
||||
*length = indexDocument;
|
||||
if (MatchesWordOptions(word, wordStart, pos, posIndexDocument - pos)) {
|
||||
*length = posIndexDocument - pos;
|
||||
return pos;
|
||||
}
|
||||
}
|
||||
@ -1734,12 +1759,14 @@ StyledText Document::AnnotationStyledText(int line) {
|
||||
}
|
||||
|
||||
void Document::AnnotationSetText(int line, const char *text) {
|
||||
const int linesBefore = AnnotationLines(line);
|
||||
static_cast<LineAnnotation *>(perLineData[ldAnnotation])->SetText(line, text);
|
||||
const int linesAfter = AnnotationLines(line);
|
||||
DocModification mh(SC_MOD_CHANGEANNOTATION, LineStart(line), 0, 0, 0, line);
|
||||
mh.annotationLinesAdded = linesAfter - linesBefore;
|
||||
NotifyModified(mh);
|
||||
if (line >= 0 && line < LinesTotal()) {
|
||||
const int linesBefore = AnnotationLines(line);
|
||||
static_cast<LineAnnotation *>(perLineData[ldAnnotation])->SetText(line, text);
|
||||
const int linesAfter = AnnotationLines(line);
|
||||
DocModification mh(SC_MOD_CHANGEANNOTATION, LineStart(line), 0, 0, 0, line);
|
||||
mh.annotationLinesAdded = linesAfter - linesBefore;
|
||||
NotifyModified(mh);
|
||||
}
|
||||
}
|
||||
|
||||
void Document::AnnotationSetStyle(int line, int style) {
|
||||
@ -1749,7 +1776,9 @@ void Document::AnnotationSetStyle(int line, int style) {
|
||||
}
|
||||
|
||||
void Document::AnnotationSetStyles(int line, const unsigned char *styles) {
|
||||
static_cast<LineAnnotation *>(perLineData[ldAnnotation])->SetStyles(line, styles);
|
||||
if (line >= 0 && line < LinesTotal()) {
|
||||
static_cast<LineAnnotation *>(perLineData[ldAnnotation])->SetStyles(line, styles);
|
||||
}
|
||||
}
|
||||
|
||||
int Document::AnnotationLength(int line) const {
|
||||
@ -2155,7 +2184,7 @@ const char *BuiltinRegex::SubstituteByPosition(Document *doc, const char *text,
|
||||
unsigned int lenResult = 0;
|
||||
for (int i = 0; i < *length; i++) {
|
||||
if (text[i] == '\\') {
|
||||
if (text[i + 1] >= '1' && text[i + 1] <= '9') {
|
||||
if (text[i + 1] >= '0' && text[i + 1] <= '9') {
|
||||
unsigned int patNum = text[i + 1] - '0';
|
||||
lenResult += search.eopat[patNum] - search.bopat[patNum];
|
||||
i++;
|
||||
@ -2181,7 +2210,7 @@ const char *BuiltinRegex::SubstituteByPosition(Document *doc, const char *text,
|
||||
char *o = substituted;
|
||||
for (int j = 0; j < *length; j++) {
|
||||
if (text[j] == '\\') {
|
||||
if (text[j + 1] >= '1' && text[j + 1] <= '9') {
|
||||
if (text[j + 1] >= '0' && text[j + 1] <= '9') {
|
||||
unsigned int patNum = text[j + 1] - '0';
|
||||
unsigned int len = search.eopat[patNum] - search.bopat[patNum];
|
||||
if (search.pat[patNum]) // Will be null if try for a match that did not occur
|
||||
|
@ -193,7 +193,7 @@ public:
|
||||
|
||||
/**
|
||||
*/
|
||||
class Document : PerLine, public IDocument {
|
||||
class Document : PerLine, public IDocument, public ILoader {
|
||||
|
||||
public:
|
||||
/** Used to pair watcher pointer with user data. */
|
||||
@ -252,7 +252,7 @@ public:
|
||||
virtual ~Document();
|
||||
|
||||
int AddRef();
|
||||
int Release();
|
||||
int SCI_METHOD Release();
|
||||
|
||||
virtual void Init();
|
||||
virtual void InsertLine(int line);
|
||||
@ -281,6 +281,8 @@ public:
|
||||
void CheckReadOnly();
|
||||
bool DeleteChars(int pos, int len);
|
||||
bool InsertString(int position, const char *s, int insertLength);
|
||||
int SCI_METHOD AddData(char *data, int length);
|
||||
void * SCI_METHOD ConvertToDocument();
|
||||
int Undo();
|
||||
int Redo();
|
||||
bool CanUndo() { return cb.CanUndo(); }
|
||||
@ -296,11 +298,14 @@ public:
|
||||
void SetSavePoint();
|
||||
bool IsSavePoint() { return cb.IsSavePoint(); }
|
||||
const char * SCI_METHOD BufferPointer() { return cb.BufferPointer(); }
|
||||
const char *RangePointer(int position, int rangeLength) { return cb.RangePointer(position, rangeLength); }
|
||||
int GapPosition() const { return cb.GapPosition(); }
|
||||
|
||||
int SCI_METHOD GetLineIndentation(int line);
|
||||
void SetLineIndentation(int line, int indent);
|
||||
int GetLineIndentPosition(int line) const;
|
||||
int GetColumn(int position);
|
||||
int CountCharacters(int startPos, int endPos);
|
||||
int FindColumn(int line, int column);
|
||||
void Indent(bool forwards, int lineBottom, int lineTop);
|
||||
static char *TransformLineEnds(int *pLenOut, const char *s, size_t len, int eolModeWanted);
|
||||
@ -323,6 +328,7 @@ public:
|
||||
cb.GetStyleRange(buffer, position, lengthRetrieve);
|
||||
}
|
||||
int GetMark(int line);
|
||||
int MarkerNext(int lineStart, int mask) const;
|
||||
int AddMark(int line, int markerNum);
|
||||
void AddMarkSet(int line, int valueSet);
|
||||
void DeleteMark(int line, int markerNum);
|
||||
@ -348,7 +354,6 @@ public:
|
||||
int NextWordEnd(int pos, int delta);
|
||||
int SCI_METHOD Length() const { return cb.Length(); }
|
||||
void Allocate(int newSize) { cb.Allocate(newSize); }
|
||||
size_t ExtractChar(int pos, char *bytes);
|
||||
bool MatchesWordOptions(bool word, bool wordStart, int pos, int length);
|
||||
long FindText(int minPos, int maxPos, const char *search, bool caseSensitive, bool word,
|
||||
bool wordStart, bool regExp, int flags, int *length, CaseFolder *pcf);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -131,8 +131,8 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
* When a style attribute is changed, this cache is flushed. */
|
||||
bool stylesValid;
|
||||
ViewStyle vs;
|
||||
int technology;
|
||||
Point sizeRGBAImage;
|
||||
Palette palette;
|
||||
|
||||
int printMagnification;
|
||||
int printColourMode;
|
||||
@ -226,6 +226,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
enum { notPainting, painting, paintAbandoned } paintState;
|
||||
PRectangle rcPaint;
|
||||
bool paintingAllText;
|
||||
bool willRedrawAll;
|
||||
StyleNeeded styleNeeded;
|
||||
|
||||
int modEventMask;
|
||||
@ -263,7 +264,6 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
int wrapVisualFlags;
|
||||
int wrapVisualFlagsLocation;
|
||||
int wrapVisualStartIndent;
|
||||
int wrapAddIndent; // This will be added to initial indent of line
|
||||
int wrapIndentMode; // SC_WRAPINDENT_FIXED, _SAME, _INDENT
|
||||
|
||||
bool convertPastes;
|
||||
@ -277,9 +277,9 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
|
||||
void InvalidateStyleData();
|
||||
void InvalidateStyleRedraw();
|
||||
virtual void RefreshColourPalette(Palette &pal, bool want);
|
||||
void RefreshStyleData();
|
||||
void DropGraphics();
|
||||
void DropGraphics(bool freeObjects);
|
||||
void AllocateGraphics();
|
||||
|
||||
virtual PRectangle GetClientRectangle();
|
||||
PRectangle GetTextRectangle();
|
||||
@ -367,14 +367,14 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
LineLayout *RetrieveLineLayout(int lineNumber);
|
||||
void LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayout *ll,
|
||||
int width=LineLayout::wrapWidthInfinite);
|
||||
ColourAllocated SelectionBackground(ViewStyle &vsDraw, bool main);
|
||||
ColourAllocated TextBackground(ViewStyle &vsDraw, bool overrideBackground, ColourAllocated background, int inSelection, bool inHotspot, int styleMain, int i, LineLayout *ll);
|
||||
ColourDesired SelectionBackground(ViewStyle &vsDraw, bool main);
|
||||
ColourDesired TextBackground(ViewStyle &vsDraw, bool overrideBackground, ColourDesired 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 DrawWrapMarker(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourAllocated wrapColour);
|
||||
void DrawWrapMarker(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourDesired wrapColour);
|
||||
void DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, LineLayout *ll,
|
||||
int line, int lineEnd, int xStart, int subLine, int subLineStart,
|
||||
bool overrideBackground, ColourAllocated background,
|
||||
bool drawWrapMark, ColourAllocated wrapColour);
|
||||
int line, int lineEnd, int xStart, int subLine, XYACCUMULATOR subLineStart,
|
||||
bool overrideBackground, ColourDesired background,
|
||||
bool drawWrapMark, ColourDesired wrapColour);
|
||||
void DrawIndicator(int indicNum, int startPos, int endPos, Surface *surface, ViewStyle &vsDraw,
|
||||
int xStart, PRectangle rcLine, LineLayout *ll, int subLine);
|
||||
void DrawIndicators(Surface *surface, ViewStyle &vsDraw, int line, int xStart,
|
||||
@ -384,7 +384,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
void DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVisible, int xStart,
|
||||
PRectangle rcLine, LineLayout *ll, int subLine);
|
||||
void DrawBlockCaret(Surface *surface, ViewStyle &vsDraw, LineLayout *ll, int subLine,
|
||||
int xStart, int offset, int posCaret, PRectangle rcCaret, ColourAllocated caretColour);
|
||||
int xStart, int offset, int posCaret, PRectangle rcCaret, ColourDesired caretColour);
|
||||
void DrawCarets(Surface *surface, ViewStyle &vsDraw, int line, int xStart,
|
||||
PRectangle rcLine, LineLayout *ll, int subLine);
|
||||
void RefreshPixMaps(Surface *surfaceWindow);
|
||||
@ -469,9 +469,6 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
int KeyDownWithModifiers(int key, int modifiers, bool *consumed);
|
||||
int KeyDown(int key, bool shift, bool ctrl, bool alt, bool *consumed=0);
|
||||
|
||||
int GetWhitespaceVisible();
|
||||
void SetWhitespaceVisible(int view);
|
||||
|
||||
void Indent(bool forwards);
|
||||
|
||||
virtual CaseFolder *CaseFolderForEncoding();
|
||||
@ -496,6 +493,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
bool PointInSelection(Point pt);
|
||||
bool PointInSelMargin(Point pt);
|
||||
Window::Cursor GetMarginCursor(Point pt);
|
||||
void TrimAndSetSelection(int currentPos_, int anchor_);
|
||||
void LineSelection(int lineCurrentPos_, int lineAnchorPos_, bool wholeLine);
|
||||
void WordSelection(int pos);
|
||||
void DwellEnd(bool mouseMoved);
|
||||
@ -572,9 +570,9 @@ class AutoSurface {
|
||||
private:
|
||||
Surface *surf;
|
||||
public:
|
||||
AutoSurface(Editor *ed) : surf(0) {
|
||||
AutoSurface(Editor *ed, int technology = -1) : surf(0) {
|
||||
if (ed->wMain.GetID()) {
|
||||
surf = Surface::Allocate();
|
||||
surf = Surface::Allocate(technology != -1 ? technology : ed->technology);
|
||||
if (surf) {
|
||||
surf->Init(ed->wMain.GetID());
|
||||
surf->SetUnicodeMode(SC_CP_UTF8 == ed->CodePage());
|
||||
@ -582,9 +580,9 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
AutoSurface(SurfaceID sid, Editor *ed) : surf(0) {
|
||||
AutoSurface(SurfaceID sid, Editor *ed, int technology = -1) : surf(0) {
|
||||
if (ed->wMain.GetID()) {
|
||||
surf = Surface::Allocate();
|
||||
surf = Surface::Allocate(technology != -1 ? technology : ed->technology);
|
||||
if (surf) {
|
||||
surf->Init(sid, ed->wMain.GetID());
|
||||
surf->SetUnicodeMode(SC_CP_UTF8 == ed->CodePage());
|
||||
|
@ -10,3 +10,6 @@
|
||||
#define SC_EFF_QUALITY_NON_ANTIALIASED 1
|
||||
#define SC_EFF_QUALITY_ANTIALIASED 2
|
||||
#define SC_EFF_QUALITY_LCD_OPTIMIZED 3
|
||||
|
||||
#define SCWIN_TECH_GDI 0
|
||||
#define SCWIN_TECH_DIRECTWRITE 1
|
||||
|
@ -8,10 +8,6 @@
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable: 4786)
|
||||
#endif
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#include "Scintilla.h"
|
||||
@ -23,7 +19,7 @@ using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine) {
|
||||
surface->PenColour(fore.allocated);
|
||||
surface->PenColour(fore);
|
||||
int ymid = (rc.bottom + rc.top) / 2;
|
||||
if (style == INDIC_SQUIGGLE) {
|
||||
surface->MoveTo(rc.left, rc.top);
|
||||
@ -91,7 +87,7 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r
|
||||
rcBox.top = rcLine.top + 1;
|
||||
rcBox.left = rc.left;
|
||||
rcBox.right = rc.right;
|
||||
surface->AlphaRectangle(rcBox, (style == INDIC_ROUNDBOX) ? 1 : 0, fore.allocated, fillAlpha, fore.allocated, outlineAlpha, 0);
|
||||
surface->AlphaRectangle(rcBox, (style == INDIC_ROUNDBOX) ? 1 : 0, fore, fillAlpha, fore, outlineAlpha, 0);
|
||||
} else if (style == INDIC_DOTBOX) {
|
||||
PRectangle rcBox = rcLine;
|
||||
rcBox.top = rcLine.top + 1;
|
||||
@ -103,13 +99,13 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r
|
||||
// Draw horizontal lines top and bottom
|
||||
for (int x=0; x<width; x++) {
|
||||
for (int y=0; y<rcBox.Height(); y += rcBox.Height()-1) {
|
||||
image.SetPixel(x, y, fore.desired, ((x + y) % 2) ? outlineAlpha : fillAlpha);
|
||||
image.SetPixel(x, y, fore, ((x + y) % 2) ? outlineAlpha : fillAlpha);
|
||||
}
|
||||
}
|
||||
// Draw vertical lines left and right
|
||||
for (int y=1; y<rcBox.Height(); y++) {
|
||||
for (int x=0; x<width; x += width-1) {
|
||||
image.SetPixel(x, y, fore.desired, ((x + y) % 2) ? outlineAlpha : fillAlpha);
|
||||
image.SetPixel(x, y, fore, ((x + y) % 2) ? outlineAlpha : fillAlpha);
|
||||
}
|
||||
}
|
||||
surface->DrawRGBAImage(rcBox, image.GetWidth(), image.GetHeight(), image.Pixels());
|
||||
@ -124,7 +120,7 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r
|
||||
int x = rc.left;
|
||||
while (x < rc.right) {
|
||||
PRectangle rcDot(x, ymid, x+1, ymid+1);
|
||||
surface->FillRectangle(rcDot, fore.allocated);
|
||||
surface->FillRectangle(rcDot, fore);
|
||||
x += 2;
|
||||
}
|
||||
} else { // Either INDIC_PLAIN or unknown
|
||||
|
@ -18,7 +18,7 @@ class Indicator {
|
||||
public:
|
||||
int style;
|
||||
bool under;
|
||||
ColourPair fore;
|
||||
ColourDesired fore;
|
||||
int fillAlpha;
|
||||
int outlineAlpha;
|
||||
Indicator() : style(INDIC_PLAIN), under(false), fore(ColourDesired(0,0,0)), fillAlpha(30), outlineAlpha(50) {
|
||||
|
@ -20,15 +20,6 @@
|
||||
using namespace Scintilla;
|
||||
#endif
|
||||
|
||||
void LineMarker::RefreshColourPalette(Palette &pal, bool want) {
|
||||
pal.WantFind(fore, want);
|
||||
pal.WantFind(back, want);
|
||||
pal.WantFind(backSelected, want);
|
||||
if (pxpm) {
|
||||
pxpm->RefreshColourPalette(pal, want);
|
||||
}
|
||||
}
|
||||
|
||||
void LineMarker::SetXPM(const char *textForm) {
|
||||
delete pxpm;
|
||||
pxpm = new XPM(textForm);
|
||||
@ -47,7 +38,7 @@ void LineMarker::SetRGBAImage(Point sizeRGBAImage, const unsigned char *pixelsRG
|
||||
markType = SC_MARK_RGBAIMAGE;
|
||||
}
|
||||
|
||||
static void DrawBox(Surface *surface, int centreX, int centreY, int armSize, ColourAllocated fore, ColourAllocated back) {
|
||||
static void DrawBox(Surface *surface, int centreX, int centreY, int armSize, ColourDesired fore, ColourDesired back) {
|
||||
PRectangle rc;
|
||||
rc.left = centreX - armSize;
|
||||
rc.top = centreY - armSize;
|
||||
@ -56,7 +47,7 @@ static void DrawBox(Surface *surface, int centreX, int centreY, int armSize, Col
|
||||
surface->RectangleDraw(rc, back, fore);
|
||||
}
|
||||
|
||||
static void DrawCircle(Surface *surface, int centreX, int centreY, int armSize, ColourAllocated fore, ColourAllocated back) {
|
||||
static void DrawCircle(Surface *surface, int centreX, int centreY, int armSize, ColourDesired fore, ColourDesired back) {
|
||||
PRectangle rcCircle;
|
||||
rcCircle.left = centreX - armSize;
|
||||
rcCircle.top = centreY - armSize;
|
||||
@ -65,22 +56,22 @@ static void DrawCircle(Surface *surface, int centreX, int centreY, int armSize,
|
||||
surface->Ellipse(rcCircle, back, fore);
|
||||
}
|
||||
|
||||
static void DrawPlus(Surface *surface, int centreX, int centreY, int armSize, ColourAllocated fore) {
|
||||
static void DrawPlus(Surface *surface, int centreX, int centreY, int armSize, ColourDesired fore) {
|
||||
PRectangle rcV(centreX, centreY - armSize + 2, centreX + 1, centreY + armSize - 2 + 1);
|
||||
surface->FillRectangle(rcV, fore);
|
||||
PRectangle rcH(centreX - armSize + 2, centreY, centreX + armSize - 2 + 1, centreY+1);
|
||||
surface->FillRectangle(rcH, fore);
|
||||
}
|
||||
|
||||
static void DrawMinus(Surface *surface, int centreX, int centreY, int armSize, ColourAllocated fore) {
|
||||
static void DrawMinus(Surface *surface, int centreX, int centreY, int armSize, ColourDesired fore) {
|
||||
PRectangle rcH(centreX - armSize + 2, centreY, centreX + armSize - 2 + 1, centreY+1);
|
||||
surface->FillRectangle(rcH, fore);
|
||||
}
|
||||
|
||||
void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, typeOfFold tFold) {
|
||||
ColourPair head = back;
|
||||
ColourPair body = back;
|
||||
ColourPair tail = back;
|
||||
void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, typeOfFold tFold, int marginStyle) {
|
||||
ColourDesired head = back;
|
||||
ColourDesired body = back;
|
||||
ColourDesired tail = back;
|
||||
|
||||
switch (tFold) {
|
||||
case LineMarker::head :
|
||||
@ -101,13 +92,18 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if ((markType == SC_MARK_PIXMAP) && (pxpm)) {
|
||||
pxpm->Draw(surface, rcWhole);
|
||||
return;
|
||||
}
|
||||
if ((markType == SC_MARK_RGBAIMAGE) && (image)) {
|
||||
surface->DrawRGBAImage(rcWhole, image->GetWidth(), image->GetHeight(), image->Pixels());
|
||||
// Make rectangle just large enough to fit image centred on centre of rcWhole
|
||||
PRectangle rcImage;
|
||||
rcImage.top = static_cast<int>(((rcWhole.top + rcWhole.bottom) - image->GetHeight()) / 2);
|
||||
rcImage.bottom = rcImage.top + image->GetHeight();
|
||||
rcImage.left = static_cast<int>(((rcWhole.left + rcWhole.right) - image->GetWidth()) / 2);
|
||||
rcImage.right = rcImage.left + image->GetWidth();
|
||||
surface->DrawRGBAImage(rcImage, image->GetWidth(), image->GetHeight(), image->Pixels());
|
||||
return;
|
||||
}
|
||||
// Restrict most shapes a bit
|
||||
@ -122,22 +118,22 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
|
||||
int dimOn4 = minDim / 4;
|
||||
int blobSize = dimOn2-1;
|
||||
int armSize = dimOn2-2;
|
||||
if (rc.Width() > (rc.Height() * 2)) {
|
||||
// Wide column is line number so move to left to try to avoid overlapping number
|
||||
if (marginStyle == SC_MARGIN_NUMBER || marginStyle == SC_MARGIN_TEXT || marginStyle == SC_MARGIN_RTEXT) {
|
||||
// On textual margins move marker to the left to try to avoid overlapping the text
|
||||
centreX = rc.left + dimOn2 + 1;
|
||||
}
|
||||
if (markType == SC_MARK_ROUNDRECT) {
|
||||
PRectangle rcRounded = rc;
|
||||
rcRounded.left = rc.left + 1;
|
||||
rcRounded.right = rc.right - 1;
|
||||
surface->RoundedRectangle(rcRounded, fore.allocated, back.allocated);
|
||||
surface->RoundedRectangle(rcRounded, fore, back);
|
||||
} else if (markType == SC_MARK_CIRCLE) {
|
||||
PRectangle rcCircle;
|
||||
rcCircle.left = centreX - dimOn2;
|
||||
rcCircle.top = centreY - dimOn2;
|
||||
rcCircle.right = centreX + dimOn2;
|
||||
rcCircle.bottom = centreY + dimOn2;
|
||||
surface->Ellipse(rcCircle, fore.allocated, back.allocated);
|
||||
surface->Ellipse(rcCircle, fore, back);
|
||||
} else if (markType == SC_MARK_ARROW) {
|
||||
Point pts[] = {
|
||||
Point(centreX - dimOn4, centreY - dimOn2),
|
||||
@ -145,7 +141,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
|
||||
Point(centreX + dimOn2 - dimOn4, centreY),
|
||||
};
|
||||
surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
|
||||
fore.allocated, back.allocated);
|
||||
fore, back);
|
||||
|
||||
} else if (markType == SC_MARK_ARROWDOWN) {
|
||||
Point pts[] = {
|
||||
@ -154,7 +150,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
|
||||
Point(centreX, centreY + dimOn2 - dimOn4),
|
||||
};
|
||||
surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
|
||||
fore.allocated, back.allocated);
|
||||
fore, back);
|
||||
|
||||
} else if (markType == SC_MARK_PLUS) {
|
||||
Point pts[] = {
|
||||
@ -172,7 +168,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
|
||||
Point(centreX - armSize, centreY + 1),
|
||||
};
|
||||
surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
|
||||
fore.allocated, back.allocated);
|
||||
fore, back);
|
||||
|
||||
} else if (markType == SC_MARK_MINUS) {
|
||||
Point pts[] = {
|
||||
@ -182,7 +178,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
|
||||
Point(centreX - armSize, centreY + 1),
|
||||
};
|
||||
surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
|
||||
fore.allocated, back.allocated);
|
||||
fore, back);
|
||||
|
||||
} else if (markType == SC_MARK_SMALLRECT) {
|
||||
PRectangle rcSmall;
|
||||
@ -190,76 +186,76 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
|
||||
rcSmall.top = rc.top + 2;
|
||||
rcSmall.right = rc.right - 1;
|
||||
rcSmall.bottom = rc.bottom - 2;
|
||||
surface->RectangleDraw(rcSmall, fore.allocated, back.allocated);
|
||||
surface->RectangleDraw(rcSmall, fore, back);
|
||||
|
||||
} 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
|
||||
|
||||
} else if (markType == SC_MARK_VLINE) {
|
||||
surface->PenColour(body.allocated);
|
||||
surface->PenColour(body);
|
||||
surface->MoveTo(centreX, rcWhole.top);
|
||||
surface->LineTo(centreX, rcWhole.bottom);
|
||||
|
||||
} else if (markType == SC_MARK_LCORNER) {
|
||||
surface->PenColour(tail.allocated);
|
||||
surface->PenColour(tail);
|
||||
surface->MoveTo(centreX, rcWhole.top);
|
||||
surface->LineTo(centreX, rc.top + dimOn2);
|
||||
surface->LineTo(rc.right - 2, rc.top + dimOn2);
|
||||
surface->LineTo(centreX, centreY);
|
||||
surface->LineTo(rc.right - 1, centreY);
|
||||
|
||||
} else if (markType == SC_MARK_TCORNER) {
|
||||
surface->PenColour(tail.allocated);
|
||||
surface->MoveTo(centreX, rc.top + dimOn2);
|
||||
surface->LineTo(rc.right - 2, rc.top + dimOn2);
|
||||
surface->PenColour(tail);
|
||||
surface->MoveTo(centreX, centreY);
|
||||
surface->LineTo(rc.right - 1, centreY);
|
||||
|
||||
surface->PenColour(body.allocated);
|
||||
surface->PenColour(body);
|
||||
surface->MoveTo(centreX, rcWhole.top);
|
||||
surface->LineTo(centreX, rc.top + dimOn2 + 1);
|
||||
surface->LineTo(centreX, centreY + 1);
|
||||
|
||||
surface->PenColour(head.allocated);
|
||||
surface->PenColour(head);
|
||||
surface->LineTo(centreX, rcWhole.bottom);
|
||||
|
||||
} else if (markType == SC_MARK_LCORNERCURVE) {
|
||||
surface->PenColour(tail.allocated);
|
||||
surface->PenColour(tail);
|
||||
surface->MoveTo(centreX, rcWhole.top);
|
||||
surface->LineTo(centreX, rc.top + dimOn2-3);
|
||||
surface->LineTo(centreX+3, rc.top + dimOn2);
|
||||
surface->LineTo(rc.right - 1, rc.top + dimOn2);
|
||||
surface->LineTo(centreX, centreY-3);
|
||||
surface->LineTo(centreX+3, centreY);
|
||||
surface->LineTo(rc.right - 1, centreY);
|
||||
|
||||
} else if (markType == SC_MARK_TCORNERCURVE) {
|
||||
surface->PenColour(tail.allocated);
|
||||
surface->MoveTo(centreX, rc.top + dimOn2-3);
|
||||
surface->LineTo(centreX+3, rc.top + dimOn2);
|
||||
surface->LineTo(rc.right - 1, rc.top + dimOn2);
|
||||
surface->PenColour(tail);
|
||||
surface->MoveTo(centreX, centreY-3);
|
||||
surface->LineTo(centreX+3, centreY);
|
||||
surface->LineTo(rc.right - 1, centreY);
|
||||
|
||||
surface->PenColour(body.allocated);
|
||||
surface->PenColour(body);
|
||||
surface->MoveTo(centreX, rcWhole.top);
|
||||
surface->LineTo(centreX, rc.top + dimOn2-2);
|
||||
surface->LineTo(centreX, centreY-2);
|
||||
|
||||
surface->PenColour(head.allocated);
|
||||
surface->PenColour(head);
|
||||
surface->LineTo(centreX, rcWhole.bottom);
|
||||
|
||||
} else if (markType == SC_MARK_BOXPLUS) {
|
||||
DrawBox(surface, centreX, centreY, blobSize, fore.allocated, head.allocated);
|
||||
DrawPlus(surface, centreX, centreY, blobSize, tail.allocated);
|
||||
DrawBox(surface, centreX, centreY, blobSize, fore, head);
|
||||
DrawPlus(surface, centreX, centreY, blobSize, tail);
|
||||
|
||||
} else if (markType == SC_MARK_BOXPLUSCONNECTED) {
|
||||
if (tFold == LineMarker::headWithTail)
|
||||
surface->PenColour(tail.allocated);
|
||||
surface->PenColour(tail);
|
||||
else
|
||||
surface->PenColour(body.allocated);
|
||||
surface->PenColour(body);
|
||||
surface->MoveTo(centreX, centreY + blobSize);
|
||||
surface->LineTo(centreX, rcWhole.bottom);
|
||||
|
||||
surface->PenColour(body.allocated);
|
||||
surface->PenColour(body);
|
||||
surface->MoveTo(centreX, rcWhole.top);
|
||||
surface->LineTo(centreX, centreY - blobSize);
|
||||
|
||||
DrawBox(surface, centreX, centreY, blobSize, fore.allocated, head.allocated);
|
||||
DrawPlus(surface, centreX, centreY, blobSize, tail.allocated);
|
||||
DrawBox(surface, centreX, centreY, blobSize, fore, head);
|
||||
DrawPlus(surface, centreX, centreY, blobSize, tail);
|
||||
|
||||
if (tFold == LineMarker::body) {
|
||||
surface->PenColour(tail.allocated);
|
||||
surface->PenColour(tail);
|
||||
surface->MoveTo(centreX + 1, centreY + blobSize);
|
||||
surface->LineTo(centreX + blobSize + 1, centreY + blobSize);
|
||||
|
||||
@ -270,27 +266,27 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
|
||||
surface->LineTo(centreX + blobSize + 1, centreY - blobSize);
|
||||
}
|
||||
} else if (markType == SC_MARK_BOXMINUS) {
|
||||
DrawBox(surface, centreX, centreY, blobSize, fore.allocated, head.allocated);
|
||||
DrawMinus(surface, centreX, centreY, blobSize, tail.allocated);
|
||||
DrawBox(surface, centreX, centreY, blobSize, fore, head);
|
||||
DrawMinus(surface, centreX, centreY, blobSize, tail);
|
||||
|
||||
surface->PenColour(head.allocated);
|
||||
surface->PenColour(head);
|
||||
surface->MoveTo(centreX, centreY + blobSize);
|
||||
surface->LineTo(centreX, rcWhole.bottom);
|
||||
|
||||
} else if (markType == SC_MARK_BOXMINUSCONNECTED) {
|
||||
DrawBox(surface, centreX, centreY, blobSize, fore.allocated, head.allocated);
|
||||
DrawMinus(surface, centreX, centreY, blobSize, tail.allocated);
|
||||
DrawBox(surface, centreX, centreY, blobSize, fore, head);
|
||||
DrawMinus(surface, centreX, centreY, blobSize, tail);
|
||||
|
||||
surface->PenColour(head.allocated);
|
||||
surface->PenColour(head);
|
||||
surface->MoveTo(centreX, centreY + blobSize);
|
||||
surface->LineTo(centreX, rcWhole.bottom);
|
||||
|
||||
surface->PenColour(body.allocated);
|
||||
surface->PenColour(body);
|
||||
surface->MoveTo(centreX, rcWhole.top);
|
||||
surface->LineTo(centreX, centreY - blobSize);
|
||||
|
||||
if (tFold == LineMarker::body) {
|
||||
surface->PenColour(tail.allocated);
|
||||
surface->PenColour(tail);
|
||||
surface->MoveTo(centreX + 1, centreY + blobSize);
|
||||
surface->LineTo(centreX + blobSize + 1, centreY + blobSize);
|
||||
|
||||
@ -301,62 +297,62 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
|
||||
surface->LineTo(centreX + blobSize + 1, centreY - blobSize);
|
||||
}
|
||||
} else if (markType == SC_MARK_CIRCLEPLUS) {
|
||||
DrawCircle(surface, centreX, centreY, blobSize, fore.allocated, head.allocated);
|
||||
DrawPlus(surface, centreX, centreY, blobSize, tail.allocated);
|
||||
DrawCircle(surface, centreX, centreY, blobSize, fore, head);
|
||||
DrawPlus(surface, centreX, centreY, blobSize, tail);
|
||||
|
||||
} else if (markType == SC_MARK_CIRCLEPLUSCONNECTED) {
|
||||
if (tFold == LineMarker::headWithTail)
|
||||
surface->PenColour(tail.allocated);
|
||||
surface->PenColour(tail);
|
||||
else
|
||||
surface->PenColour(body.allocated);
|
||||
surface->PenColour(body);
|
||||
surface->MoveTo(centreX, centreY + blobSize);
|
||||
surface->LineTo(centreX, rcWhole.bottom);
|
||||
|
||||
surface->PenColour(body.allocated);
|
||||
surface->PenColour(body);
|
||||
surface->MoveTo(centreX, rcWhole.top);
|
||||
surface->LineTo(centreX, centreY - blobSize);
|
||||
|
||||
DrawCircle(surface, centreX, centreY, blobSize, fore.allocated, head.allocated);
|
||||
DrawPlus(surface, centreX, centreY, blobSize, tail.allocated);
|
||||
DrawCircle(surface, centreX, centreY, blobSize, fore, head);
|
||||
DrawPlus(surface, centreX, centreY, blobSize, tail);
|
||||
|
||||
} else if (markType == SC_MARK_CIRCLEMINUS) {
|
||||
DrawCircle(surface, centreX, centreY, blobSize, fore.allocated, head.allocated);
|
||||
DrawMinus(surface, centreX, centreY, blobSize, tail.allocated);
|
||||
DrawCircle(surface, centreX, centreY, blobSize, fore, head);
|
||||
DrawMinus(surface, centreX, centreY, blobSize, tail);
|
||||
|
||||
surface->PenColour(head.allocated);
|
||||
surface->PenColour(head);
|
||||
surface->MoveTo(centreX, centreY + blobSize);
|
||||
surface->LineTo(centreX, rcWhole.bottom);
|
||||
|
||||
} else if (markType == SC_MARK_CIRCLEMINUSCONNECTED) {
|
||||
DrawCircle(surface, centreX, centreY, blobSize, fore.allocated, head.allocated);
|
||||
DrawMinus(surface, centreX, centreY, blobSize, tail.allocated);
|
||||
DrawCircle(surface, centreX, centreY, blobSize, fore, head);
|
||||
DrawMinus(surface, centreX, centreY, blobSize, tail);
|
||||
|
||||
surface->PenColour(head.allocated);
|
||||
surface->PenColour(head);
|
||||
surface->MoveTo(centreX, centreY + blobSize);
|
||||
surface->LineTo(centreX, rcWhole.bottom);
|
||||
|
||||
surface->PenColour(body.allocated);
|
||||
surface->PenColour(body);
|
||||
surface->MoveTo(centreX, rcWhole.top);
|
||||
surface->LineTo(centreX, centreY - blobSize);
|
||||
|
||||
} else if (markType >= SC_MARK_CHARACTER) {
|
||||
char character[1];
|
||||
character[0] = static_cast<char>(markType - SC_MARK_CHARACTER);
|
||||
int width = surface->WidthText(fontForCharacter, character, 1);
|
||||
XYPOSITION width = surface->WidthText(fontForCharacter, character, 1);
|
||||
rc.left += (rc.Width() - width) / 2;
|
||||
rc.right = rc.left + width;
|
||||
surface->DrawTextClipped(rc, fontForCharacter, rc.bottom - 2,
|
||||
character, 1, fore.allocated, back.allocated);
|
||||
character, 1, fore, back);
|
||||
|
||||
} else if (markType == SC_MARK_DOTDOTDOT) {
|
||||
int right = centreX - 6;
|
||||
for (int b=0; b<3; b++) {
|
||||
PRectangle rcBlob(right, rc.bottom - 4, right + 2, rc.bottom-2);
|
||||
surface->FillRectangle(rcBlob, fore.allocated);
|
||||
surface->FillRectangle(rcBlob, fore);
|
||||
right += 5;
|
||||
}
|
||||
} else if (markType == SC_MARK_ARROWS) {
|
||||
surface->PenColour(fore.allocated);
|
||||
surface->PenColour(fore);
|
||||
int right = centreX - 2;
|
||||
for (int b=0; b<3; b++) {
|
||||
surface->MoveTo(right - 4, centreY - 4);
|
||||
@ -376,12 +372,12 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
|
||||
Point(centreX, centreY + dimOn2),
|
||||
};
|
||||
surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
|
||||
fore.allocated, back.allocated);
|
||||
fore, back);
|
||||
} else if (markType == SC_MARK_LEFTRECT) {
|
||||
PRectangle rcLeft = rcWhole;
|
||||
rcLeft.right = rcLeft.left + 4;
|
||||
surface->FillRectangle(rcLeft, back.allocated);
|
||||
surface->FillRectangle(rcLeft, back);
|
||||
} else { // SC_MARK_FULLRECT
|
||||
surface->FillRectangle(rcWhole, back.allocated);
|
||||
surface->FillRectangle(rcWhole, back);
|
||||
}
|
||||
}
|
||||
|
@ -20,9 +20,9 @@ public:
|
||||
enum typeOfFold { undefined, head, body, tail, headWithTail };
|
||||
|
||||
int markType;
|
||||
ColourPair fore;
|
||||
ColourPair back;
|
||||
ColourPair backSelected;
|
||||
ColourDesired fore;
|
||||
ColourDesired back;
|
||||
ColourDesired backSelected;
|
||||
int alpha;
|
||||
XPM *pxpm;
|
||||
RGBAImage *image;
|
||||
@ -36,7 +36,7 @@ public:
|
||||
image = NULL;
|
||||
}
|
||||
LineMarker(const LineMarker &) {
|
||||
// Defined to avoid pxpm being blindly copied, not as real copy constructor
|
||||
// Defined to avoid pxpm being blindly copied, not as a complete copy constructor
|
||||
markType = SC_MARK_CIRCLE;
|
||||
fore = ColourDesired(0,0,0);
|
||||
back = ColourDesired(0xff,0xff,0xff);
|
||||
@ -49,24 +49,25 @@ public:
|
||||
delete pxpm;
|
||||
delete image;
|
||||
}
|
||||
LineMarker &operator=(const LineMarker &) {
|
||||
// Defined to avoid pxpm being blindly copied, not as real assignment operator
|
||||
markType = SC_MARK_CIRCLE;
|
||||
fore = ColourDesired(0,0,0);
|
||||
back = ColourDesired(0xff,0xff,0xff);
|
||||
backSelected = ColourDesired(0xff,0x00,0x00);
|
||||
alpha = SC_ALPHA_NOALPHA;
|
||||
delete pxpm;
|
||||
pxpm = NULL;
|
||||
delete image;
|
||||
image = NULL;
|
||||
LineMarker &operator=(const LineMarker &other) {
|
||||
// Defined to avoid pxpm being blindly copied, not as a complete assignment operator
|
||||
if (this != &other) {
|
||||
markType = SC_MARK_CIRCLE;
|
||||
fore = ColourDesired(0,0,0);
|
||||
back = ColourDesired(0xff,0xff,0xff);
|
||||
backSelected = ColourDesired(0xff,0x00,0x00);
|
||||
alpha = SC_ALPHA_NOALPHA;
|
||||
delete pxpm;
|
||||
pxpm = NULL;
|
||||
delete image;
|
||||
image = NULL;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
void RefreshColourPalette(Palette &pal, bool want);
|
||||
void SetXPM(const char *textForm);
|
||||
void SetXPM(const char *const *linesForm);
|
||||
void SetRGBAImage(Point sizeRGBAImage, const unsigned char *pixelsRGBAImage);
|
||||
void Draw(Surface *surface, PRectangle &rc, Font &fontForCharacter, typeOfFold tFold);
|
||||
void Draw(Surface *surface, PRectangle &rc, Font &fontForCharacter, typeOfFold tFold, int marginStyle);
|
||||
};
|
||||
|
||||
#ifdef SCI_NAMESPACE
|
||||
|
@ -182,6 +182,19 @@ int LineMarkers::MarkValue(int line) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int LineMarkers::MarkerNext(int lineStart, int mask) const {
|
||||
if (lineStart < 0)
|
||||
lineStart = 0;
|
||||
int length = markers.Length();
|
||||
for (int iLine = lineStart; iLine < length; iLine++) {
|
||||
MarkerHandleSet *onLine = markers[iLine];
|
||||
if (onLine && ((onLine->MarkValue() & mask) != 0))
|
||||
//if ((pdoc->GetMark(iLine) & lParam) != 0)
|
||||
return iLine;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int LineMarkers::AddMark(int line, int markerNum, int lines) {
|
||||
handleCurrent++;
|
||||
if (!markers.Length()) {
|
||||
@ -384,28 +397,28 @@ bool LineAnnotation::AnySet() const {
|
||||
}
|
||||
|
||||
bool LineAnnotation::MultipleStyles(int line) const {
|
||||
if (annotations.Length() && (line < annotations.Length()) && annotations[line])
|
||||
if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line])
|
||||
return reinterpret_cast<AnnotationHeader *>(annotations[line])->style == IndividualStyles;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
int LineAnnotation::Style(int line) {
|
||||
if (annotations.Length() && (line < annotations.Length()) && annotations[line])
|
||||
if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line])
|
||||
return reinterpret_cast<AnnotationHeader *>(annotations[line])->style;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char *LineAnnotation::Text(int line) const {
|
||||
if (annotations.Length() && (line < annotations.Length()) && annotations[line])
|
||||
if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line])
|
||||
return annotations[line]+sizeof(AnnotationHeader);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
const unsigned char *LineAnnotation::Styles(int line) const {
|
||||
if (annotations.Length() && (line < annotations.Length()) && annotations[line] && MultipleStyles(line))
|
||||
if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line] && MultipleStyles(line))
|
||||
return reinterpret_cast<unsigned char *>(annotations[line] + sizeof(AnnotationHeader) + Length(line));
|
||||
else
|
||||
return 0;
|
||||
@ -419,7 +432,7 @@ static char *AllocateAnnotation(int length, int style) {
|
||||
}
|
||||
|
||||
void LineAnnotation::SetText(int line, const char *text) {
|
||||
if (text) {
|
||||
if (text && (line >= 0)) {
|
||||
annotations.EnsureLength(line+1);
|
||||
int style = Style(line);
|
||||
if (annotations[line]) {
|
||||
@ -432,7 +445,7 @@ void LineAnnotation::SetText(int line, const char *text) {
|
||||
pah->lines = static_cast<short>(NumberLines(text));
|
||||
memcpy(annotations[line]+sizeof(AnnotationHeader), text, pah->length);
|
||||
} else {
|
||||
if (annotations.Length() && (line < annotations.Length()) && annotations[line]) {
|
||||
if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line]) {
|
||||
delete []annotations[line];
|
||||
annotations[line] = 0;
|
||||
}
|
||||
@ -456,35 +469,37 @@ void LineAnnotation::SetStyle(int line, int style) {
|
||||
}
|
||||
|
||||
void LineAnnotation::SetStyles(int line, const unsigned char *styles) {
|
||||
annotations.EnsureLength(line+1);
|
||||
if (!annotations[line]) {
|
||||
annotations[line] = AllocateAnnotation(0, IndividualStyles);
|
||||
} else {
|
||||
AnnotationHeader *pahSource = reinterpret_cast<AnnotationHeader *>(annotations[line]);
|
||||
if (pahSource->style != IndividualStyles) {
|
||||
char *allocation = AllocateAnnotation(pahSource->length, IndividualStyles);
|
||||
AnnotationHeader *pahAlloc = reinterpret_cast<AnnotationHeader *>(allocation);
|
||||
pahAlloc->length = pahSource->length;
|
||||
pahAlloc->lines = pahSource->lines;
|
||||
memcpy(allocation + sizeof(AnnotationHeader), annotations[line] + sizeof(AnnotationHeader), pahSource->length);
|
||||
delete []annotations[line];
|
||||
annotations[line] = allocation;
|
||||
if (line >= 0) {
|
||||
annotations.EnsureLength(line+1);
|
||||
if (!annotations[line]) {
|
||||
annotations[line] = AllocateAnnotation(0, IndividualStyles);
|
||||
} else {
|
||||
AnnotationHeader *pahSource = reinterpret_cast<AnnotationHeader *>(annotations[line]);
|
||||
if (pahSource->style != IndividualStyles) {
|
||||
char *allocation = AllocateAnnotation(pahSource->length, IndividualStyles);
|
||||
AnnotationHeader *pahAlloc = reinterpret_cast<AnnotationHeader *>(allocation);
|
||||
pahAlloc->length = pahSource->length;
|
||||
pahAlloc->lines = pahSource->lines;
|
||||
memcpy(allocation + sizeof(AnnotationHeader), annotations[line] + sizeof(AnnotationHeader), pahSource->length);
|
||||
delete []annotations[line];
|
||||
annotations[line] = allocation;
|
||||
}
|
||||
}
|
||||
AnnotationHeader *pah = reinterpret_cast<AnnotationHeader *>(annotations[line]);
|
||||
pah->style = IndividualStyles;
|
||||
memcpy(annotations[line] + sizeof(AnnotationHeader) + pah->length, styles, pah->length);
|
||||
}
|
||||
AnnotationHeader *pah = reinterpret_cast<AnnotationHeader *>(annotations[line]);
|
||||
pah->style = IndividualStyles;
|
||||
memcpy(annotations[line] + sizeof(AnnotationHeader) + pah->length, styles, pah->length);
|
||||
}
|
||||
|
||||
int LineAnnotation::Length(int line) const {
|
||||
if (annotations.Length() && (line < annotations.Length()) && annotations[line])
|
||||
if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line])
|
||||
return reinterpret_cast<AnnotationHeader *>(annotations[line])->length;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
int LineAnnotation::Lines(int line) const {
|
||||
if (annotations.Length() && (line < annotations.Length()) && annotations[line])
|
||||
if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line])
|
||||
return reinterpret_cast<AnnotationHeader *>(annotations[line])->lines;
|
||||
else
|
||||
return 0;
|
||||
|
@ -54,6 +54,7 @@ public:
|
||||
virtual void RemoveLine(int line);
|
||||
|
||||
int MarkValue(int line);
|
||||
int MarkerNext(int lineStart, int mask) const;
|
||||
int AddMark(int line, int marker, int lines);
|
||||
void MergeMarkers(int pos);
|
||||
bool DeleteMark(int line, int markerNum, bool all);
|
||||
|
@ -86,7 +86,7 @@ void LineLayout::Resize(int maxLineLength_) {
|
||||
indicators = new char[maxLineLength_ + 1];
|
||||
// Extra position allocated as sometimes the Windows
|
||||
// GetTextExtentExPoint API writes an extra element.
|
||||
positions = new int[maxLineLength_ + 1 + 1];
|
||||
positions = new XYPOSITION[maxLineLength_ + 1 + 1];
|
||||
maxLineLength = maxLineLength_;
|
||||
}
|
||||
}
|
||||
@ -189,10 +189,10 @@ void LineLayout::RestoreBracesHighlight(Range rangeLine, Position braces[], bool
|
||||
xHighlightGuide = 0;
|
||||
}
|
||||
|
||||
int LineLayout::FindBefore(int x, int lower, int upper) const {
|
||||
int LineLayout::FindBefore(XYPOSITION x, int lower, int upper) const {
|
||||
do {
|
||||
int middle = (upper + lower + 1) / 2; // Round high
|
||||
int posMiddle = positions[middle];
|
||||
XYPOSITION posMiddle = positions[middle];
|
||||
if (x < posMiddle) {
|
||||
upper = middle - 1;
|
||||
} else {
|
||||
@ -503,15 +503,15 @@ PositionCacheEntry::PositionCacheEntry() :
|
||||
}
|
||||
|
||||
void PositionCacheEntry::Set(unsigned int styleNumber_, const char *s_,
|
||||
unsigned int len_, int *positions_, unsigned int clock_) {
|
||||
unsigned int len_, XYPOSITION *positions_, unsigned int clock_) {
|
||||
Clear();
|
||||
styleNumber = styleNumber_;
|
||||
len = len_;
|
||||
clock = clock_;
|
||||
if (s_ && positions_) {
|
||||
positions = new short[len + (len + 1) / 2];
|
||||
positions = new XYPOSITION[len + (len + 1) / 2];
|
||||
for (unsigned int i=0; i<len; i++) {
|
||||
positions[i] = static_cast<short>(positions_[i]);
|
||||
positions[i] = static_cast<XYPOSITION>(positions_[i]);
|
||||
}
|
||||
memcpy(reinterpret_cast<char *>(positions + len), s_, len);
|
||||
}
|
||||
@ -530,7 +530,7 @@ void PositionCacheEntry::Clear() {
|
||||
}
|
||||
|
||||
bool PositionCacheEntry::Retrieve(unsigned int styleNumber_, const char *s_,
|
||||
unsigned int len_, int *positions_) const {
|
||||
unsigned int len_, XYPOSITION *positions_) const {
|
||||
if ((styleNumber == styleNumber_) && (len == len_) &&
|
||||
(memcmp(reinterpret_cast<char *>(positions + len), s_, len)== 0)) {
|
||||
for (unsigned int i=0; i<len; i++) {
|
||||
@ -595,7 +595,7 @@ void PositionCache::SetSize(size_t size_) {
|
||||
}
|
||||
|
||||
void PositionCache::MeasureWidths(Surface *surface, ViewStyle &vstyle, unsigned int styleNumber,
|
||||
const char *s, unsigned int len, int *positions, Document *pdoc) {
|
||||
const char *s, unsigned int len, XYPOSITION *positions, Document *pdoc) {
|
||||
|
||||
allClear = false;
|
||||
int probe = -1;
|
||||
@ -621,7 +621,7 @@ void PositionCache::MeasureWidths(Surface *surface, ViewStyle &vstyle, unsigned
|
||||
if (len > BreakFinder::lengthStartSubdivision) {
|
||||
// Break up into segments
|
||||
unsigned int startSegment = 0;
|
||||
int xStartSegment = 0;
|
||||
XYPOSITION xStartSegment = 0;
|
||||
while (startSegment < len) {
|
||||
unsigned int lenSegment = pdoc->SafeSegment(s + startSegment, len - startSegment, BreakFinder::lengthEachSubdivision);
|
||||
surface->MeasureWidths(vstyle.styles[styleNumber].font, s + startSegment, lenSegment, positions + startSegment);
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
unsigned char *styles;
|
||||
int styleBitsSet;
|
||||
char *indicators;
|
||||
int *positions;
|
||||
XYPOSITION *positions;
|
||||
char bracePreviousStyles[2];
|
||||
|
||||
// Hotspot support
|
||||
@ -51,7 +51,7 @@ public:
|
||||
// Wrapped line support
|
||||
int widthLine;
|
||||
int lines;
|
||||
int wrapIndent; // In pixels
|
||||
XYPOSITION wrapIndent; // In pixels
|
||||
|
||||
LineLayout(int maxLineLength_);
|
||||
virtual ~LineLayout();
|
||||
@ -65,7 +65,7 @@ public:
|
||||
void SetBracesHighlight(Range rangeLine, Position braces[],
|
||||
char bracesMatchStyle, int xHighlight, bool ignoreStyle);
|
||||
void RestoreBracesHighlight(Range rangeLine, Position braces[], bool ignoreStyle);
|
||||
int FindBefore(int x, int lower, int upper) const;
|
||||
int FindBefore(XYPOSITION x, int lower, int upper) const;
|
||||
int EndLineStyle() const;
|
||||
};
|
||||
|
||||
@ -103,13 +103,13 @@ class PositionCacheEntry {
|
||||
unsigned int styleNumber:8;
|
||||
unsigned int len:8;
|
||||
unsigned int clock:16;
|
||||
short *positions;
|
||||
XYPOSITION *positions;
|
||||
public:
|
||||
PositionCacheEntry();
|
||||
~PositionCacheEntry();
|
||||
void Set(unsigned int styleNumber_, const char *s_, unsigned int len_, int *positions_, unsigned int clock);
|
||||
void Set(unsigned int styleNumber_, const char *s_, unsigned int len_, XYPOSITION *positions_, unsigned int clock);
|
||||
void Clear();
|
||||
bool Retrieve(unsigned int styleNumber_, const char *s_, unsigned int len_, int *positions_) const;
|
||||
bool Retrieve(unsigned int styleNumber_, const char *s_, unsigned int len_, XYPOSITION *positions_) const;
|
||||
static int Hash(unsigned int styleNumber_, const char *s, unsigned int len);
|
||||
bool NewerThan(const PositionCacheEntry &other) const;
|
||||
void ResetClock();
|
||||
@ -155,7 +155,7 @@ public:
|
||||
void SetSize(size_t size_);
|
||||
size_t GetSize() const { return size; }
|
||||
void MeasureWidths(Surface *surface, ViewStyle &vstyle, unsigned int styleNumber,
|
||||
const char *s, unsigned int len, int *positions, Document *pdoc);
|
||||
const char *s, unsigned int len, XYPOSITION *positions, Document *pdoc);
|
||||
};
|
||||
|
||||
inline bool IsSpaceOrTab(int ch) {
|
||||
|
@ -65,11 +65,6 @@ void ScintillaBase::Finalise() {
|
||||
popup.Destroy();
|
||||
}
|
||||
|
||||
void ScintillaBase::RefreshColourPalette(Palette &pal, bool want) {
|
||||
Editor::RefreshColourPalette(pal, want);
|
||||
ct.RefreshColourPalette(pal, want);
|
||||
}
|
||||
|
||||
void ScintillaBase::AddCharUTF(char *s, unsigned int len, bool treatAsDBCS) {
|
||||
bool isFillUp = ac.Active() && ac.IsFillUpChar(*s);
|
||||
if (!isFillUp) {
|
||||
@ -139,10 +134,10 @@ int ScintillaBase::KeyCommand(unsigned int iMessage) {
|
||||
AutoCompleteMove(-1);
|
||||
return 0;
|
||||
case SCI_PAGEDOWN:
|
||||
AutoCompleteMove(5);
|
||||
AutoCompleteMove(ac.lb->GetVisibleRows());
|
||||
return 0;
|
||||
case SCI_PAGEUP:
|
||||
AutoCompleteMove(-5);
|
||||
AutoCompleteMove(-ac.lb->GetVisibleRows());
|
||||
return 0;
|
||||
case SCI_VCHOME:
|
||||
AutoCompleteMove(-5000);
|
||||
@ -222,7 +217,7 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {
|
||||
}
|
||||
}
|
||||
ac.Start(wMain, idAutoComplete, sel.MainCaret(), PointMainCaret(),
|
||||
lenEntered, vs.lineHeight, IsUnicodeMode());
|
||||
lenEntered, vs.lineHeight, IsUnicodeMode(), technology);
|
||||
|
||||
PRectangle rcClient = GetClientRectangle();
|
||||
Point pt = LocationFromPosition(sel.MainCaret() - lenEntered);
|
||||
@ -405,7 +400,6 @@ int ScintillaBase::AutoCompleteGetCurrentText(char *buffer) {
|
||||
|
||||
void ScintillaBase::CallTipShow(Point pt, const char *defn) {
|
||||
ac.Cancel();
|
||||
pt.y += vs.lineHeight;
|
||||
// If container knows about STYLE_CALLTIP then use it in place of the
|
||||
// STYLE_DEFAULT for the face name, size and character set. Also use it
|
||||
// for the foreground and background colour.
|
||||
@ -414,17 +408,25 @@ void ScintillaBase::CallTipShow(Point pt, const char *defn) {
|
||||
ct.SetForeBack(vs.styles[STYLE_CALLTIP].fore, vs.styles[STYLE_CALLTIP].back);
|
||||
}
|
||||
PRectangle rc = ct.CallTipStart(sel.MainCaret(), pt,
|
||||
vs.lineHeight,
|
||||
defn,
|
||||
vs.styles[ctStyle].fontName,
|
||||
vs.styles[ctStyle].sizeZoomed,
|
||||
CodePage(),
|
||||
vs.styles[ctStyle].characterSet,
|
||||
vs.technology,
|
||||
wMain);
|
||||
// If the call-tip window would be out of the client
|
||||
// space, adjust so it displays above the text.
|
||||
// space
|
||||
PRectangle rcClient = GetClientRectangle();
|
||||
int offset = vs.lineHeight + rc.Height();
|
||||
// adjust so it displays below the text.
|
||||
if (rc.top < rcClient.top) {
|
||||
rc.top += offset;
|
||||
rc.bottom += offset;
|
||||
}
|
||||
// adjust so it displays above the text.
|
||||
if (rc.bottom > rcClient.bottom) {
|
||||
int offset = vs.lineHeight + rc.Height();
|
||||
rc.top -= offset;
|
||||
rc.bottom -= offset;
|
||||
}
|
||||
@ -725,6 +727,13 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara
|
||||
case SCI_AUTOCGETIGNORECASE:
|
||||
return ac.ignoreCase;
|
||||
|
||||
case SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR:
|
||||
ac.ignoreCaseBehaviour = wParam;
|
||||
break;
|
||||
|
||||
case SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR:
|
||||
return ac.ignoreCaseBehaviour;
|
||||
|
||||
case SCI_USERLISTSHOW:
|
||||
listType = wParam;
|
||||
AutoCompleteStart(0, reinterpret_cast<const char *>(lParam));
|
||||
@ -818,6 +827,11 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara
|
||||
InvalidateStyleRedraw();
|
||||
break;
|
||||
|
||||
case SCI_CALLTIPSETPOSITION:
|
||||
ct.SetPosition(wParam != 0);
|
||||
InvalidateStyleRedraw();
|
||||
break;
|
||||
|
||||
case SCI_USEPOPUP:
|
||||
displayPopupMenu = wParam != 0;
|
||||
break;
|
||||
|
@ -59,8 +59,6 @@ protected:
|
||||
virtual void Initialise() = 0;
|
||||
virtual void Finalise() = 0;
|
||||
|
||||
virtual void RefreshColourPalette(Palette &pal, bool want);
|
||||
|
||||
virtual void AddCharUTF(char *s, unsigned int len, bool treatAsDBCS=false);
|
||||
void Command(int cmdId);
|
||||
virtual void CancelModes();
|
||||
|
@ -261,6 +261,24 @@ public:
|
||||
body[lengthBody] = 0;
|
||||
return body;
|
||||
}
|
||||
|
||||
T *RangePointer(int position, int rangeLength) {
|
||||
if (position < part1Length) {
|
||||
if ((position + rangeLength) > part1Length) {
|
||||
// Range overlaps gap, so move gap to start of range.
|
||||
GapTo(position);
|
||||
return body + position + gapLength;
|
||||
} else {
|
||||
return body + position ;
|
||||
}
|
||||
} else {
|
||||
return body + position + gapLength;
|
||||
}
|
||||
}
|
||||
|
||||
int GapPosition() const {
|
||||
return part1Length;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -33,7 +33,7 @@ void FontAlias::ClearFont() {
|
||||
}
|
||||
|
||||
bool FontSpecification::EqualTo(const FontSpecification &other) const {
|
||||
return bold == other.bold &&
|
||||
return weight == other.weight &&
|
||||
italic == other.italic &&
|
||||
size == other.size &&
|
||||
characterSet == other.characterSet &&
|
||||
@ -45,10 +45,8 @@ FontMeasurements::FontMeasurements() {
|
||||
}
|
||||
|
||||
void FontMeasurements::Clear() {
|
||||
lineHeight = 2;
|
||||
ascent = 1;
|
||||
descent = 1;
|
||||
externalLeading = 0;
|
||||
aveCharWidth = 1;
|
||||
spaceWidth = 1;
|
||||
sizeZoomed = 2;
|
||||
@ -56,18 +54,18 @@ void FontMeasurements::Clear() {
|
||||
|
||||
Style::Style() : FontSpecification() {
|
||||
Clear(ColourDesired(0, 0, 0), ColourDesired(0xff, 0xff, 0xff),
|
||||
Platform::DefaultFontSize(), 0, SC_CHARSET_DEFAULT,
|
||||
false, false, false, false, caseMixed, true, true, false);
|
||||
Platform::DefaultFontSize() * SC_FONT_SIZE_MULTIPLIER, 0, SC_CHARSET_DEFAULT,
|
||||
SC_WEIGHT_NORMAL, false, false, false, caseMixed, true, true, false);
|
||||
}
|
||||
|
||||
Style::Style(const Style &source) : FontSpecification(), FontMeasurements() {
|
||||
Clear(ColourDesired(0, 0, 0), ColourDesired(0xff, 0xff, 0xff),
|
||||
0, 0, 0,
|
||||
false, false, false, false, caseMixed, true, true, false);
|
||||
fore.desired = source.fore.desired;
|
||||
back.desired = source.back.desired;
|
||||
SC_WEIGHT_NORMAL, false, false, false, caseMixed, true, true, false);
|
||||
fore = source.fore;
|
||||
back = source.back;
|
||||
characterSet = source.characterSet;
|
||||
bold = source.bold;
|
||||
weight = source.weight;
|
||||
italic = source.italic;
|
||||
size = source.size;
|
||||
eolFilled = source.eolFilled;
|
||||
@ -86,11 +84,11 @@ Style &Style::operator=(const Style &source) {
|
||||
return * this;
|
||||
Clear(ColourDesired(0, 0, 0), ColourDesired(0xff, 0xff, 0xff),
|
||||
0, 0, SC_CHARSET_DEFAULT,
|
||||
false, false, false, false, caseMixed, true, true, false);
|
||||
fore.desired = source.fore.desired;
|
||||
back.desired = source.back.desired;
|
||||
SC_WEIGHT_NORMAL, false, false, false, caseMixed, true, true, false);
|
||||
fore = source.fore;
|
||||
back = source.back;
|
||||
characterSet = source.characterSet;
|
||||
bold = source.bold;
|
||||
weight = source.weight;
|
||||
italic = source.italic;
|
||||
size = source.size;
|
||||
eolFilled = source.eolFilled;
|
||||
@ -103,13 +101,13 @@ Style &Style::operator=(const Style &source) {
|
||||
|
||||
void Style::Clear(ColourDesired fore_, ColourDesired back_, int size_,
|
||||
const char *fontName_, int characterSet_,
|
||||
bool bold_, bool italic_, bool eolFilled_,
|
||||
int weight_, bool italic_, bool eolFilled_,
|
||||
bool underline_, ecaseForced caseForce_,
|
||||
bool visible_, bool changeable_, bool hotspot_) {
|
||||
fore.desired = fore_;
|
||||
back.desired = back_;
|
||||
fore = fore_;
|
||||
back = back_;
|
||||
characterSet = characterSet_;
|
||||
bold = bold_;
|
||||
weight = weight_;
|
||||
italic = italic_;
|
||||
size = size_;
|
||||
fontName = fontName_;
|
||||
@ -125,12 +123,12 @@ void Style::Clear(ColourDesired fore_, ColourDesired back_, int size_,
|
||||
|
||||
void Style::ClearTo(const Style &source) {
|
||||
Clear(
|
||||
source.fore.desired,
|
||||
source.back.desired,
|
||||
source.fore,
|
||||
source.back,
|
||||
source.size,
|
||||
source.fontName,
|
||||
source.characterSet,
|
||||
source.bold,
|
||||
source.weight,
|
||||
source.italic,
|
||||
source.eolFilled,
|
||||
source.underline,
|
||||
|
@ -14,16 +14,16 @@ namespace Scintilla {
|
||||
|
||||
struct FontSpecification {
|
||||
const char *fontName;
|
||||
bool bold;
|
||||
int weight;
|
||||
bool italic;
|
||||
int size;
|
||||
int characterSet;
|
||||
int extraFontFlag;
|
||||
FontSpecification() :
|
||||
fontName(0),
|
||||
bold(false),
|
||||
weight(SC_WEIGHT_NORMAL),
|
||||
italic(false),
|
||||
size(10),
|
||||
size(10 * SC_FONT_SIZE_MULTIPLIER),
|
||||
characterSet(0),
|
||||
extraFontFlag(0) {
|
||||
}
|
||||
@ -43,12 +43,10 @@ public:
|
||||
};
|
||||
|
||||
struct FontMeasurements {
|
||||
unsigned int lineHeight;
|
||||
unsigned int ascent;
|
||||
unsigned int descent;
|
||||
unsigned int externalLeading;
|
||||
unsigned int aveCharWidth;
|
||||
unsigned int spaceWidth;
|
||||
XYPOSITION aveCharWidth;
|
||||
XYPOSITION spaceWidth;
|
||||
int sizeZoomed;
|
||||
FontMeasurements();
|
||||
void Clear();
|
||||
@ -58,8 +56,8 @@ struct FontMeasurements {
|
||||
*/
|
||||
class Style : public FontSpecification, public FontMeasurements {
|
||||
public:
|
||||
ColourPair fore;
|
||||
ColourPair back;
|
||||
ColourDesired fore;
|
||||
ColourDesired back;
|
||||
bool eolFilled;
|
||||
bool underline;
|
||||
enum ecaseForced {caseMixed, caseUpper, caseLower};
|
||||
@ -77,7 +75,7 @@ public:
|
||||
void Clear(ColourDesired fore_, ColourDesired back_,
|
||||
int size_,
|
||||
const char *fontName_, int characterSet_,
|
||||
bool bold_, bool italic_, bool eolFilled_,
|
||||
int weight_, bool italic_, bool eolFilled_,
|
||||
bool underline_, ecaseForced caseForce_,
|
||||
bool visible_, bool changeable_, bool hotspot_);
|
||||
void ClearTo(const Style &source);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user