Compare commits

..

1 Commits

Author SHA1 Message Date
Bryan Petty
65127978e7 This commit was manufactured by cvs2svn to create tag 'TESTED'.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/tags/TESTED@4425 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
1999-11-07 18:34:36 +00:00
5391 changed files with 1143859 additions and 360530 deletions

35
.cvsignore Normal file
View File

@@ -0,0 +1,35 @@
system.list
bin
.gdb_history
Test
config.cache
configarg.cache
config.status
system.list
linux.system.cache
wx-config
config.log
linux-gnu.system.cache
*.dsp
*.dsw
*.plg
*.opt
*.aps
*.ncb
*.pro
*.opt
*.d
*.swp
*.swo
Release
Debug
ReleaseDLL
DebugDLL
robert
stamp-h.in
Makefile
configure
setup.h
stamp-h
libtool
aclocal.m4

242
BuildCVS.txt Normal file
View File

@@ -0,0 +1,242 @@
------------------------------------------------------------------------
How to build the sources from CVS
------------------------------------------------------------------------
I) Windows using plain makefiles
----------------------------------------
a) If using Microsoft Visual C++ 5.0 or 6.0
Ensure that the command-line compiler and tools (including
nmake) are installed and ready to run. Depending on your
installation there may be a batch file (named something like
VCVARS32.BAT) that needs to be run to set correct environment
varaibles and PATH entries.
Continue with item c) below.
b) If using the GNU MinGW32 or GNU CygWin32 compilers
You'll need the compiler itself which is available from
http://www.cygwin.com
When using MingW32 you'll need GNU make which is a part
of the CygWin32 toolchain and is also available as a stand
alone port without the infamous Cygwin.dll from
http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32
The makefile has small problems with Cygwin<69>s tools
so it is recommended not to use these (but MingGW32
and its make.exe).
-> Set your path so that it includes the directory
where your compiler and tools reside
b-2) Using Mingw32 with gcc-2.95 and Anders Norlander's
Win32 headers
Using the newer gcc-2.95/Noralander header combination
will allow you to compile more of the MSW code, such
as OLE and Drag-n-Drop.
Instructions are similar to those for Regular Mingw32 except
->Get the compiler from
ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/gcc-2.95/
->patch the gcc headers with info in wxWin\Mingw32-gcc295.patches.
PLEASE APPLY THESE PATCHES BY HAND! There are apparently a few
different versions of the headers floating around.
->Edit wx/src/makeg95.env and set the MINGW32 variable at the top of
the file to either 1 (you have Mingw32) or 0 (you have Cygwin32).
If using MINGW32, also set the MINGW32VERSION variable
appropriately.
c) Build instructions
-> Assumming that you installed the wxWindows sources
into c:\wxWin
-> Copy c:\wxWin\include\wx\msw\setup0.h
to c:\wxWin\include\wx\msw\setup.h
-> Edit c:\wxWin\include\wx\msw\setup.h so that
most features are enabled (i.e. defined to 1) with
#define wxUSE_ODBC 0
#define wxUSE_SOCKETS 0
#define wxUSE_HTML 1
#define wxUSE_THREADS 1
#define wxUSE_FS_INET 0
#define wxUSE_FS_ZIP 1
#define wxUSE_BUSYINFO 1
#define wxUSE_DYNLIB_CLASS 1
#define wxUSE_ZIPSTREAM 1
#define wxUSE_LIBJPEG 1
#define wxUSE_LIBPNG 1
and iostreams ares disabled with
#define wxUSE_STD_IOSTREAM 0
note: ODBC and SOCKETS can be 1 for gcc-2.95
-> type: cd c:\wxWin\src\msw
-> type: make -f makefile.g95 (if using GNU tools)
or type: make -f makefile.vc (if using MS VC++)
II) Unix ports
--------------
Building wxGTK or wxMotif completely without configure
won't ever work, but there is now a new makefile system
that works without libtool and automake, using only
configure to create what is needed.
In order to create configure, you need to have the
GNU autoconf package (version 2.13 or 2.14) installed
on your system and type run "autoconf" in the base
directory (or run the autogen.sh script in the same
directory, which just calls autoconf).
Set WXWIN environment variable to the base directory such
as ~/wxWindows (this is actually not really needed).
-> type: export WXWIN=~/wxWindows
-> type: md mybuild
-> type: cd mybuild
-> type: ../configure --with-motif
or type: ../configure --with-gtk
-> type: make
-> type: su <type root password>
-> type: make install
-> type: ldconfig
-> type: exit
Call configure with --disable-shared to create a static
library. Calling "make uninstall" will remove the installed
library and "make dist" will create a distribution (not
yet complete).
III) Windows using configure
----------------------------------------
Take a look at Unix->Windows cross compiling. With minor
modifications, this should work in Windows if you've got the cygnus
utilities (bash, GNU make, etc) and either mingw32 or cygwin32 installed.
See http://www.cygnus.com for these programs, or go straight to their
ftp server at ftp://sourceware.cygnus.com/pub/cygwin/.
Of course, you can also build the library using plain makefiles (see
section I).
V) MacOS
----------------------------------------
VI) OS/2
----------------------------------------
VII) Unix->Windows cross-compiling using configure
--------------------------------------------------
First you'll need a cross-compiler; linux glibc binaries of mingw32 and
cygwin32 (both based on egcs) can be found at
ftp://ftp.objsw.com/pub/crossgcc/linux-x-win32. Otherwise you can
compile one yourself. Check the relevant FAQs.
[ A Note about cygwin32 and mingw32: the main difference is that cygwin32
binaries are always linked against cygwin.dll. This dll encapsulates most
standard Unix C extensions, which is very handy if you're porting unix
software to windows. However, wxMSW doesn't need this, so mingw32 is
preferable if you write portable C(++). ]
You might want to build both Unix and Windows binaries in the same source
tree; to do this make subdirs for each e.g. unix and win32. If you've
already build wxWindows in the main dir, do a 'make distclean' there,
otherwise configure will get confused. (In any case, read the section 'Unix
using configure' and make sure you're able to build a native wxWindows
library; cross-compiling errors can be pretty obscure and you'll want to be
sure that your configure setup is basically sound.)
To cross compile the windows library, do
-> cd win32
(or whatever you called it)
Now run configure. There are two ways to do this
-> ../configure --host=i586-mingw32 --build=i586-linux --with-mingw \
--enable-dnd=no --without-odbc
where --build= should read whatever platform you're building on. Configure
will notice that build and host platforms differ, and automatically prepend
i586-mingw32- to gcc, ar, ld, etc (make sure they're in the PATH!).
The other way to run configure is by specifying the names of the binaries
yourself:
-> CC=i586-mingw32-gcc CXX=i586-mingw32-g++ RANLIB=i586-mingw32-ranlib \
DLLTOOL=i586-mingw32-dlltool LD=i586-mingw32-ld NM=i586-mingw32-nm \
../configure --host=i586-mingw32 --with-mingw --enable-dnd=no
(all assuming you're using mingw32)
Drag'n'drop is disabled because mingw32 lacks (AFAIK) OLE headers.
[ Update: some new mingw32 versions now have a new set of windows header
files, which apparently can handle ole. Untested at the moment ]
ODBC files don't compile as of 13.10.99 - may be this will be fixed by the
moment you're reading these lines.
Configure will conclude that shared libraries are out of the question and
opt for a static one. I haven't looked into DLL creation yet.
Type
-> make
and wait, wait, wait. Don't leave the room, because the minute you do there
will be a compile error :-)
NB: you risk to get quite a few warnings about "ANSI C++ forbids implicit
conversion from 'void *'" in all places where va_arg macro is used. This
is due to a bug in (some versions of) mingw32 headers which may be
corrected by editing the file
${install_prefix}/lib/gcc-lib/i586-mingw32/egcs-2.91.57/include/stdarg.h
(instead of egcs-2.91.57 you may have something different), searching for
the lines
/* Define __gnuc_va_list. */
#ifndef __GNUC_VA_LIST
#define __GNUC_VA_LIST
#if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX) || defined(__NetBSD__)
typedef char *__gnuc_va_list;
#else
typedef void *__gnuc_va_list;
#endif
#endif
and adding "|| defined(_WIN32)" to the list of platforms on which
__gnuc_va_list is char *.
If this is successful, you end up with a libwx_msw.a in win32/lib. Now try
building the minimal sample:
-> cd samples/minimal
-> make
and run it with wine, for example (or copy to a Windows box)
-> wine minimal.exe
If all is well, do an install; from win32
-> make install
Native and cross-compiled installations can co-exist peacefully
(as long as their widget sets differ), except for wx-config. You might
want to rename the cross-compiled one to i586-mingw32-wx-config, or something.
Cross-compiling TODO:
---------------------
- resource compiling must be done manually for now (should/can we link the
default wx resources into libwx_msw.a?) [ No we can't; the linker won't
link it in... you have to supply an object file ]
- dynamic libraries
- static executables are HUGE -- there must be room for improvement.

2578
Makefile.in Normal file

File diff suppressed because it is too large Load Diff

116
Mingw32-gcc295.patches Normal file
View File

@@ -0,0 +1,116 @@
*** \gcc-inc\basetyps.h Sat Jul 31 16:48:36 1999
--- basetyps.h Fri Aug 06 11:14:36 1999
***************
*** 74,91 ****
--- 74,97 ----
STDMETHOD(Clone)(IENUM_THIS_(I) I**) PURE; \
}
#define DECLARE_ENUMERATOR(T) DECLARE_ENUMERATOR_(IEnum##T,T)
+ #ifndef GUID_DEFINED
+ #define GUID_DEFINED
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
+ #endif /* GUID_DEFINED */
typedef GUID *REFGUID;
typedef GUID *LPGUID;
+ #ifndef UUID_DEFINED
+ #define UUID_DEFINED
typedef GUID UUID;
+ #endif /* UUID_DEFINED */
typedef GUID IID;
typedef GUID CLSID;
typedef CLSID *LPCLSID;
typedef IID *LPIID;
*** \gcc-inc\oaidl.h Sat Jul 31 16:48:42 1999
--- oaidl.h Fri Aug 06 13:18:48 1999
***************
*** 39,44 ****
--- 39,53 ----
#define IMPLTYPEFLAG_FRESTRICTED 4
#define IMPLTYPEFLAG_FDEFAULTVTABLE 8
+ #define DISPID_UNKNOWN ( -1 )
+ #define DISPID_VALUE ( 0 )
+ #define DISPID_PROPERTYPUT ( -3 )
+ #define DISPID_NEWENUM ( -4 )
+ #define DISPID_EVALUATE ( -5 )
+ #define DISPID_CONSTRUCTOR ( -6 )
+ #define DISPID_DESTRUCTOR ( -7 )
+ #define DISPID_COLLECT ( -8 )
+
typedef interface ITypeLib *LPTYPELIB;
typedef interface ICreateTypeInfo *LPCREATETYPEINFO;
typedef interface ICreateTypeInfo2 *LPCREATETYPEINFO2;
***************
*** 49,54 ****
--- 58,73 ----
typedef interface IDispatch *LPDISPATCH;
typedef interface ICreateErrorInfo *LPCREATEERRORINFO;
+ extern "C" const IID IID_ITypeLib;
+ extern "C" const IID IID_ICreateTypeInfo;
+ extern "C" const IID IID_ICreateTypeInfo2;
+ extern "C" const IID IID_ICreateTypeLib;
+ extern "C" const IID IID_ICreateTypeLib2;
+ extern "C" const IID IID_ITypeInfo;
+ extern "C" const IID IID_IErrorInfo;
+ extern "C" const IID IID_IDispatch;
+ extern "C" const IID IID_ICreateErrorInfo;
+
typedef enum tagSYSKIND {
SYS_WIN16,SYS_WIN32,SYS_MAC
} SYSKIND;
***************
*** 375,382 ****
STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(GetTypeInfoCount)(THIS_ UINT*) PURE;
STDMETHOD(GetTypeInfo)(THIS_ UINT,LCID,LPTYPEINFO*) PURE;
! STDMETHOD(GetIDsOfNames)(THIS_ REFIID,LPOLESTR*,UINT,LCID,DISPID)
PURE;
! STDMETHOD(Invoked)(THIS_ DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*) PURE;
};
#ifdef __cplusplus
--- 394,401 ----
STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(GetTypeInfoCount)(THIS_ UINT*) PURE;
STDMETHOD(GetTypeInfo)(THIS_ UINT,LCID,LPTYPEINFO*) PURE;
! STDMETHOD(GetIDsOfNames)(THIS_ REFIID,LPOLESTR*,UINT,LCID,DISPID*)
PURE;
! STDMETHOD(Invoke)(THIS_ DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*) PURE;
};
#ifdef __cplusplus
*** \gcc-inc\objidl.h Sat Jul 31 16:48:42 1999
--- objidl.h Fri Aug 06 11:00:19 1999
***************
*** 627,633 ****
STDMETHOD(QueryGetData)(THIS_ FORMATETC*) PURE;
STDMETHOD(GetCanonicalFormatEtc)(THIS_ FORMATETC*,FORMATETC*) PURE;
STDMETHOD(SetData)(THIS_ FORMATETC*,STGMEDIUM*,BOOL) PURE;
! STDMETHOD(EnumFormatEtc)(THIS_ DWORD,IEnumFORMATETC*) PURE;
STDMETHOD(DAdvise)(THIS_ FORMATETC*,DWORD,IAdviseSink*,PDWORD) PURE;
STDMETHOD(DUnadvise)(THIS_ DWORD) PURE;
STDMETHOD(EnumDAdvise)(THIS_ IEnumSTATDATA**);
--- 627,633 ----
STDMETHOD(QueryGetData)(THIS_ FORMATETC*) PURE;
STDMETHOD(GetCanonicalFormatEtc)(THIS_ FORMATETC*,FORMATETC*) PURE;
STDMETHOD(SetData)(THIS_ FORMATETC*,STGMEDIUM*,BOOL) PURE;
! STDMETHOD(EnumFormatEtc)(THIS_ DWORD,IEnumFORMATETC**) PURE;
STDMETHOD(DAdvise)(THIS_ FORMATETC*,DWORD,IAdviseSink*,PDWORD) PURE;
STDMETHOD(DUnadvise)(THIS_ DWORD) PURE;
STDMETHOD(EnumDAdvise)(THIS_ IEnumSTATDATA**);

2
autogen.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
autoconf

951
config.guess vendored Executable file
View File

@@ -0,0 +1,951 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# 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.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Written by Per Bothner <bothner@cygnus.com>.
# The master version of this file is at the FSF in /home/gd/gnu/lib.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
# The plan is that this can be called by configure scripts if you
# don't specify an explicit system type (host/target name).
#
# Only a few systems have been added to this list; please add others
# (but try to keep the structure clean).
#
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 8/24/94.)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
alpha:OSF1:*:*)
if test $UNAME_RELEASE = "V4.0"; then
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
fi
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
cat <<EOF >dummy.s
.globl main
.ent main
main:
.frame \$30,0,\$26,0
.prologue 0
.long 0x47e03d80 # implver $0
lda \$2,259
.long 0x47e20c21 # amask $2,$1
srl \$1,8,\$2
sll \$2,2,\$2
sll \$0,3,\$0
addl \$1,\$0,\$0
addl \$2,\$0,\$0
ret \$31,(\$26),1
.end main
EOF
${CC-cc} dummy.s -o dummy 2>/dev/null
if test "$?" = 0 ; then
./dummy
case "$?" in
7)
UNAME_MACHINE="alpha"
;;
15)
UNAME_MACHINE="alphaev5"
;;
14)
UNAME_MACHINE="alphaev56"
;;
10)
UNAME_MACHINE="alphapca56"
;;
16)
UNAME_MACHINE="alphaev6"
;;
esac
fi
rm -f dummy.s dummy
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
exit 0 ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit 0 ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-cbm-sysv4
exit 0;;
amiga:NetBSD:*:*)
echo m68k-cbm-netbsd${UNAME_RELEASE}
exit 0 ;;
amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
exit 0 ;;
arc64:OpenBSD:*:*)
echo mips64el-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
arc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
hkmips:OpenBSD:*:*)
echo mips-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
pmax:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sgi:OpenBSD:*:*)
echo mips-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
wgrisc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
arm32:NetBSD:*:*)
echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
SR2?01:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
else
echo pyramid-pyramid-bsd
fi
exit 0 ;;
NILE:*:*:dcosx)
echo pyramid-pyramid-svr4
exit 0 ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
i86pc:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
exit 0 ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit 0 ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
echo m68k-sun-sunos${UNAME_RELEASE}
;;
sun4)
echo sparc-sun-sunos${UNAME_RELEASE}
;;
esac
exit 0 ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;;
atari*:NetBSD:*:*)
echo m68k-atari-netbsd${UNAME_RELEASE}
exit 0 ;;
atari*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sun3*:NetBSD:*:*)
echo m68k-sun-netbsd${UNAME_RELEASE}
exit 0 ;;
sun3*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mac68k:NetBSD:*:*)
echo m68k-apple-netbsd${UNAME_RELEASE}
exit 0 ;;
mac68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvme68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvme88k:OpenBSD:*:*)
echo m88k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;;
macppc:NetBSD:*:*)
echo powerpc-apple-netbsd${UNAME_RELEASE}
exit 0 ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit 0 ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
2020:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
exit 0 ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
sed 's/^ //' << EOF >dummy.c
int main (argc, argv) int argc; char **argv; {
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
${CC-cc} dummy.c -o dummy \
&& ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& rm dummy.c dummy && exit 0
rm -f dummy.c dummy
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit 0 ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
exit 0 ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
exit 0 ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
exit 0 ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
echo m88k-dg-dgux${UNAME_RELEASE}
else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else echo i586-dg-dgux${UNAME_RELEASE}
fi
exit 0 ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit 0 ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
exit 0 ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
exit 0 ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
exit 0 ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
exit 0 ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i?86:AIX:*:*)
echo i386-ibm-aix
exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
sed 's/^ //' << EOF >dummy.c
#include <sys/systemcfg.h>
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
exit 0 ;;
*:AIX:*:4)
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=4.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit 0 ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit 0 ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
exit 0 ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit 0 ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
exit 0 ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
exit 0 ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
exit 0 ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit 0 ;;
9000/[34678]??:HP-UX:*:*)
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/6?? | 9000/7?? | 9000/80[24] | 9000/8?[13679] | 9000/892 )
sed 's/^ //' << EOF >dummy.c
#include <stdlib.h>
#include <unistd.h>
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(${CC-cc} dummy.c -o dummy 2>/dev/null ) && HP_ARCH=`./dummy`
rm -f dummy.c dummy
esac
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
3050*:HI-UX:*:*)
sed 's/^ //' << EOF >dummy.c
#include <unistd.h>
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
exit 0 ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit 0 ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit 0 ;;
i?86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
echo ${UNAME_MACHINE}-unknown-osf1
fi
exit 0 ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit 0 ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit 0 ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit 0 ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
exit 0 ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
exit 0 ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit 0 ;;
CRAY*X-MP:*:*:*)
echo xmp-cray-unicos
exit 0 ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE}
exit 0 ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
exit 0 ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE}
exit 0 ;;
CRAY-2:*:*:*)
echo cray2-cray-unicos
exit 0 ;;
F300:UNIX_System_V:*:*)
FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
F301:UNIX_System_V:*:*)
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
exit 0 ;;
hp3[0-9][05]:NetBSD:*:*)
echo m68k-hp-netbsd${UNAME_RELEASE}
exit 0 ;;
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
i?86:BSD/386:*:* | *:BSD/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
*:NetBSD:*:*)
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
*:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin32
exit 0 ;;
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit 0 ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin32
exit 0 ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
*:GNU:*:*)
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
*:Linux:*:*)
# uname on the ARM produces all sorts of strangeness, and we need to
# filter it out.
case "$UNAME_MACHINE" in
arm* | sa110*) UNAME_MACHINE="arm" ;;
esac
# The BFD linker knows what the default object file format is, so
# first see if it will tell us.
ld_help_string=`ld --help 2>&1`
ld_supported_emulations=`echo $ld_help_string \
| sed -ne '/supported emulations:/!d
s/[ ][ ]*/ /g
s/.*supported emulations: *//
s/ .*//
p'`
case "$ld_supported_emulations" in
i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;;
esac
if test "${UNAME_MACHINE}" = "alpha" ; then
sed 's/^ //' <<EOF >dummy.s
.globl main
.ent main
main:
.frame \$30,0,\$26,0
.prologue 0
.long 0x47e03d80 # implver $0
lda \$2,259
.long 0x47e20c21 # amask $2,$1
srl \$1,8,\$2
sll \$2,2,\$2
sll \$0,3,\$0
addl \$1,\$0,\$0
addl \$2,\$0,\$0
ret \$31,(\$26),1
.end main
EOF
LIBC=""
${CC-cc} dummy.s -o dummy 2>/dev/null
if test "$?" = 0 ; then
./dummy
case "$?" in
7)
UNAME_MACHINE="alpha"
;;
15)
UNAME_MACHINE="alphaev5"
;;
14)
UNAME_MACHINE="alphaev56"
;;
10)
UNAME_MACHINE="alphapca56"
;;
16)
UNAME_MACHINE="alphaev6"
;;
esac
objdump --private-headers dummy | \
grep ld.so.1 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
fi
rm -f dummy.s dummy
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
elif test "${UNAME_MACHINE}" = "mips" ; then
cat >dummy.c <<EOF
main(argc, argv)
int argc;
char *argv[];
{
#ifdef __MIPSEB__
printf ("%s-unknown-linux-gnu\n", argv[1]);
#endif
#ifdef __MIPSEL__
printf ("%sel-unknown-linux-gnu\n", argv[1]);
#endif
return 0;
}
EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
else
# Either a pre-BFD a.out linker (linux-gnuoldld)
# or one that does not give us useful --help.
# GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
# If ld does not provide *any* "supported emulations:"
# that means it is gnuoldld.
echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
case "${UNAME_MACHINE}" in
i?86)
VENDOR=pc;
;;
*)
VENDOR=unknown;
;;
esac
# Determine whether the default compiler is a.out or elf
cat >dummy.c <<EOF
#include <features.h>
main(argc, argv)
int argc;
char *argv[];
{
#ifdef __ELF__
# ifdef __GLIBC__
# if __GLIBC__ >= 2
printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
# else
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
# endif
# else
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
# endif
#else
printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
#endif
return 0;
}
EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
fi ;;
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
# are messed up and put the nodename in both sysname and nodename.
i?86:DYNIX/ptx:4*:*)
echo i386-sequent-sysv4
exit 0 ;;
i?86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;;
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
fi
exit 0 ;;
i?86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
elif /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
i?86:UnixWare:*:*)
if /bin/uname -X 2>/dev/null >/dev/null ; then
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
fi
echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION}
exit 0 ;;
pc:*:*:*)
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386.
echo i386-pc-msdosdjgpp
exit 0 ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit 0 ;;
paragon:*:*:*)
echo i860-intel-osf1
exit 0 ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
exit 0 ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
exit 0 ;;
M68*:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4.3${OS_REL} && exit 0
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4 && exit 0 ;;
m68*:LynxOS:2.*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
i?86:LynxOS:2.*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit 0 ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit 0 ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
echo ${UNAME_MACHINE}-sni-sysv4
else
echo ns32k-sni-sysv
fi
exit 0 ;;
PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
exit 0 ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
exit 0 ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit 0 ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit 0 ;;
news*:NEWS-OS:*:6*)
echo mips-sony-newsos6
exit 0 ;;
R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit 0 ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit 0 ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos
exit 0 ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
cat >dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
printf ("arm-acorn-riscix"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
printf ("m68k-hp-bsd\n"); exit (0);
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-pc-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
#if !defined (ultrix)
printf ("vax-dec-bsd\n"); exit (0);
#else
printf ("vax-dec-ultrix\n"); exit (0);
#endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
# Convex versions that predate uname can use getsysinfo(1)
if [ -x /usr/convex/getsysinfo ]
then
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
exit 0 ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit 0 ;;
c34*)
echo c34-convex-bsd
exit 0 ;;
c38*)
echo c38-convex-bsd
exit 0 ;;
c4*)
echo c4-convex-bsd
exit 0 ;;
esac
fi
#echo '(Unable to guess system type)' 1>&2
exit 1

955
config.sub vendored Executable file
View File

@@ -0,0 +1,955 @@
#! /bin/sh
# Configuration validation subroutine script, version 1.1.
# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc.
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
#
# This file is free software; you can redistribute it and/or modify
# it 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
# Each package is responsible for reporting which valid configurations
# it does not support. The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.
# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or in some cases, the newer four-part form:
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
if [ x$1 = x ]
then
echo Configuration name missing. 1>&2
echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
echo "or $0 ALIAS" 1>&2
echo where ALIAS is a recognized configuration type. 1>&2
exit 1
fi
# First pass through any local machine types.
case $1 in
*local*)
echo $1
exit 0
;;
*)
;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
linux-gnu*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
then os=`echo $1 | sed 's/.*-/-/'`
else os=; fi
;;
esac
### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work. We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
case $os in
-sun*os*)
# Prevent following clause from handling this invalid input.
;;
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple)
os=
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
-sco5)
os=sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco4)
os=-sco3.2v4
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-isc)
os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-clix*)
basic_machine=clipper-intergraph
;;
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-lynx*)
os=-lynxos
;;
-ptx*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
;;
-windowsnt*)
os=`echo $os | sed -e 's/windowsnt/winnt/'`
;;
-psos*)
os=-psos
;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
| 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \
| alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
| i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
| mipstx39 | mipstx39el \
| sparc | sparclet | sparclite | sparc64 | v850)
basic_machine=$basic_machine-unknown
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i[34567]86)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
*-*-*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
# Recognize the basic CPU types with company name.
vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
| xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \
| alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
| ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
| sparc64-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* \
| mipstx39-* | mipstx39el-* \
| f301-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
alliant | fx80)
basic_machine=fx80-alliant
;;
altos | altos3068)
basic_machine=m68k-altos
;;
am29k)
basic_machine=a29k-none
os=-bsd
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
;;
amiga | amiga-*)
basic_machine=m68k-cbm
;;
amigaos | amigados)
basic_machine=m68k-cbm
os=-amigaos
;;
amigaunix | amix)
basic_machine=m68k-cbm
os=-sysv4
;;
apollo68)
basic_machine=m68k-apollo
os=-sysv
;;
aux)
basic_machine=m68k-apple
os=-aux
;;
balance)
basic_machine=ns32k-sequent
os=-dynix
;;
convex-c1)
basic_machine=c1-convex
os=-bsd
;;
convex-c2)
basic_machine=c2-convex
os=-bsd
;;
convex-c32)
basic_machine=c32-convex
os=-bsd
;;
convex-c34)
basic_machine=c34-convex
os=-bsd
;;
convex-c38)
basic_machine=c38-convex
os=-bsd
;;
cray | ymp)
basic_machine=ymp-cray
os=-unicos
;;
cray2)
basic_machine=cray2-cray
os=-unicos
;;
[ctj]90-cray)
basic_machine=c90-cray
os=-unicos
;;
crds | unos)
basic_machine=m68k-crds
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
;;
delta88)
basic_machine=m88k-motorola
os=-sysv3
;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
;;
dpx2* | dpx2*-bull)
basic_machine=m68k-bull
os=-sysv3
;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
;;
elxsi)
basic_machine=elxsi-elxsi
os=-bsd
;;
encore | umax | mmax)
basic_machine=ns32k-encore
;;
fx2800)
basic_machine=i860-alliant
;;
genix)
basic_machine=ns32k-ns
;;
gmicro)
basic_machine=tron-gmicro
os=-sysv
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
h8300hms)
basic_machine=h8300-hitachi
os=-hms
;;
harris)
basic_machine=m88k-harris
os=-sysv3
;;
hp300-*)
basic_machine=m68k-hp
;;
hp300bsd)
basic_machine=m68k-hp
os=-bsd
;;
hp300hpux)
basic_machine=m68k-hp
os=-hpux
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hppa-next)
os=-nextstep3
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
os=-mvs
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i[34567]86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
i[34567]86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
i[34567]86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
i[34567]86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
-irix*)
;;
*)
os=-irix4
;;
esac
;;
isi68 | isi)
basic_machine=m68k-isi
os=-sysv
;;
m88k-omron*)
basic_machine=m88k-omron
;;
magnum | m3230)
basic_machine=mips-mips
os=-sysv
;;
merlin)
basic_machine=ns32k-utek
os=-sysv
;;
miniframe)
basic_machine=m68000-convergent
;;
mipsel*-linux*)
basic_machine=mipsel-unknown
os=-linux-gnu
;;
mips*-linux*)
basic_machine=mips-unknown
os=-linux-gnu
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
;;
news1000)
basic_machine=m68030-sony
os=-newsos
;;
news-3600 | risc-news)
basic_machine=mips-sony
os=-newsos
;;
next | m*-next )
basic_machine=m68k-next
case $os in
-nextstep* )
;;
-ns2*)
os=-nextstep2
;;
*)
os=-nextstep3
;;
esac
;;
nh3000)
basic_machine=m68k-harris
os=-cxux
;;
nh[45]000)
basic_machine=m88k-harris
os=-cxux
;;
nindy960)
basic_machine=i960-intel
os=-nindy
;;
np1)
basic_machine=np1-gould
;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
paragon)
basic_machine=i860-intel
os=-osf
;;
pbd)
basic_machine=sparc-tti
;;
pbb)
basic_machine=m68k-tti
;;
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium | p5 | k5 | nexen)
basic_machine=i586-pc
;;
pentiumpro | p6 | k6 | 6x86)
basic_machine=i686-pc
;;
pentiumii | pentium2)
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | nexen-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | k6-* | 6x86-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-*)
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=rs6000-ibm
;;
ppc) basic_machine=powerpc-unknown
;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ps2)
basic_machine=i386-ibm
;;
rm[46]00)
basic_machine=mips-siemens
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
sequent)
basic_machine=i386-sequent
;;
sh)
basic_machine=sh-hitachi
os=-hms
;;
sps7)
basic_machine=m68k-bull
os=-sysv2
;;
spur)
basic_machine=spur-unknown
;;
sun2)
basic_machine=m68000-sun
;;
sun2os3)
basic_machine=m68000-sun
os=-sunos3
;;
sun2os4)
basic_machine=m68000-sun
os=-sunos4
;;
sun3os3)
basic_machine=m68k-sun
os=-sunos3
;;
sun3os4)
basic_machine=m68k-sun
os=-sunos4
;;
sun4os3)
basic_machine=sparc-sun
os=-sunos3
;;
sun4os4)
basic_machine=sparc-sun
os=-sunos4
;;
sun4sol2)
basic_machine=sparc-sun
os=-solaris2
;;
sun3 | sun3-*)
basic_machine=m68k-sun
;;
sun4)
basic_machine=sparc-sun
;;
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
symmetry)
basic_machine=i386-sequent
os=-dynix
;;
tx39)
basic_machine=mipstx39-unknown
;;
tx39el)
basic_machine=mipstx39el-unknown
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
udi29k)
basic_machine=a29k-amd
os=-udi
;;
ultra3)
basic_machine=a29k-nyu
os=-sym1
;;
vaxv)
basic_machine=vax-dec
os=-sysv
;;
vms)
basic_machine=vax-dec
os=-vms
;;
vpp*|vx|vx-*)
basic_machine=f301-fujitsu
;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
;;
vxworks68)
basic_machine=m68k-wrs
os=-vxworks
;;
vxworks29k)
basic_machine=a29k-wrs
os=-vxworks
;;
xmp)
basic_machine=xmp-cray
os=-unicos
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
none)
basic_machine=none-none
os=-none
;;
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
mips)
if [ x$os = x-linux-gnu ]; then
basic_machine=mips-unknown
else
basic_machine=mips-mips
fi
;;
romp)
basic_machine=romp-ibm
;;
rs6000)
basic_machine=rs6000-ibm
;;
vax)
basic_machine=vax-dec
;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
sparc)
basic_machine=sparc-sun
;;
cydra)
basic_machine=cydra-cydrome
;;
orion)
basic_machine=orion-highlevel
;;
orion105)
basic_machine=clipper-highlevel
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
esac
# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
*-digital*)
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
;;
*-commodore*)
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
;;
*)
;;
esac
# Decode manufacturer-specific aliases for certain operating systems.
if [ x"$os" != x"" ]
then
case $os in
# First match some system type aliases
# that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
-solaris)
os=-solaris2
;;
-svr4*)
os=-sysv4
;;
-unixware*)
os=-sysv4.2uw
;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
# First accept the basic system types.
# The portable systems comes first.
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
-sunos5*)
os=`echo $os | sed -e 's|sunos5|solaris2|'`
;;
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
-osfrose*)
os=-osfrose
;;
-osf*)
os=-osf
;;
-utek*)
os=-bsd
;;
-dynix*)
os=-bsd
;;
-acis*)
os=-aos
;;
-ctix* | -uts*)
os=-sysv
;;
-ns2 )
os=-nextstep2
;;
# Preserve the version number of sinix5.
-sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
;;
-sinix*)
os=-sysv4
;;
-triton*)
os=-sysv3
;;
-oss*)
os=-sysv3
;;
-svr4)
os=-sysv4
;;
-svr3)
os=-sysv3
;;
-sysvr4)
os=-sysv4
;;
# This must come after -sysvr4.
-sysv*)
;;
-xenix)
os=-xenix
;;
-none)
;;
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
exit 1
;;
esac
else
# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.
# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system. Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
case $basic_machine in
*-acorn)
os=-riscix1.2
;;
arm*-semi)
os=-aout
;;
pdp11-*)
os=-none
;;
*-dec | vax-*)
os=-ultrix4.2
;;
m68*-apollo)
os=-domain
;;
i386-sun)
os=-sunos4.0.2
;;
m68000-sun)
os=-sunos3
# This also exists in the configure program, but was not the
# default.
# os=-sunos4
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
sparc-* | *-sun)
os=-sunos4.1.1
;;
*-be)
os=-beos
;;
*-ibm)
os=-aix
;;
*-hp)
os=-hpux
;;
*-hitachi)
os=-hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
os=-sysv
;;
*-cbm)
os=-amigaos
;;
*-dg)
os=-dgux
;;
*-dolphin)
os=-sysv3
;;
m68k-ccur)
os=-rtu
;;
m88k-omron*)
os=-luna
;;
*-next )
os=-nextstep
;;
*-sequent)
os=-ptx
;;
*-crds)
os=-unos
;;
*-ns)
os=-genix
;;
i370-*)
os=-mvs
;;
*-next)
os=-nextstep3
;;
*-gould)
os=-sysv
;;
*-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
*-sgi)
os=-irix
;;
*-siemens)
os=-sysv4
;;
*-masscomp)
os=-rtu
;;
f301-fujitsu)
os=-uxpv
;;
*)
os=-none
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
*-unknown)
case $os in
-riscix*)
vendor=acorn
;;
-sunos*)
vendor=sun
;;
-aix*)
vendor=ibm
;;
-hpux*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
-unos*)
vendor=crds
;;
-dgux*)
vendor=dg
;;
-luna*)
vendor=omron
;;
-genix*)
vendor=ns
;;
-mvs*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-vxsim* | -vxworks*)
vendor=wrs
;;
-aux*)
vendor=apple
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os

12971
configure vendored Executable file

File diff suppressed because it is too large Load Diff

3123
configure.in Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,56 +0,0 @@
###############################################################################
# Purpose: Makefile.in for STC contrib for Unix with autoconf
# Created: 14.03.00
# Author: VZ
# Version: $Id$
###############################################################################
top_srcdir = @top_srcdir@/..
top_builddir = ../../..
scintilla_dir = $(top_srcdir)/contrib/src/stc/scintilla
libsrc_dir = contrib/src/stc@PATH_IFS@$(scintilla_dir)/src
TARGET_LIBNAME=libstc
LIBVERSION_CURRENT=1
LIBVERSION_REVISION=0
LIBVERSION_AGE=0
HEADER_PATH=$(top_srcdir)/contrib/include/wx
HEADER_SUBDIR=stc
HEADERS=stc.h
OBJECTS=PlatWX.o ScintillaWX.o stc.o \
DocumentAccessor.o \
LexCPP.o \
LexHTML.o \
LexLua.o \
LexOthers.o \
LexPerl.o \
LexPython.o \
LexSQL.o \
LexVB.o \
UniConversion.o \
WindowAccessor.o \
AutoComplete.o \
CallTip.o \
CellBuffer.o \
ContractionState.o \
Document.o \
Editor.o \
Indicator.o \
KeyMap.o \
KeyWords.o \
LineMarker.o \
PropSet.o \
ScintillaBase.o \
Style.o \
ViewStyle.o \
PosRegExp.o \
APPEXTRADEFS=-D__WX__ -DSCI_LEXER -I$(scintilla_dir)/src -I$(scintilla_dir)/include -I$(top_srcdir)/contrib/include
include $(top_builddir)/src/makelib.env

View File

@@ -1,712 +0,0 @@
// Scintilla source code edit control
// PlatWX.cxx - implementation of platform facilities on wxWindows
// Copyright 1998-1999 by Neil Hodgson <neilh@scintilla.org>
// Robin Dunn <robin@aldunn.com>
// The License.txt file describes the conditions under which this software may be distributed.
#include <ctype.h>
#include "Platform.h"
#include "wx/stc/stc.h"
#ifdef __WXGTK__
#include <gtk/gtk.h>
#endif
Point Point::FromLong(long lpoint) {
return Point(lpoint & 0xFFFF, lpoint >> 16);
}
wxRect wxRectFromPRectangle(PRectangle prc) {
wxRect rc(prc.left, prc.top,
prc.right-prc.left, prc.bottom-prc.top);
return rc;
}
PRectangle PRectangleFromwxRect(wxRect rc) {
return PRectangle(rc.GetLeft(), rc.GetTop(), rc.GetRight(), rc.GetBottom());
}
Colour::Colour(long lcol) {
co.Set(lcol & 0xff, (lcol >> 8) & 0xff, (lcol >> 16) & 0xff);
}
Colour::Colour(unsigned int red, unsigned int green, unsigned int blue) {
co.Set(red, green, blue);
}
bool Colour::operator==(const Colour &other) const {
return co == other.co;
}
long Colour::AsLong() const {
return (((long)co.Blue() << 16) |
((long)co.Green() << 8) |
((long)co.Red()));
}
unsigned int Colour::GetRed() {
return co.Red();
}
unsigned int Colour::GetGreen() {
return co.Green();
}
unsigned int Colour::GetBlue() {
return co.Blue();
}
Palette::Palette() {
used = 0;
allowRealization = false;
}
Palette::~Palette() {
Release();
}
void Palette::Release() {
used = 0;
}
// This method either adds a colour to the list of wanted colours (want==true)
// or retrieves the allocated colour back to the ColourPair.
// This is one method to make it easier to keep the code for wanting and retrieving in sync.
void Palette::WantFind(ColourPair &cp, bool want) {
if (want) {
for (int i=0; i < used; i++) {
if (entries[i].desired == cp.desired)
return;
}
if (used < numEntries) {
entries[used].desired = cp.desired;
entries[used].allocated = cp.desired;
used++;
}
} else {
for (int i=0; i < used; i++) {
if (entries[i].desired == cp.desired) {
cp.allocated = entries[i].allocated;
return;
}
}
cp.allocated = cp.desired;
}
}
void Palette::Allocate(Window &) {
if (allowRealization) {
}
}
Font::Font() {
id = 0;
ascent = 0;
}
Font::~Font() {
}
void Font::Create(const char *faceName, int characterSet, int size, bool bold, bool italic) {
Release();
id = new wxFont(size,
wxDEFAULT,
italic ? wxITALIC : wxNORMAL,
bold ? wxBOLD : wxNORMAL,
false,
faceName,
wxFONTENCODING_DEFAULT);
}
void Font::Release() {
if (id)
delete id;
id = 0;
}
Surface::Surface() :
hdc(0), hdcOwned(0), bitmap(0),
x(0), y(0) {
}
Surface::~Surface() {
Release();
}
void Surface::Release() {
if (bitmap) {
((wxMemoryDC*)hdc)->SelectObject(wxNullBitmap);
delete bitmap;
bitmap = 0;
}
if (hdcOwned) {
delete hdc;
hdc = 0;
hdcOwned = false;
}
}
bool Surface::Initialised() {
return hdc != 0;
}
void Surface::Init() {
Release();
hdc = new wxMemoryDC();
hdcOwned = true;
// **** ::SetTextAlign(hdc, TA_BASELINE);
}
void Surface::Init(SurfaceID hdc_) {
Release();
hdc = hdc_;
// **** ::SetTextAlign(hdc, TA_BASELINE);
}
void Surface::InitPixMap(int width, int height, Surface *surface_) {
Release();
hdc = new wxMemoryDC(surface_->hdc);
hdcOwned = true;
bitmap = new wxBitmap(width, height);
((wxMemoryDC*)hdc)->SelectObject(*bitmap);
// **** ::SetTextAlign(hdc, TA_BASELINE);
}
void Surface::PenColour(Colour fore) {
hdc->SetPen(wxPen(fore.co, 1, wxSOLID));
}
void Surface::BrushColor(Colour back) {
hdc->SetBrush(wxBrush(back.co, wxSOLID));
}
void Surface::SetFont(Font &font_) {
if (font_.GetID()) {
hdc->SetFont(*font_.GetID());
}
}
int Surface::LogPixelsY() {
return hdc->GetPPI().y;
}
int Surface::DeviceHeightFont(int points) {
return points * LogPixelsY() / 72;
}
void Surface::MoveTo(int x_, int y_) {
x = x_;
y = y_;
}
void Surface::LineTo(int x_, int y_) {
hdc->DrawLine(x,y, x_,y_);
x = x_;
y = y_;
}
void Surface::Polygon(Point *pts, int npts, Colour fore,
Colour back) {
PenColour(fore);
BrushColor(back);
hdc->DrawPolygon(npts, (wxPoint*)pts);
}
void Surface::RectangleDraw(PRectangle rc, Colour fore, Colour back) {
PenColour(fore);
BrushColor(back);
hdc->DrawRectangle(wxRectFromPRectangle(rc));
}
void Surface::FillRectangle(PRectangle rc, Colour back) {
BrushColor(back);
hdc->SetPen(*wxTRANSPARENT_PEN);
hdc->DrawRectangle(wxRectFromPRectangle(rc));
}
void Surface::FillRectangle(PRectangle rc, Surface &surfacePattern) {
wxBrush br;
if (surfacePattern.bitmap)
br = wxBrush(*surfacePattern.bitmap);
else // Something is wrong so display in red
br = wxBrush(*wxRED, wxSOLID);
hdc->SetPen(*wxTRANSPARENT_PEN);
hdc->SetBrush(br);
hdc->DrawRectangle(wxRectFromPRectangle(rc));
}
void Surface::RoundedRectangle(PRectangle rc, Colour fore, Colour back) {
PenColour(fore);
BrushColor(back);
hdc->DrawRoundedRectangle(wxRectFromPRectangle(rc), 4);
}
void Surface::Ellipse(PRectangle rc, Colour fore, Colour back) {
PenColour(fore);
BrushColor(back);
hdc->DrawEllipse(wxRectFromPRectangle(rc));
}
void Surface::Copy(PRectangle rc, Point from, Surface &surfaceSource) {
wxRect r = wxRectFromPRectangle(rc);
hdc->Blit(r.x, r.y, r.width, r.height,
surfaceSource.hdc, from.x, from.y, wxCOPY);
}
void Surface::DrawText(PRectangle rc, Font &font, int ybase,
const char *s, int len, Colour fore, Colour back) {
SetFont(font);
hdc->SetTextForeground(fore.co);
hdc->SetTextBackground(back.co);
FillRectangle(rc, back);
// ybase is where the baseline should be, but wxWin uses the upper left
// corner, so I need to calculate the real position for the text...
hdc->DrawText(wxString(s, len), rc.left, ybase - font.ascent);
}
void Surface::DrawTextClipped(PRectangle rc, Font &font, int ybase, const char *s, int len, Colour fore, Colour back) {
SetFont(font);
hdc->SetTextForeground(fore.co);
hdc->SetTextBackground(back.co);
FillRectangle(rc, back);
hdc->SetClippingRegion(wxRectFromPRectangle(rc));
// see comments above
hdc->DrawText(wxString(s, len), rc.left, ybase - font.ascent);
hdc->DestroyClippingRegion();
}
int Surface::WidthText(Font &font, const char *s, int len) {
SetFont(font);
int w;
int h;
hdc->GetTextExtent(wxString(s, len), &w, &h);
return w;
}
void Surface::MeasureWidths(Font &font, const char *s, int len, int *positions) {
SetFont(font);
int totalWidth = 0;
for (int i=0; i<len; i++) {
int w;
int h;
hdc->GetTextExtent(s[i], &w, &h);
totalWidth += w;
positions[i] = totalWidth;
}
}
int Surface::WidthChar(Font &font, char ch) {
SetFont(font);
int w;
int h;
hdc->GetTextExtent(ch, &w, &h);
return w;
}
#define EXTENT_TEST " `~!@#$%^&*()-_=+\\|[]{};:\"\'<,>.?/1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
int Surface::Ascent(Font &font) {
SetFont(font);
int w, h, d, e;
hdc->GetTextExtent(EXTENT_TEST, &w, &h, &d, &e);
font.ascent = h - d;
return font.ascent;
}
int Surface::Descent(Font &font) {
SetFont(font);
int w, h, d, e;
hdc->GetTextExtent(EXTENT_TEST, &w, &h, &d, &e);
return d;
}
int Surface::InternalLeading(Font &font) {
return 0;
}
int Surface::ExternalLeading(Font &font) {
SetFont(font);
int w, h, d, e;
hdc->GetTextExtent(EXTENT_TEST, &w, &h, &d, &e);
return e;
}
int Surface::Height(Font &font) {
SetFont(font);
return hdc->GetCharHeight();
}
int Surface::AverageCharWidth(Font &font) {
SetFont(font);
return hdc->GetCharWidth();
}
int Surface::SetPalette(Palette *pal, bool inBackGround) {
return 0; // **** figure out what to do with palettes...
}
void Surface::SetClip(PRectangle rc) {
hdc->SetClippingRegion(wxRectFromPRectangle(rc));
}
void Surface::FlushCachedState() {
}
Window::~Window() {
}
void Window::Destroy() {
if (id)
id->Destroy();
id = 0;
}
bool Window::HasFocus() {
return wxWindow::FindFocus() == id;
}
PRectangle Window::GetPosition() {
wxRect rc(id->GetPosition(), id->GetSize());
return PRectangleFromwxRect(rc);
}
void Window::SetPosition(PRectangle rc) {
wxRect r = wxRectFromPRectangle(rc);
id->SetSize(r);
}
void Window::SetPositionRelative(PRectangle rc, Window) {
SetPosition(rc); // ????
}
PRectangle Window::GetClientPosition() {
wxSize sz = id->GetClientSize();
return PRectangle(0, 0, sz.x, sz.y);
}
void Window::Show(bool show) {
id->Show(show);
}
void Window::InvalidateAll() {
id->Refresh(false);
}
void Window::InvalidateRectangle(PRectangle rc) {
wxRect r = wxRectFromPRectangle(rc);
id->Refresh(false, &r);
}
void Window::SetFont(Font &font) {
id->SetFont(*font.GetID());
}
void Window::SetCursor(Cursor curs) {
int cursorId;
switch (curs) {
case cursorText:
cursorId = wxCURSOR_IBEAM;
break;
case cursorArrow:
cursorId = wxCURSOR_ARROW;
break;
case cursorUp:
cursorId = wxCURSOR_ARROW; // ** no up arrow... wxCURSOR_UPARROW;
break;
case cursorWait:
cursorId = wxCURSOR_WAIT;
break;
case cursorHoriz:
cursorId = wxCURSOR_SIZEWE;
break;
case cursorVert:
cursorId = wxCURSOR_SIZENS;
break;
case cursorReverseArrow:
cursorId = wxCURSOR_POINT_RIGHT;
break;
default:
cursorId = wxCURSOR_ARROW;
break;
}
id->SetCursor(wxCursor(cursorId));
}
void Window::SetTitle(const char *s) {
id->SetTitle(s);
}
class wxSTCListBox : public wxListBox {
public:
wxSTCListBox(wxWindow* parent, wxWindowID id)
: wxListBox(parent, id, wxDefaultPosition, wxDefaultSize,
0, NULL, wxLB_SINGLE | wxLB_SORT | wxSIMPLE_BORDER)
{}
void OnFocus(wxFocusEvent& event) {
GetParent()->SetFocus();
event.Skip();
}
#ifdef __WXGTK__
void DoSetFirstItem(int n);
#endif
private:
DECLARE_EVENT_TABLE()
};
BEGIN_EVENT_TABLE(wxSTCListBox, wxListBox)
EVT_SET_FOCUS(wxSTCListBox::OnFocus)
END_EVENT_TABLE()
#ifdef __WXGTK__
// This can be removed after 2.2.2 I think
void wxSTCListBox::DoSetFirstItem( int n )
{
wxCHECK_RET( m_list, wxT("invalid listbox") );
if (gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (m_list))
return;
// terribly efficient
const gchar *vadjustment_key = "gtk-vadjustment";
guint vadjustment_key_id = g_quark_from_static_string (vadjustment_key);
GtkAdjustment *adjustment =
(GtkAdjustment*) gtk_object_get_data_by_id (GTK_OBJECT (m_list), vadjustment_key_id);
wxCHECK_RET( adjustment, wxT("invalid listbox code") );
GList *target = g_list_nth( m_list->children, n );
wxCHECK_RET( target, wxT("invalid listbox index") );
GtkWidget *item = GTK_WIDGET(target->data);
wxCHECK_RET( item, wxT("invalid listbox code") );
// find the last item before this one which is already realized
size_t nItemsBefore;
for ( nItemsBefore = 0; item && (item->allocation.y == -1); nItemsBefore++ )
{
target = target->prev;
if ( !target )
{
// nothing we can do if there are no allocated items yet
return;
}
item = GTK_WIDGET(target->data);
}
gtk_adjustment_set_value(adjustment,
item->allocation.y +
nItemsBefore*item->allocation.height);
}
#endif
ListBox::ListBox() {
}
ListBox::~ListBox() {
}
void ListBox::Create(Window &parent, int ctrlID) {
id = new wxSTCListBox(parent.id, ctrlID);
// id = new wxListBox(parent.id, ctrlID, wxDefaultPosition, wxDefaultSize,
// 0, NULL, wxLB_SINGLE | wxLB_SORT | wxSIMPLE_BORDER);
}
PRectangle ListBox::GetDesiredRect() {
wxSize sz = ((wxListBox*)id)->GetBestSize();
PRectangle rc;
rc.top = 0;
rc.left = 0;
if (sz.x > 150) // TODO: A better way to determine these max sizes
sz.x = 150;
if (sz.y > 100)
sz.y = 100;
rc.right = sz.x;
rc.bottom = sz.y;
return rc;
}
void ListBox::SetAverageCharWidth(int width) {
aveCharWidth = width;
}
void ListBox::SetFont(Font &font) {
Window::SetFont(font);
}
void ListBox::Clear() {
((wxListBox*)id)->Clear();
}
void ListBox::Append(char *s) {
((wxListBox*)id)->Append(s);
}
int ListBox::Length() {
return ((wxListBox*)id)->Number();
}
void ListBox::Select(int n) {
((wxListBox*)id)->SetSelection(n);
#ifdef __WXGTK__
if (n > 4)
n = n - 4;
else
n = 1;
((wxListBox*)id)->SetFirstItem(n);
#endif
}
int ListBox::GetSelection() {
return ((wxListBox*)id)->GetSelection();
}
int ListBox::Find(const char *prefix) {
if (prefix) {
for (int x=0; x < ((wxListBox*)id)->Number(); x++) {
wxString text = ((wxListBox*)id)->GetString(x);
if (text.StartsWith(prefix))
return x;
}
}
return -1;
}
void ListBox::GetValue(int n, char *value, int len) {
wxString text = ((wxListBox*)id)->GetString(n);
strncpy(value, text.c_str(), len);
value[len-1] = '\0';
}
void ListBox::Sort() {
// wxWindows keeps sorted so no need to sort
}
Menu::Menu() : id(0) {
}
void Menu::CreatePopUp() {
Destroy();
id = new wxMenu();
}
void Menu::Destroy() {
if (id)
delete id;
id = 0;
}
void Menu::Show(Point pt, Window &w) {
w.GetID()->PopupMenu(id, pt.x - 4, pt.y);
Destroy();
}
Colour Platform::Chrome() {
wxColour c;
c = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE);
return Colour(c.Red(), c.Green(), c.Blue());
}
Colour Platform::ChromeHighlight() {
wxColour c;
c = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DHIGHLIGHT);
return Colour(c.Red(), c.Green(), c.Blue());
}
const char *Platform::DefaultFont() {
return wxNORMAL_FONT->GetFaceName();
}
int Platform::DefaultFontSize() {
return 8;
}
unsigned int Platform::DoubleClickTime() {
return 500; // **** ::GetDoubleClickTime();
}
void Platform::DebugDisplay(const char *s) {
wxLogDebug(s);
}
bool Platform::IsKeyDown(int key) {
return false; // I don't think we'll need this.
}
long Platform::SendScintilla(WindowID w,
unsigned int msg,
unsigned long wParam,
long lParam) {
wxStyledTextCtrl* stc = (wxStyledTextCtrl*)w;
return stc->SendMsg(msg, wParam, lParam);
}
// These are utility functions not really tied to a platform
int Platform::Minimum(int a, int b) {
if (a < b)
return a;
else
return b;
}
int Platform::Maximum(int a, int b) {
if (a > b)
return a;
else
return b;
}
#define TRACE
void Platform::DebugPrintf(const char *format, ...) {
#ifdef TRACE
char buffer[2000];
va_list pArguments;
va_start(pArguments, format);
vsprintf(buffer,format,pArguments);
va_end(pArguments);
Platform::DebugDisplay(buffer);
#endif
}
int Platform::Clamp(int val, int minVal, int maxVal) {
if (val > maxVal)
val = maxVal;
if (val < minVal)
val = minVal;
return val;
}

View File

@@ -1,47 +0,0 @@
This contrib is the wxStyledTextCtrl, which is a wrapper around the
Scintilla edit control. (See www.scintilla.org)
There is still VERY MUCH to be done, most notable of which is a more
advanced sample that exercises more of the code. (I havn't tested
AutoComplete or CallTips, or most of the event types at all yet.) And
also documentation, adding wrappers for some new scintilla
functionality, building and testing on wxGTK, etc. Be patient, it all
will get there soon.
Let me describe a bit about the architecture I am implementing...
Obviously there is the Platform layer which implements the varioius
platform classes by using wxWindows classes and filling in where
needed. Then there is a ScintillaWX class that is derived from
ScintillaBase and implements the necessary virtual methods that
Scintilla needs to fully funciton. This class however is not meant to
ever be used directly by wx programmers. I call it one end of the
bridge between the wx and Scintilla worlds. The other end of the
bridge is a class called wxStyledTextCtrl that looks, feels and acts
like other classes in wxWindows. Here is a diagram:
+------------------+ +-------------------+
| wxStyledTextCtrl |--bridge--| ScintillaWX |
+------------------+ +-------------------+
| ScintillaBase |
+-------------------+
| Editor |
+-------------------+
| PlatWX |
+-------------------+
wxStyledTextCtrl derives from wxControl so it has a window that can be
drawn upon. When a wxStyledTextCtrl is constructed it constructs a
ScintillaWX for itself and passes itself to the scintilla object to be
set as the wMain and wDraw attributes. All method calls on the STC
are sent over the bridge in the form of calls to ScintiallWX::WndProc.
All notifications are sent back over the bridge and turned into
wxEvents.
Robin

View File

@@ -1,515 +0,0 @@
////////////////////////////////////////////////////////////////////////////
// Name: ScintillaWX.cxx
// Purpose: A wxWindows implementation of Scintilla. A class derived
// from ScintillaBase that uses the "wx platform" defined in
// PlatformWX.cxx This class is one end of a bridge between
// the wx world and the Scintilla world. It needs a peer
// object of type wxStyledTextCtrl to function.
//
// Author: Robin Dunn
//
// Created: 13-Jan-2000
// RCS-ID: $Id$
// Copyright: (c) 2000 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#include <ctype.h>
#include "ScintillaWX.h"
#include "wx/stc/stc.h"
//----------------------------------------------------------------------
const int H_SCROLL_MAX = 2000;
const int H_SCROLL_STEP = 20;
const int H_SCROLL_PAGE = 200;
//----------------------------------------------------------------------
// Helper classes
class wxSTCTimer : public wxTimer {
public:
wxSTCTimer(ScintillaWX* swx) {
this->swx = swx;
}
void Notify() {
swx->DoTick();
}
private:
ScintillaWX* swx;
};
bool wxSTCDropTarget::OnDropText(wxCoord x, wxCoord y, const wxString& data) {
return swx->DoDropText(x, y, data);
}
wxDragResult wxSTCDropTarget::OnEnter(wxCoord x, wxCoord y, wxDragResult def) {
return swx->DoDragEnter(x, y, def);
}
wxDragResult wxSTCDropTarget::OnDragOver(wxCoord x, wxCoord y, wxDragResult def) {
return swx->DoDragOver(x, y, def);
}
void wxSTCDropTarget::OnLeave() {
swx->DoDragLeave();
}
class wxSTCCallTip : public wxWindow {
public:
wxSTCCallTip(wxWindow* parent, int ID, CallTip* ct)
: wxWindow(parent, ID)
{
m_ct = ct;
}
void OnPaint(wxPaintEvent& evt) {
wxPaintDC dc(this);
Surface surfaceWindow;
surfaceWindow.Init(&dc);
m_ct->PaintCT(&surfaceWindow);
surfaceWindow.Release();
}
CallTip* m_ct;
DECLARE_EVENT_TABLE()
};
BEGIN_EVENT_TABLE(wxSTCCallTip, wxWindow)
EVT_PAINT(wxSTCCallTip::OnPaint)
END_EVENT_TABLE()
//----------------------------------------------------------------------
// Constructor/Destructor
ScintillaWX::ScintillaWX(wxStyledTextCtrl* win) {
capturedMouse = false;
wMain = win;
wDraw = win;
stc = win;
Initialise();
}
ScintillaWX::~ScintillaWX() {
SetTicking(false);
}
//----------------------------------------------------------------------
// base class virtuals
void ScintillaWX::Initialise() {
//ScintillaBase::Initialise();
dropTarget = new wxSTCDropTarget;
dropTarget->SetScintilla(this);
stc->SetDropTarget(dropTarget);
}
void ScintillaWX::Finalise() {
ScintillaBase::Finalise();
}
void ScintillaWX::StartDrag() {
wxDropSource source(wMain.GetID());
wxTextDataObject data(dragChars);
wxDragResult result;
source.SetData(data);
result = source.DoDragDrop(TRUE);
if (result == wxDragMove && dropWentOutside)
ClearSelection();
inDragDrop = FALSE;
SetDragPosition(invalidPosition);
}
void ScintillaWX::SetTicking(bool on) {
wxSTCTimer* steTimer;
if (timer.ticking != on) {
timer.ticking = on;
if (timer.ticking) {
steTimer = new wxSTCTimer(this);
steTimer->Start(timer.tickSize);
timer.tickerID = (int)steTimer;
} else {
steTimer = (wxSTCTimer*)timer.tickerID;
steTimer->Stop();
delete steTimer;
timer.tickerID = 0;
}
}
timer.ticksToWait = caret.period;
}
void ScintillaWX::SetMouseCapture(bool on) {
if (on && !capturedMouse)
wMain.GetID()->CaptureMouse();
else if (!on && capturedMouse)
wMain.GetID()->ReleaseMouse();
capturedMouse = on;
}
bool ScintillaWX::HaveMouseCapture() {
return capturedMouse;
}
void ScintillaWX::ScrollText(int linesToMove) {
int dy = vs.lineHeight * (linesToMove);
// TODO: calculate the rectangle to refreshed...
wMain.GetID()->ScrollWindow(0, dy);
}
void ScintillaWX::SetVerticalScrollPos() {
wMain.GetID()->SetScrollPos(wxVERTICAL, topLine);
}
void ScintillaWX::SetHorizontalScrollPos() {
wMain.GetID()->SetScrollPos(wxHORIZONTAL, xOffset);
}
bool ScintillaWX::ModifyScrollBars(int nMax, int nPage) {
bool modified = false;
int sbMax = wMain.GetID()->GetScrollRange(wxVERTICAL);
int sbThumb = wMain.GetID()->GetScrollThumb(wxVERTICAL);
int sbPos = wMain.GetID()->GetScrollPos(wxVERTICAL);
if (sbMax != nMax || sbThumb != nPage) {
wMain.GetID()->SetScrollbar(wxVERTICAL, sbPos, nPage, nMax);
modified = true;
}
sbMax = wMain.GetID()->GetScrollRange(wxHORIZONTAL);
sbThumb = wMain.GetID()->GetScrollThumb(wxHORIZONTAL);
if ((sbMax != H_SCROLL_MAX) || (sbThumb != H_SCROLL_STEP)) {
wMain.GetID()->SetScrollbar(wxHORIZONTAL, 0, H_SCROLL_STEP, H_SCROLL_MAX);
modified = true;
}
return modified;
}
void ScintillaWX::NotifyChange() {
stc->NotifyChange();
}
void ScintillaWX::NotifyParent(SCNotification scn) {
stc->NotifyParent(&scn);
}
void ScintillaWX::Copy() {
if (currentPos != anchor) {
char* text = CopySelectionRange();
wxTheClipboard->Open();
wxTheClipboard->SetData(new wxTextDataObject(text));
wxTheClipboard->Close();
}
}
void ScintillaWX::Paste() {
pdoc->BeginUndoAction();
ClearSelection();
wxTextDataObject data;
bool canPaste;
wxTheClipboard->Open();
canPaste = wxTheClipboard->GetData(data);
wxTheClipboard->Close();
if (canPaste) {
wxString str = data.GetText();
int len = str.Length();
pdoc->InsertString(currentPos, str.c_str(), len);
SetEmptySelection(currentPos + len);
}
pdoc->EndUndoAction();
NotifyChange();
Redraw();
}
bool ScintillaWX::CanPaste() {
wxTextDataObject data;
bool canPaste;
wxTheClipboard->Open();
canPaste = wxTheClipboard->GetData(data);
wxTheClipboard->Close();
return canPaste;
}
void ScintillaWX::CreateCallTipWindow(PRectangle) {
ct.wCallTip = new wxSTCCallTip(wDraw.GetID(), -1, &ct);
ct.wDraw = ct.wCallTip;
}
void ScintillaWX::AddToPopUp(const char *label, int cmd, bool enabled) {
if (!label[0])
popup.GetID()->AppendSeparator();
else
popup.GetID()->Append(cmd, label);
if (!enabled)
popup.GetID()->Enable(cmd, enabled);
}
void ScintillaWX::ClaimSelection() {
}
long ScintillaWX::DefWndProc(unsigned int /*iMessage*/, unsigned long /*wParam*/, long /*lParam*/) {
return 0;
}
long ScintillaWX::WndProc(unsigned int iMessage, unsigned long wParam, long lParam) {
// switch (iMessage) {
// case EM_CANPASTE:
// return CanPaste();
// default:
return ScintillaBase::WndProc(iMessage, wParam, lParam);
// }
// return 0;
}
//----------------------------------------------------------------------
// Event delegates
void ScintillaWX::DoPaint(wxDC* dc, wxRect rect) {
paintState = painting;
Surface surfaceWindow;
surfaceWindow.Init(dc);
PRectangle rcPaint = PRectangleFromwxRect(rect);
dc->BeginDrawing();
Paint(&surfaceWindow, rcPaint);
dc->EndDrawing();
surfaceWindow.Release();
if (paintState == paintAbandoned) {
// Painting area was insufficient to cover new styling or brace highlight positions
FullPaint();
}
paintState = notPainting;
#ifdef __WXGTK__
// On wxGTK the editor window paints can overwrite the listbox...
if (ac.Active())
((wxWindow*)ac.lb.GetID())->Refresh(TRUE);
#endif
}
void ScintillaWX::DoHScroll(int type, int pos) {
int xPos = xOffset;
switch (type) {
case wxEVT_SCROLLWIN_LINEUP:
xPos -= H_SCROLL_STEP;
break;
case wxEVT_SCROLLWIN_LINEDOWN:
xPos += H_SCROLL_STEP;
break;
case wxEVT_SCROLLWIN_PAGEUP:
xPos -= H_SCROLL_PAGE;
break;
case wxEVT_SCROLLWIN_PAGEDOWN:
xPos += H_SCROLL_PAGE;
break;
case wxEVT_SCROLLWIN_TOP:
xPos = 0;
break;
case wxEVT_SCROLLWIN_BOTTOM:
xPos = H_SCROLL_MAX;
break;
case wxEVT_SCROLLWIN_THUMBTRACK:
xPos = pos;
break;
}
HorizontalScrollTo(xPos);
}
void ScintillaWX::DoVScroll(int type, int pos) {
int topLineNew = topLine;
switch (type) {
case wxEVT_SCROLLWIN_LINEUP:
topLineNew -= 1;
break;
case wxEVT_SCROLLWIN_LINEDOWN:
topLineNew += 1;
break;
case wxEVT_SCROLLWIN_PAGEUP:
topLineNew -= LinesToScroll();
break;
case wxEVT_SCROLLWIN_PAGEDOWN:
topLineNew += LinesToScroll();
break;
case wxEVT_SCROLLWIN_TOP:
topLineNew = 0;
break;
case wxEVT_SCROLLWIN_BOTTOM:
topLineNew = MaxScrollPos();
break;
case wxEVT_SCROLLWIN_THUMBTRACK:
topLineNew = pos;
break;
}
ScrollTo(topLineNew);
}
void ScintillaWX::DoSize(int width, int height) {
PRectangle rcClient(0,0,width,height);
SetScrollBarsTo(rcClient);
DropGraphics();
}
void ScintillaWX::DoLoseFocus(){
DropCaret();
}
void ScintillaWX::DoGainFocus(){
ShowCaretAtCurrentPosition();
}
void ScintillaWX::DoSysColourChange() {
InvalidateStyleData();
}
void ScintillaWX::DoButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt) {
ButtonDown(pt, curTime, shift, ctrl, alt);
}
void ScintillaWX::DoButtonUp(Point pt, unsigned int curTime, bool ctrl) {
ButtonUp(pt, curTime, ctrl);
}
void ScintillaWX::DoButtonMove(Point pt) {
ButtonMove(pt);
}
void ScintillaWX::DoAddChar(char ch) {
//bool acActiveBeforeCharAdded = ac.Active();
AddChar(ch);
//if (acActiveBeforeCharAdded)
// AutoCompleteChanged(ch);
}
int ScintillaWX::DoKeyDown(int key, bool shift, bool ctrl, bool alt) {
switch (key) {
case WXK_DOWN: key = SCK_DOWN; break;
case WXK_UP: key = SCK_UP; break;
case WXK_LEFT: key = SCK_LEFT; break;
case WXK_RIGHT: key = SCK_RIGHT; break;
case WXK_HOME: key = SCK_HOME; break;
case WXK_END: key = SCK_END; break;
case WXK_PRIOR: key = SCK_PRIOR; break;
case WXK_NEXT: key = SCK_NEXT; break;
case WXK_DELETE: key = SCK_DELETE; break;
case WXK_INSERT: key = SCK_INSERT; break;
case WXK_ESCAPE: key = SCK_ESCAPE; break;
case WXK_BACK: key = SCK_BACK; break;
case WXK_TAB: key = SCK_TAB; break;
case WXK_RETURN: key = SCK_RETURN; break;
case WXK_ADD: key = SCK_ADD; break;
case WXK_SUBTRACT: key = SCK_SUBTRACT; break;
case WXK_DIVIDE: key = SCK_DIVIDE; break;
case WXK_CONTROL: key = 0; break;
case WXK_ALT: key = 0; break;
case WXK_SHIFT: key = 0; break;
}
return KeyDown(key, shift, ctrl, alt);
}
void ScintillaWX::DoCommand(int ID) {
Command(ID);
}
void ScintillaWX::DoContextMenu(Point pt) {
ContextMenu(pt);
}
void ScintillaWX::DoOnListBox() {
AutoCompleteCompleted();
}
//----------------------------------------------------------------------
bool ScintillaWX::DoDropText(long x, long y, const wxString& data) {
SetDragPosition(invalidPosition);
int movePos = PositionFromLocation(Point(x,y));
DropAt(movePos, data, dragResult == wxDragMove, FALSE); // TODO: rectangular?
return TRUE;
}
wxDragResult ScintillaWX::DoDragEnter(wxCoord x, wxCoord y, wxDragResult def) {
return def;
}
wxDragResult ScintillaWX::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) {
SetDragPosition(PositionFromLocation(Point(x, y)));
dragResult = def;
return def;
}
void ScintillaWX::DoDragLeave() {
SetDragPosition(invalidPosition);
}
//----------------------------------------------------------------------
// Redraw all of text area. This paint will not be abandoned.
void ScintillaWX::FullPaint() {
paintState = painting;
// rcPaint = GetTextRectangle();
// wxClientDC dc(wMain.GetID());
// Surface surfaceWindow;
// surfaceWindow.Init(&dc);
// Paint(&surfaceWindow, rcPaint);
// surfaceWindow.Release();
wMain.GetID()->Refresh(FALSE);
paintState = notPainting;
}
void ScintillaWX::DoScrollToLine(int line) {
ScrollTo(line);
}
void ScintillaWX::DoScrollToColumn(int column) {
HorizontalScrollTo(column * vs.spaceWidth);
}
//----------------------------------------------------------------------
//----------------------------------------------------------------------

View File

@@ -1,152 +0,0 @@
////////////////////////////////////////////////////////////////////////////
// Name: ScintillaWX.h
// Purpose: A wxWindows implementation of Scintilla. A class derived
// from ScintillaBase that uses the "wx platform" defined in
// PlatWX.cpp. This class is one end of a bridge between
// the wx world and the Scintilla world. It needs a peer
// object of type wxStyledTextCtrl to function.
//
// Author: Robin Dunn
//
// Created: 13-Jan-2000
// RCS-ID: $Id$
// Copyright: (c) 2000 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef __ScintillaWX_h__
#define __ScintillaWX_h__
//----------------------------------------------------------------------
#include "Platform.h"
#include "Scintilla.h"
#ifdef SCI_LEXER
#include "SciLexer.h"
#include "PropSet.h"
#include "Accessor.h"
#include "KeyWords.h"
#endif
#include "ContractionState.h"
#include "SVector.h"
#include "CellBuffer.h"
#include "CallTip.h"
#include "KeyMap.h"
#include "Indicator.h"
#include "LineMarker.h"
#include "Style.h"
#include "ViewStyle.h"
#include "AutoComplete.h"
#include "Document.h"
#include "Editor.h"
#include "ScintillaBase.h"
#include <wx/wx.h>
#include <wx/dataobj.h>
#include <wx/clipbrd.h>
#include <wx/dnd.h>
//----------------------------------------------------------------------
class wxStyledTextCtrl; // forward
class ScintillaWX;
//----------------------------------------------------------------------
// Helper classes
class wxSTCDropTarget : public wxTextDropTarget {
public:
void SetScintilla(ScintillaWX* swx) {
this->swx = swx;
}
bool OnDropText(wxCoord x, wxCoord y, const wxString& data);
wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult def);
wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def);
void OnLeave();
private:
ScintillaWX* swx;
};
//----------------------------------------------------------------------
class ScintillaWX : public ScintillaBase {
public:
ScintillaWX(wxStyledTextCtrl* win);
~ScintillaWX();
// base class virtuals
virtual void Initialise();
virtual void Finalise();
virtual void StartDrag();
virtual void SetTicking(bool on);
virtual void SetMouseCapture(bool on);
virtual bool HaveMouseCapture();
virtual void ScrollText(int linesToMove);
virtual void SetVerticalScrollPos();
virtual void SetHorizontalScrollPos();
virtual bool ModifyScrollBars(int nMax, int nPage);
virtual void Copy();
virtual void Paste();
virtual void CreateCallTipWindow(PRectangle rc);
virtual void AddToPopUp(const char *label, int cmd = 0, bool enabled = true);
virtual void ClaimSelection();
virtual long DefWndProc(unsigned int iMessage,
unsigned long wParam,
long lParam);
virtual long WndProc(unsigned int iMessage,
unsigned long wParam,
long lParam);
virtual void NotifyChange();
virtual void NotifyParent(SCNotification scn);
// Event delegates
void DoPaint(wxDC* dc, wxRect rect);
void DoHScroll(int type, int pos);
void DoVScroll(int type, int pos);
void DoSize(int width, int height);
void DoLoseFocus();
void DoGainFocus();
void DoSysColourChange();
void DoButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt);
void DoButtonUp(Point pt, unsigned int curTime, bool ctrl);
void DoButtonMove(Point pt);
void DoAddChar(char ch);
int DoKeyDown(int key, bool shift, bool ctrl, bool alt);
void DoTick() { Tick(); }
bool DoDropText(long x, long y, const wxString& data);
wxDragResult DoDragEnter(wxCoord x, wxCoord y, wxDragResult def);
wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def);
void DoDragLeave();
void DoCommand(int ID);
void DoContextMenu(Point pt);
void DoOnListBox();
// helpers
void FullPaint();
bool CanPaste();
bool GetHideSelection() { return hideSelection; }
void DoScrollToLine(int line);
void DoScrollToColumn(int column);
private:
bool capturedMouse;
wxStyledTextCtrl* stc;
wxSTCDropTarget* dropTarget;
wxDragResult dragResult;
};
//----------------------------------------------------------------------
#endif

View File

@@ -1,250 +0,0 @@
# Microsoft Developer Studio Project File - Name="StcVC" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 5.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=StcVC - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "StcVC.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "StcVC.mak" CFG="StcVC - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "StcVC - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "StcVC - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
!IF "$(CFG)" == "StcVC - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
RSC=rc.exe
# ADD BASE RSC /l 0x809
# ADD RSC /l 0x809
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "../../../include" /I "../../include" /I "scintilla/include" /I "scintilla/src" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D "__WX__" /D "SCI_LEXER" /FD /c
# SUBTRACT CPP /YX
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\..\lib\stc.lib"
!ELSEIF "$(CFG)" == "StcVC - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
RSC=rc.exe
# ADD BASE RSC /l 0x809
# ADD RSC /l 0x809
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "../../../include" /I "../../include" /I "scintilla/include" /I "scintilla/src" /D "_DEBUG" /D DEBUG=1 /D "__WXDEBUG__" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D "__WX__" /D "SCI_LEXER" /FD /c
# SUBTRACT CPP /YX
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\..\lib\stcd.lib"
!ENDIF
# Begin Target
# Name "StcVC - Win32 Release"
# Name "StcVC - Win32 Debug"
# Begin Group "Stc"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\PlatWX.cpp
# End Source File
# Begin Source File
SOURCE=.\ScintillaWX.cpp
# End Source File
# Begin Source File
SOURCE=.\ScintillaWX.h
# End Source File
# Begin Source File
SOURCE=.\stc.cpp
# End Source File
# End Group
# Begin Group "Scintilla"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\scintilla\src\Accessor.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\AutoComplete.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\AutoComplete.h
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\CallTip.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\CallTip.h
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\CellBuffer.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\CellBuffer.h
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\ContractionState.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\ContractionState.h
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\Document.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\Document.h
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\Editor.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\Editor.h
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\Indicator.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\Indicator.h
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\KeyMap.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\KeyMap.h
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\KeyWords.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\LexCPP.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\LexHTML.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\LexOthers.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\LexPerl.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\LexPython.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\LexSQL.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\LexVB.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\LineMarker.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\LineMarker.h
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\PropSet.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\ScintillaBase.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\ScintillaBase.h
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\Style.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\Style.h
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\SVector.h
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\ViewStyle.cxx
# End Source File
# Begin Source File
SOURCE=.\scintilla\src\ViewStyle.h
# End Source File
# End Group
# End Target
# End Project

View File

@@ -1,29 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "StcVC"=.\StcVC.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@@ -1,684 +0,0 @@
#!/bin/env python
#----------------------------------------------------------------------------
# Name: gen_iface.py
# Purpose: Generate stc.h and stc.cpp from the info in Scintilla.iface
#
# Author: Robin Dunn
#
# Created: 5-Sept-2000
# RCS-ID: $Id$
# Copyright: (c) 2000 by Total Control Software
# Licence: wxWindows license
#----------------------------------------------------------------------------
import sys, string, re
from fileinput import FileInput
IFACE = './scintilla/include/Scintilla.iface'
H_TEMPLATE = './stc.h.in'
CPP_TEMPLATE = './stc.cpp.in'
H_DEST = '../../include/wx/stc/stc.h' # './stc_test.h' #
CPP_DEST = './stc.cpp' #'./stc_test.cpp'
# Value prefixes to convert
valPrefixes = [('SCI_', ''),
('SC_', ''),
('SCN_', None), # just toss these...
('SCEN_', None),
('SCE_', ''),
('SCLEX_', 'LEX_'),
('SCK_', 'KEY_'),
('SCFIND_', 'FIND_'),
('SCWS_', 'WS_'),
]
# Message funcion values that should have a CMD_ constant as well
cmdValues = [ (2300, 2350), 2011, 2013, (2176, 2180) ]
# Map some generic typenames to wx types, using return value syntax
retTypeMap = {
'position': 'int',
'string': 'wxString',
'colour': 'wxColour',
}
# Map some generic typenames to wx types, using parameter syntax
paramTypeMap = {
'position': 'int',
'string': 'const wxString&',
'colour': 'const wxColour&',
'keymod': 'int',
}
# Map of method info that needs tweaked. Either the name needs changed, or
# the method definition/implementation. Tuple items are:
#
# 1. New method name. None to skip the method, 0 to leave the
# default name.
# 2. Method definition for the .h file, 0 to leave alone
# 3. Method implementation for the .cpp file, 0 to leave alone.
# 4. tuple of Doc string lines, or 0 to leave alone.
#
methodOverrideMap = {
'AddText' : (0,
'void %s(const wxString& text);',
'''void %s(const wxString& text) {
SendMsg(%s, text.Len(), (long)text.c_str());''',
0),
'AddStyledText' : (0,
'void %s(const wxString& text);',
'''void %s(const wxString& text) {
SendMsg(%s, text.Len(), (long)text.c_str());''',
0),
'GetViewWS' : ( 'GetViewWhiteSpace', 0, 0, 0),
'SetViewWS' : ( 'SetViewWhiteSpace', 0, 0, 0),
'GetStyledText' : (0,
'wxString %s(int startPos, int endPos);',
'''wxString %s(int startPos, int endPos) {
wxString text;
int len = endPos - startPos;
TextRange tr;
tr.lpstrText = text.GetWriteBuf(len*2+1);
tr.chrg.cpMin = startPos;
tr.chrg.cpMax = endPos;
SendMsg(%s, 0, (long)&tr);
text.UngetWriteBuf(len*2);
return text;''',
('Retrieve a buffer of cells.',)),
'PositionFromPoint' : (0,
'int %s(wxPoint pt);',
'''int %s(wxPoint pt) {
return SendMsg(%s, pt.x, pt.y);''',
0),
'GetCurLine' : (0,
'wxString %s(int* OUTPUT=NULL);',
'''wxString %s(int* linePos) {
wxString text;
int len = LineLength(GetCurrentLine());
char* buf = text.GetWriteBuf(len+1);
int pos = SendMsg(%s, len, (long)buf);
text.UngetWriteBuf();
if (linePos) *linePos = pos;
return text;''',
0),
'SetUsePalette' : (None, 0,0,0),
'MarkerSetFore' : ('MarkerSetForeground', 0, 0, 0),
'MarkerSetBack' : ('MarkerSetBackground', 0, 0, 0),
'MarkerDefine' : (0,
'''void %s(int markerNumber, int markerSymbol,
const wxColour& foreground = wxNullColour,
const wxColour& background = wxNullColour);''',
'''void %s(int markerNumber, int markerSymbol,
const wxColour& foreground,
const wxColour& background) {
SendMsg(%s, markerNumber, markerSymbol);
if (foreground.Ok())
MarkerSetForeground(markerNumber, foreground);
if (background.Ok())
MarkerSetBackground(markerNumber, background);''',
('Set the symbol used for a particular marker number,',
'and optionally the for and background colours.')),
'SetMarginTypeN' : ('SetMarginType', 0, 0, 0),
'GetMarginTypeN' : ('GetMarginType', 0, 0, 0),
'SetMarginWidthN' : ('SetMarginWidth', 0, 0, 0),
'GetMarginWidthN' : ('GetMarginWidth', 0, 0, 0),
'SetMarginMaskN' : ('SetMarginMask', 0, 0, 0),
'GetMarginMaskN' : ('GetMarginMask', 0, 0, 0),
'SetMarginSensitiveN' : ('SetMarginSensitive', 0, 0, 0),
'GetMarginSensitiveN' : ('GetMarginSensitive', 0, 0, 0),
'StyleSetFore' : ('StyleSetForeground', 0, 0, 0),
'StyleSetBack' : ('StyleSetBackground', 0, 0, 0),
'SetSelFore' : ('SetSelForeground', 0, 0, 0),
'SetSelBack' : ('SetSelBackground', 0, 0, 0),
'SetCaretFore' : ('SetCaretForeground', 0, 0, 0),
'StyleSetFont' : ('StyleSetFaceName', 0, 0, 0),
# need to fix this to map between wx and scintilla encoding flags, leave it out for now...
'StyleSetCharacterSet' : (None, 0, 0, 0),
'AssignCmdKey' : ('CmdKeyAssign',
'void %s(int key, int modifiers, int cmd);',
'''void %s(int key, int modifiers, int cmd) {
SendMsg(%s, MAKELONG(key, modifiers), cmd);''',
0),
'ClearCmdKey' : ('CmdKeyClear',
'void %s(int key, int modifiers);',
'''void %s(int key, int modifiers) {
SendMsg(%s, MAKELONG(key, modifiers));''',
0),
'ClearAllCmdKeys' : ('CmdKeyClearAll', 0, 0, 0),
'SetStylingEx' : ('SetStyleBytes',
'void %s(int length, char* styleBytes);',
'''void %s(int length, char* styleBytes) {
SendMsg(%s, length, (long)styleBytes);''',
0),
'IndicSetStyle' : ('IndicatorSetStyle', 0, 0, 0),
'IndicGetStyle' : ('IndicatorGetStyle', 0, 0, 0),
'IndicSetFore' : ('IndicatorSetForeground', 0, 0, 0),
'IndicGetFore' : ('IndicatorGetForeground', 0, 0, 0),
'AutoCShow' : ('AutoCompShow', 0, 0, 0),
'AutoCCancel' : ('AutoCompCancel', 0, 0, 0),
'AutoCActive' : ('AutoCompActive', 0, 0, 0),
'AutoCPosStart' : ('AutoCompPosStart', 0, 0, 0),
'AutoCComplete' : ('AutoCompComplete', 0, 0, 0),
'AutoCStops' : ('AutoCompStops', 0, 0, 0),
'AutoCSetSeparator' : ('AutoCompSetSeparator', 0, 0, 0),
'AutoCGetSeparator' : ('AutoCompGetSeparator', 0, 0, 0),
'AutoCSelect' : ('AutoCompSelect', 0, 0, 0),
'AutoCSetCancelAtStart' : ('AutoCompSetCancelAtStart', 0, 0, 0),
'AutoCGetCancelAtStart' : ('AutoCompGetCancelAtStart', 0, 0, 0),
'AutoCSetFillUps' : ('AutoCompSetFillUps', 0, 0, 0),
'AutoCSetChooseSingle' : ('AutoCompSetChooseSingle', 0, 0, 0),
'AutoCGetChooseSingle' : ('AutoCompGetChooseSingle', 0, 0, 0),
'AutoCSetIgnoreCase' : ('AutoCompSetIgnoreCase', 0, 0, 0),
'AutoCGetIgnoreCase' : ('AutoCompGetIgnoreCase', 0, 0, 0),
'SetHScrollBar' : ('SetUseHorizontalScrollBar', 0, 0, 0),
'GetHScrollBar' : ('GetUseHorizontalScrollBar', 0, 0, 0),
'GetCaretFore' : ('GetCaretForeground', 0, 0, 0),
'GetUsePalette' : (None, 0, 0, 0),
'FindText' : (0,
'''int %s(int minPos, int maxPos,
const wxString& text,
bool caseSensitive, bool wholeWord);''',
'''int %s(int minPos, int maxPos,
const wxString& text,
bool caseSensitive, bool wholeWord) {
TextToFind ft;
int flags = 0;
flags |= caseSensitive ? SCFIND_MATCHCASE : 0;
flags |= wholeWord ? SCFIND_WHOLEWORD : 0;
ft.chrg.cpMin = minPos;
ft.chrg.cpMax = maxPos;
ft.lpstrText = (char*)text.c_str();
return SendMsg(%s, flags, (long)&ft);''',
0),
'FormatRange' : (0,
'''int %s(bool doDraw,
int startPos,
int endPos,
wxDC* draw,
wxDC* target, // Why does it use two? Can they be the same?
wxRect renderRect,
wxRect pageRect);''',
''' int %s(bool doDraw,
int startPos,
int endPos,
wxDC* draw,
wxDC* target, // Why does it use two? Can they be the same?
wxRect renderRect,
wxRect pageRect) {
RangeToFormat fr;
fr.hdc = draw;
fr.hdcTarget = target;
fr.rc.top = renderRect.GetTop();
fr.rc.left = renderRect.GetLeft();
fr.rc.right = renderRect.GetRight();
fr.rc.bottom = renderRect.GetBottom();
fr.rcPage.top = pageRect.GetTop();
fr.rcPage.left = pageRect.GetLeft();
fr.rcPage.right = pageRect.GetRight();
fr.rcPage.bottom = pageRect.GetBottom();
fr.chrg.cpMin = startPos;
fr.chrg.cpMax = endPos;
return SendMsg(%s, doDraw, (long)&fr);''',
0),
'GetLine' : (0,
'wxString %s(int line);',
'''wxString %s(int line) {
wxString text;
int len = LineLength(line);
char* buf = text.GetWriteBuf(len+1);
int pos = SendMsg(%s, line, (long)buf);
text.UngetWriteBuf();
return text;''',
('Retrieve the contents of a line.',)),
'SetSel' : ('SetSelection', 0, 0, 0),
'GetSelText' : ('GetSelectedText',
'wxString %s();',
'''wxString %s() {
wxString text;
int start;
int end;
GetSelection(&start, &end);
int len = end - start;
char* buff = text.GetWriteBuf(len+1);
SendMsg(%s, 0, (long)buff);
text.UngetWriteBuf();
return text;''',
('Retrieve the selected text.',)),
'GetTextRange' : (0,
'wxString %s(int startPos, int endPos);',
'''wxString %s(int startPos, int endPos) {
wxString text;
int len = endPos - startPos;
char* buff = text.GetWriteBuf(len+1);
TextRange tr;
tr.lpstrText = buff;
tr.chrg.cpMin = startPos;
tr.chrg.cpMax = endPos;
SendMsg(%s, 0, (long)&tr);
text.UngetWriteBuf();
return text;''',
('Retrieve a range of text.',)),
'PointXFromPosition' : (None, 0, 0, 0),
'PointYFromPosition' : (None, 0, 0, 0),
'ScrollCaret' : ('EnsureCaretVisible', 0, 0, 0),
'ReplaceSel' : ('ReplaceSelection', 0, 0, 0),
'Null' : (None, 0, 0, 0),
'GetText' : (0,
'wxString %s();',
'''wxString %s() {
wxString text;
int len = GetTextLength();
char* buff = text.GetWriteBuf(len+1);
SendMsg(%s, len, (long)buff);
buff[len] = 0;
text.UngetWriteBuf();
return text;''',
('Retrieve all the text in the document.', )),
'GetDirectFunction' : (None, 0, 0, 0),
'GetDirectPointer' : (None, 0, 0, 0),
'CallTipPosStart' : ('CallTipPosAtStart', 0, 0, 0),
'CallTipSetHlt' : ('CallTipSetHighlight', 0, 0, 0),
'CallTipSetBack' : ('CallTipSetBackground', 0, 0, 0),
# Remove all methods that are key commands since they can be
# executed with CmdKeyExecute
'LineDown' : (None, 0, 0, 0),
'LineDownExtend' : (None, 0, 0, 0),
'LineUp' : (None, 0, 0, 0),
'LineUpExtend' : (None, 0, 0, 0),
'CharLeft' : (None, 0, 0, 0),
'CharLeftExtend' : (None, 0, 0, 0),
'CharRight' : (None, 0, 0, 0),
'CharRightExtend' : (None, 0, 0, 0),
'WordLeft' : (None, 0, 0, 0),
'WordLeftExtend' : (None, 0, 0, 0),
'WordRight' : (None, 0, 0, 0),
'WordRightExtend' : (None, 0, 0, 0),
'Home' : (None, 0, 0, 0),
'HomeExtend' : (None, 0, 0, 0),
'LineEnd' : (None, 0, 0, 0),
'LineEndExtend' : (None, 0, 0, 0),
'DocumentStart' : (None, 0, 0, 0),
'DocumentStartExtend' : (None, 0, 0, 0),
'DocumentEnd' : (None, 0, 0, 0),
'DocumentEndExtend' : (None, 0, 0, 0),
'PageUp' : (None, 0, 0, 0),
'PageUpExtend' : (None, 0, 0, 0),
'PageDown' : (None, 0, 0, 0),
'PageDownExtend' : (None, 0, 0, 0),
'EditToggleOvertype' : (None, 0, 0, 0),
'Cancel' : (None, 0, 0, 0),
'DeleteBack' : (None, 0, 0, 0),
'Tab' : (None, 0, 0, 0),
'BackTab' : (None, 0, 0, 0),
'NewLine' : (None, 0, 0, 0),
'FormFeed' : (None, 0, 0, 0),
'VCHome' : (None, 0, 0, 0),
'VCHomeExtend' : (None, 0, 0, 0),
'ZoomIn' : (None, 0, 0, 0),
'ZoomOut' : (None, 0, 0, 0),
'DelWordLeft' : (None, 0, 0, 0),
'DelWordRight' : (None, 0, 0, 0),
'LineCut' : (None, 0, 0, 0),
'LineDelete' : (None, 0, 0, 0),
'LineTranspose' : (None, 0, 0, 0),
'LowerCase' : (None, 0, 0, 0),
'UpperCase' : (None, 0, 0, 0),
'LineScrollDown' : (None, 0, 0, 0),
'LineScrollUp' : (None, 0, 0, 0),
'GetDocPointer' : (0,
'void* %s();',
'''void* %s() {
return (void*)SendMsg(%s);''',
0),
'SetDocPointer' : (0,
'void %s(void* docPointer);',
'''void %s(void* docPointer) {
SendMsg(%s, (long)docPointer);''',
0),
'CreateDocument' : (0,
'void* %s();',
'''void* %s() {
return (void*)SendMsg(%s);''',
0),
'AddRefDocument' : (0,
'void %s(void* docPointer);',
'''void %s(void* docPointer) {
SendMsg(%s, (long)docPointer);''',
0),
'ReleaseDocument' : (0,
'void %s(void* docPointer);',
'''void %s(void* docPointer) {
SendMsg(%s, (long)docPointer);''',
0),
'GrabFocus' : (None, 0, 0, 0),
'' : ('', 0, 0, 0),
}
#----------------------------------------------------------------------------
def processIface(iface, h_tmplt, cpp_tmplt, h_dest, cpp_dest):
curDocStrings = []
values = []
methods = []
# parse iface file
fi = FileInput(iface)
for line in fi:
line = line[:-1]
if line[:2] == '##' or line == '':
#curDocStrings = []
continue
op = line[:4]
if line[:2] == '# ': # a doc string
curDocStrings.append(line[2:])
elif op == 'val ':
parseVal(line[4:], values, curDocStrings)
curDocStrings = []
elif op == 'fun ' or op == 'set ' or op == 'get ':
parseFun(line[4:], methods, curDocStrings, values)
curDocStrings = []
elif op == 'cat ':
if string.strip(line[4:]) == 'Deprecated':
break # skip the rest of the file
elif op == 'evt ':
pass
else:
print '***** Unknown line type: ', line
# process templates
data = {}
data['VALUES'] = processVals(values)
defs, imps = processMethods(methods)
data['METHOD_DEFS'] = defs
data['METHOD_IMPS'] = imps
# get template text
h_text = open(h_tmplt).read()
cpp_text = open(cpp_tmplt).read()
# do the substitutions
h_text = h_text % data
cpp_text = cpp_text % data
# write out destination files
open(h_dest, 'w').write(h_text)
open(cpp_dest, 'w').write(cpp_text)
#----------------------------------------------------------------------------
def processVals(values):
text = []
for name, value, docs in values:
if docs:
text.append('')
for x in docs:
text.append('// ' + x)
text.append('#define %s %s' % (name, value))
return string.join(text, '\n')
#----------------------------------------------------------------------------
def processMethods(methods):
defs = []
imps = []
for retType, name, number, param1, param2, docs in methods:
retType = retTypeMap.get(retType, retType)
params = makeParamString(param1, param2)
name, theDef, theImp, docs = checkMethodOverride(name, number, docs)
if name is None:
continue
# Build the method definition for the .h file
if docs:
defs.append('')
for x in docs:
defs.append(' // ' + x)
if not theDef:
theDef = ' %s %s(%s);' % (retType, name, params)
defs.append(theDef)
# Build the method implementation string
if docs:
imps.append('')
for x in docs:
imps.append('// ' + x)
if not theImp:
theImp = '%s wxStyledTextCtrl::%s(%s) {\n ' % (retType, name, params)
if retType == 'wxColour':
theImp = theImp + 'long c = '
elif retType != 'void':
theImp = theImp + 'return '
theImp = theImp + 'SendMsg(%s, %s, %s)' % (number,
makeArgString(param1),
makeArgString(param2))
if retType == 'bool':
theImp = theImp + ' != 0'
if retType == 'wxColour':
theImp = theImp + ';\n return wxColourFromLong(c)'
theImp = theImp + ';\n}'
imps.append(theImp)
return string.join(defs, '\n'), string.join(imps, '\n')
#----------------------------------------------------------------------------
def checkMethodOverride(name, number, docs):
theDef = theImp = None
if methodOverrideMap.has_key(name):
item = methodOverrideMap[name]
if item[0] != 0:
name = item[0]
if item[1] != 0:
theDef = ' ' + (item[1] % name)
if item[2] != 0:
theImp = item[2] % ('wxStyledTextCtrl::'+name, number) + '\n}'
if item[3] != 0:
docs = item[3]
return name, theDef, theImp, docs
#----------------------------------------------------------------------------
def makeArgString(param):
if not param:
return '0'
typ, name = param
if typ == 'string':
return '(long)%s.c_str()' % name
if typ == 'colour':
return 'wxColourAsLong(%s)' % name
return name
#----------------------------------------------------------------------------
def makeParamString(param1, param2):
def doOne(param):
if param:
aType = paramTypeMap.get(param[0], param[0])
return aType + ' ' + param[1]
else:
return ''
st = doOne(param1)
if st and param2:
st = st + ', '
st = st + doOne(param2)
return st
#----------------------------------------------------------------------------
def parseVal(line, values, docs):
name, val = string.split(line, '=')
# remove prefixes such as SCI, etc.
for old, new in valPrefixes:
lo = len(old)
if name[:lo] == old:
if new is None:
return
name = new + name[lo:]
# add it to the list
values.append( ('wxSTC_' + name, val, docs) )
#----------------------------------------------------------------------------
funregex = re.compile(r'\s*([a-zA-Z0-9_]+)' # <ws>return type
'\s+([a-zA-Z0-9_]+)=' # <ws>name=
'([0-9]+)' # number
'\(([ a-zA-Z0-9_]*),' # (param,
'([ a-zA-Z0-9_]*)\)') # param)
def parseFun(line, methods, docs, values):
def parseParam(param):
param = string.strip(param)
if param == '':
param = None
else:
param = tuple(string.split(param))
return param
mo = funregex.match(line)
if mo is None:
print "***** Line doesn't match! : " + line
retType, name, number, param1, param2 = mo.groups()
param1 = parseParam(param1)
param2 = parseParam(param2)
# Special case. For the key command functionss we want a value defined too
num = string.atoi(number)
for v in cmdValues:
if (type(v) == type(()) and v[0] <= num < v[1]) or v == num:
parseVal('CMD_%s=%s' % (string.upper(name), number), values, ())
#if retType == 'void' and not param1 and not param2:
methods.append( (retType, name, number, param1, param2, tuple(docs)) )
#----------------------------------------------------------------------------
def main(args):
# TODO: parse command line args to replace default input/output files???
# Now just do it
processIface(IFACE, H_TEMPLATE, CPP_TEMPLATE, H_DEST, CPP_DEST)
if __name__ == '__main__':
main(sys.argv)
#----------------------------------------------------------------------------

View File

@@ -1,92 +0,0 @@
#
# File: makefile.b32
# Author: Julian Smart
# Created: 1999
# Updated:
# Copyright:
#
# Makefile : Builds wxMMedia library for 32-bit BC++
# N.B. use:
# make -f makefile.b32 stc.cfg
# make -f makefile.b32
WXDIR = $(WXWIN)
SCINTILLA=.\scintilla
S=$(SCINTILLA)\src
STCEXTRACPPFLAGS=-D__WX__ -DSCI_LEXER -I$(SCINTILLA)/include -I$(S)
LIBTARGET=$(WXDIR)\contrib\lib\stc.lib
OBJECTS = \
Accessor.obj \
AutoComplete.obj \
CallTip.obj \
CellBuffer.obj \
ContractionState.obj \
Document.obj \
DocumentAccessor.obj \
Editor.obj \
Indicator.obj \
KeyMap.obj \
KeyWords.obj \
LexCPP.obj \
LexHTML.obj \
LexLua.obj \
LexOthers.obj \
LexPerl.obj \
LexPython.obj \
LexSQL.obj \
LexVB.obj \
LineMarker.obj \
PropSet.obj \
PosRegExp.obj \
ScintillaBase.obj \
Style.obj \
UniConversion.obj \
ViewStyle.obj \
WindowAccessor.obj \
\
PlatWX.obj \
ScintillaWX.obj \
stc.obj \
!include $(WXDIR)\src\makelib.b32
CFG = stc.cfg
CPPFLAGS=$(DLL_FLAGS) $(EXTRACPPFLAGS) @$(CFG)
{$(S)}.cxx.obj:
bcc32 $(CPPFLAGS) -P -c {$< }
$(CFG): makefile.b32
copy &&!
-H=$(WXDIR)\src\msw\wx32.csm
-3
-d
-a1 # byte alignment
-R-
-X
-w-par
-w-aus
-w-hid # virtual function A hides virtual function B
-WE
-tWM
-I$(WXINC);$(BCCDIR)\include;$(WXDIR)/src/generic;$(WXDIR)/src/png;$(WXDIR)/src/jpeg;$(WXDIR)/src/zlib;$(WXDIR)/src/xpm;$(WXDIR)/src/tiff
-I$(WXDIR)\include\wx\msw\gnuwin32
-L$(BCCDIR)\lib
-D__WXWIN__
-D__WXMSW__
-D__WINDOWS__
-DWIN32
$(OPT)
$(DEBUG_FLAGS)
$(WIN95FLAG)
$(STCEXTRACPPFLAGS)
! $(CFG)

View File

@@ -1,46 +0,0 @@
# File: makefile.g95 For stectrl
# Author: Robin Dunn
# Created: 1-Feb-2000
# Updated:
WXDIR = ../../..
SCINTILLA=$(WXDIR)/contrib/src/stc/scintilla
S=$(SCINTILLA)/src
EXTRAINC=-D__WX__ -DSCI_LEXER -I$(SCINTILLA)/include -I$(S) -I. -I$(WXDIR)/contrib/include
OBJECTS = \
$(S)/Accessor.$(OBJSUFF) \
$(S)/AutoComplete.$(OBJSUFF) \
$(S)/CallTip.$(OBJSUFF) \
$(S)/CellBuffer.$(OBJSUFF) \
$(S)/ContractionState.$(OBJSUFF)\
$(S)/Document.$(OBJSUFF) \
$(S)/Editor.$(OBJSUFF) \
$(S)/Indicator.$(OBJSUFF) \
$(S)/KeyMap.$(OBJSUFF) \
$(S)/KeyWords.$(OBJSUFF) \
$(S)/LineMarker.$(OBJSUFF) \
$(S)/PropSet.$(OBJSUFF) \
$(S)/ScintillaBase.$(OBJSUFF) \
$(S)/Style.$(OBJSUFF) \
$(S)/ViewStyle.$(OBJSUFF) \
$(S)/LexCPP.$(OBJSUFF) \
$(S)/LexHTML.$(OBJSUFF) \
$(S)/LexLua.$(OBJSUFF) \
$(S)/LexOthers.$(OBJSUFF) \
$(S)/LexPerl.$(OBJSUFF) \
$(S)/LexPython.$(OBJSUFF) \
$(S)/LexSQL.$(OBJSUFF) \
$(S)/LexVB.$(OBJSUFF) \
$(S)/DocumentAccessor.$(OBJSUFF)\
$(S)/UniConversion.$(OBJSUFF) \
$(S)/WindowAccessor.$(OBJSUFF) \
$(S)/PosRegExp.$(OBJSUFF) \
PlatWX.$(OBJSUFF) \
ScintillaWX.$(OBJSUFF) \
stc.$(OBJSUFF)
LIBTARGET = $(WXDIR)/contrib/lib/libstc.a
include $(WXDIR)/src/makelib.g95

View File

@@ -1,105 +0,0 @@
# File: makefile.vc For stectrl
# Author: Robin Dunn
# Created: 1-Feb-2000
# Updated:
# Set WXDIR for your system
WXDIR = $(WXWIN)
SCINTILLA=.\scintilla
S=$(SCINTILLA)\src
EXTRAINC=-D__WX__ -DSCI_LEXER -I$(SCINTILLA)/include -I$(S) -I. -I$(WXDIR)\contrib\include
NOPCH=1
!include $(WXDIR)\src\makevc.env
OBJECTS = \
$(D)\AutoComplete.obj \
$(D)\CallTip.obj \
$(D)\CellBuffer.obj \
$(D)\ContractionState.obj\
$(D)\Document.obj \
$(D)\DocumentAccessor.obj\
$(D)\Editor.obj \
$(D)\Indicator.obj \
$(D)\KeyMap.obj \
$(D)\KeyWords.obj \
$(D)\LexCPP.obj \
$(D)\LexHTML.obj \
$(D)\LexLua.obj \
$(D)\LexOthers.obj \
$(D)\LexPerl.obj \
$(D)\LexPython.obj \
$(D)\LexSQL.obj \
$(D)\LexVB.obj \
$(D)\LineMarker.obj \
$(D)\PosRegExp.obj \
$(D)\PropSet.obj \
$(D)\ScintillaBase.obj \
$(D)\Style.obj \
$(D)\UniConversion.obj \
$(D)\ViewStyle.obj \
$(D)\WindowAccessor.obj \
\
$(D)\PlatWX.obj \
$(D)\ScintillaWX.obj \
$(D)\stc.obj \
LIBTARGET = $(WXDIR)\contrib\lib\stc$(LIBEXT).lib
all: $(D) $(LIBTARGET)
$(D) :
mkdir $(D)
wx:
cd $(WXDIR)\src\msw
nmake -f makefile.vc FINAL=$(FINAL)
cd $(THISDIR)
wxclean:
cd $(WXDIR)\src\msw
nmake -f makefile.vc clean
cd $(THISDIR)
$(LIBTARGET): $(OBJECTS)
-erase $(LIBTARGET)
$(implib) @<<
-out:$(LIBTARGET)
-machine:$(CPU)
$(OBJECTS)
<<
{$(S)}.cxx{$(D)}.obj:
$(cc) @<<
$(CPPFLAGS) /c /Fo$@ /Tp $<
<<
{}.cpp{$(D)}.obj:
$(cc) @<<
$(CPPFLAGS) /c /Fo$@ /Tp $<
<<
show:
@echo $(CPPFLAGS)
clean:
-erase $(D)\*.obj
-erase *.sbr
-erase *.exe
-erase *.res
-erase *.map
-erase *.pdb
-erase $(LIBTARGET)

View File

@@ -1,7 +0,0 @@
This directory contains copies of the scintilla/src and
scintilla/include directories from the Scintilla/SCiTE source
distribution. All other code needed to implement Scintilla on top of
wxWindows is located in the directory above this one.
The current version of the Scintilla code is 1.32

View File

@@ -1,70 +0,0 @@
// SciTE - Scintilla based Text Editor
// Accessor.h - rapid easy access to contents of a Scintilla
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
enum { wsSpace = 1, wsTab = 2, wsSpaceTab = 4, wsInconsistent=8};
class Accessor;
typedef bool (*PFNIsCommentLeader)(Accessor &styler, int pos, int len);
// Interface to data in a Scintilla
class Accessor {
protected:
enum {extremePosition=0x7FFFFFFF};
// bufferSize is a trade off between time taken to copy the characters and retrieval overhead
// slopSize positions the buffer before the desired position in case there is some backtracking
enum {bufferSize=4000, slopSize=bufferSize/8};
char buf[bufferSize+1];
int startPos;
int endPos;
int codePage;
virtual bool InternalIsLeadByte(char ch)=0;
virtual void Fill(int position)=0;
public:
Accessor() : startPos(extremePosition), endPos(0), codePage(0) {}
virtual ~Accessor() {}
char operator[](int position) {
if (position < startPos || position >= endPos) {
Fill(position);
}
return buf[position - startPos];
}
char SafeGetCharAt(int position, char chDefault=' ') {
// Safe version of operator[], returning a defined value for invalid position
if (position < startPos || position >= endPos) {
Fill(position);
if (position < startPos || position >= endPos) {
// Position is outside range of document
return chDefault;
}
}
return buf[position - startPos];
}
bool IsLeadByte(char ch) {
return codePage && InternalIsLeadByte(ch);
}
void SetCodePage(int codePage_) { codePage = codePage_; }
virtual char StyleAt(int position)=0;
virtual int GetLine(int position)=0;
virtual int LineStart(int line)=0;
virtual int LevelAt(int line)=0;
virtual int Length()=0;
virtual void Flush()=0;
virtual int GetLineState(int line)=0;
virtual int SetLineState(int line, int state)=0;
virtual int GetPropertyInt(const char *key, int defaultValue=0)=0;
// Style setting
virtual void StartAt(unsigned int start, char chMask=31)=0;
virtual void SetFlags(char chFlags_, char chWhile_)=0;
virtual unsigned int GetStartSegment()=0;
virtual void StartSegment(unsigned int pos)=0;
virtual void ColourTo(unsigned int pos, int chAttr)=0;
virtual void SetLevel(int line, int level)=0;
virtual int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0)=0;
};

View File

@@ -1,41 +0,0 @@
// SciTE - Scintilla based Text Editor
// KeyWords.h - colourise for particular languages
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
typedef void (*LexerFunction)(unsigned int startPos, int lengthDoc, int initStyle,
WordList *keywordlists[], Accessor &styler);
class LexerModule {
static LexerModule *base;
LexerModule *next;
int language;
LexerFunction fn;
public:
LexerModule(int language_, LexerFunction fn_);
static void Colourise(unsigned int startPos, int lengthDoc, int initStyle,
int language, WordList *keywordlists[], Accessor &styler);
};
inline bool iswordchar(char ch) {
return isalnum(ch) || ch == '.' || ch == '_';
}
inline bool iswordstart(char ch) {
return isalnum(ch) || ch == '_';
}
inline bool isoperator(char ch) {
if (isalnum(ch))
return false;
// '.' left out as it is used to make up numbers
if (ch == '%' || ch == '^' || ch == '&' || ch == '*' ||
ch == '(' || ch == ')' || ch == '-' || ch == '+' ||
ch == '=' || ch == '|' || ch == '{' || ch == '}' ||
ch == '[' || ch == ']' || ch == ':' || ch == ';' ||
ch == '<' || ch == '>' || ch == ',' || ch == '/' ||
ch == '?' || ch == '!' || ch == '.' || ch == '~')
return true;
return false;
}

View File

@@ -1,411 +0,0 @@
// Scintilla source code edit control
// Platform.h - interface to platform facilities
// Also includes some basic utilities
// Implemented in PlatGTK.cxx for GTK+/Linux, PlatWin.cxx for Windows, and PlatWX.cxx for wxWindows
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef PLATFORM_H
#define PLATFORM_H
// PLAT_GTK = GTK+ on Linux, PLAT_WIN = Win32 API on Win32 OS
// PLAT_WX is wxWindows on any supported platform
// Could also have PLAT_GTKWIN = GTK+ on Win32 OS in future
#define PLAT_GTK 0
#define PLAT_WIN 0
#define PLAT_WX 0
#if defined(__WX__)
#undef PLAT_WX
#define PLAT_WX 1
#elif defined(GTK)
#undef PLAT_GTK
#define PLAT_GTK 1
#else
#undef PLAT_WIN
#define PLAT_WIN 1
#endif
// Include the main header for each platform
#if PLAT_GTK
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#endif
#if PLAT_WIN
#define _WIN32_WINNT 0x0400 // Otherwise some required stuff gets ifdef'd out
// Vassili Bourdo: shut up annoying Visual C++ warnings:
#ifdef _MSC_VER
#pragma warning(disable: 4800 4244 4309)
#endif
#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
#endif
#if PLAT_WX
#include <wx/wx.h>
#endif
// 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
#if PLAT_GTK
typedef GdkColor ColourID;
typedef GdkFont* FontID;
typedef GdkDrawable* SurfaceID;
typedef GtkWidget* WindowID;
typedef GtkItemFactory* MenuID;
#endif
#if PLAT_WIN
typedef COLORREF ColourID;
typedef HFONT FontID;
typedef HDC SurfaceID;
typedef HWND WindowID;
typedef HMENU MenuID;
#endif
#if PLAT_WX
typedef wxColour ColourID;
typedef wxFont* FontID;
typedef wxDC* SurfaceID;
typedef wxWindow* WindowID;
typedef wxMenu* MenuID;
#endif
// Point is exactly the same as the Win32 POINT and GTK+ GdkPoint so can be used interchangeably
class Point {
public:
int x;
int y;
Point(int x_=0, int y_=0) : x(x_), y(y_) {
}
// Other automatically defined methods (assignment, copy constructor, destructor) are fine
static Point FromLong(long lpoint);
};
// PRectangle is exactly the same as the Win32 RECT so can be used interchangeably
// PRectangles contain their top and left sides, but not their right and bottom sides
class PRectangle {
public:
int left;
int top;
int right;
int bottom;
PRectangle(int left_=0, int top_=0, int right_=0, int bottom_ = 0) :
left(left_), top(top_), right(right_), bottom(bottom_) {
}
// Other automatically defined methods (assignment, copy constructor, destructor) are fine
bool Contains(Point pt) {
return (pt.x >= left) && (pt.x <= right) &&
(pt.y >= top) && (pt.y <= bottom);
}
bool Contains(PRectangle rc) {
return (rc.left >= left) && (rc.right <= right) &&
(rc.top >= top) && (rc.bottom <= bottom);
}
bool Intersects(PRectangle other) {
return (right >= other.left) && (left <= other.right) &&
(bottom >= other.top) && (top <= other.bottom);
}
int Width() { return right - left; }
int Height() { return bottom - top; }
};
#if PLAT_WX
wxRect wxRectFromPRectangle(PRectangle prc);
PRectangle PRectangleFromwxRect(wxRect rc);
#endif
class Colour {
ColourID co;
public:
Colour(long lcol=0);
Colour(unsigned int red, unsigned int green, unsigned int blue);
bool operator==(const Colour &other) const;
long AsLong() const;
unsigned int GetRed();
unsigned int GetGreen();
unsigned int GetBlue();
friend class Surface;
friend class Palette;
};
// Colour pairs hold a desired colour and the colour that the graphics engine
// allocates to approximate the desired colour.
// To make palette management more automatic, ColourPairs could register at
// construction time with a palette management object.
struct ColourPair {
Colour desired;
Colour allocated;
ColourPair(Colour desired_=Colour(0,0,0)) {
desired = desired_;
allocated = desired;
}
};
class Window; // Forward declaration for Palette
class Palette {
int used;
enum {numEntries = 100};
ColourPair entries[numEntries];
#if PLAT_GTK
GdkColor *allocatedPalette;
int allocatedLen;
#elif PLAT_WIN
HPALETTE hpal;
#elif PLAT_WX
// wxPalette* pal; // **** Is this needed?
#endif
public:
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);
friend class Surface;
};
class Font {
protected:
FontID id;
#if PLAT_WX
int ascent;
#endif
// Private so Font objects can not be copied
Font(const Font &) {}
Font &operator=(const Font &) { id=0; return *this; }
public:
Font();
virtual ~Font();
virtual void Create(const char *faceName, int characterSet, int size, bool bold, bool italic);
virtual void Release();
FontID GetID() { return id; }
// Alias another font - caller guarantees not to Release
void SetID(FontID id_) { id = id_; }
friend class Surface;
};
// A surface abstracts a place to draw
class Surface {
private:
bool unicodeMode;
#if PLAT_GTK
GdkDrawable *drawable;
GdkGC *gc;
GdkPixmap *ppixmap;
int x;
int y;
bool inited;
bool createdGC;
#elif PLAT_WIN
HDC hdc;
bool hdcOwned;
HPEN pen;
HPEN penOld;
HBRUSH brush;
HBRUSH brushOld;
HFONT font;
HFONT fontOld;
HBITMAP bitmap;
HBITMAP bitmapOld;
HPALETTE paletteOld;
#elif PLAT_WX
wxDC* hdc;
bool hdcOwned;
wxBitmap* bitmap;
int x;
int y;
#endif
// Private so Surface objects can not be copied
Surface(const Surface &) {}
Surface &operator=(const Surface &) { return *this; }
#if PLAT_WIN || PLAT_WX
void BrushColor(Colour back);
void SetFont(Font &font_);
#endif
public:
Surface();
~Surface();
void Init();
void Init(SurfaceID hdc_);
void InitPixMap(int width, int height, Surface *surface_);
void Release();
bool Initialised();
void PenColour(Colour fore);
int LogPixelsY();
int DeviceHeightFont(int points);
void MoveTo(int x_, int y_);
void LineTo(int x_, int y_);
void Polygon(Point *pts, int npts, Colour fore, Colour back);
void RectangleDraw(PRectangle rc, Colour fore, Colour back);
void FillRectangle(PRectangle rc, Colour back);
void FillRectangle(PRectangle rc, Surface &surfacePattern);
void RoundedRectangle(PRectangle rc, Colour fore, Colour back);
void Ellipse(PRectangle rc, Colour fore, Colour back);
void Copy(PRectangle rc, Point from, Surface &surfaceSource);
void DrawText(PRectangle rc, Font &font_, int ybase, const char *s, int len, Colour fore, Colour back);
void DrawTextClipped(PRectangle rc, Font &font_, int ybase, const char *s, int len, Colour fore, Colour back);
void MeasureWidths(Font &font_, const char *s, int len, int *positions);
int WidthText(Font &font_, const char *s, int len);
int WidthChar(Font &font_, char ch);
int Ascent(Font &font_);
int Descent(Font &font_);
int InternalLeading(Font &font_);
int ExternalLeading(Font &font_);
int Height(Font &font_);
int AverageCharWidth(Font &font_);
int SetPalette(Palette *pal, bool inBackGround);
void SetClip(PRectangle rc);
void FlushCachedState();
void SetUnicodeMode(bool unicodeMode_) {
unicodeMode=unicodeMode_;
}
};
// Class to hide the details of window manipulation
// Does not own the window which will normally have a longer life than this object
class Window {
friend class ListBox;
protected:
WindowID id;
public:
Window() : id(0) {}
Window(const Window &source) : id(source.id) {}
virtual ~Window();
Window &operator=(WindowID id_) {
id = id_;
return *this;
}
WindowID GetID() { return id; }
bool Created() { return id != 0; }
void Destroy();
bool HasFocus();
PRectangle GetPosition();
void SetPosition(PRectangle rc);
void SetPositionRelative(PRectangle rc, Window relativeTo);
PRectangle GetClientPosition();
void Show(bool show=true);
void InvalidateAll();
void InvalidateRectangle(PRectangle rc);
virtual void SetFont(Font &font);
enum Cursor { cursorText, cursorArrow, cursorUp, cursorWait, cursorHoriz, cursorVert, cursorReverseArrow };
void SetCursor(Cursor curs);
void SetTitle(const char *s);
#if PLAT_WIN
LRESULT SendMessage(UINT msg, WPARAM wParam=0, LPARAM lParam=0);
int GetDlgCtrlID();
HINSTANCE GetInstance();
#endif
};
class ListBox : public Window {
#if PLAT_GTK
WindowID list;
WindowID scroller;
int current;
#endif
int desiredVisibleRows;
unsigned int maxItemCharacters;
unsigned int aveCharWidth;
public:
ListBox();
virtual ~ListBox();
void Create(Window &parent, int ctrlID);
virtual void SetFont(Font &font);
void SetAverageCharWidth(int width);
void SetVisibleRows(int rows);
PRectangle GetDesiredRect();
void Clear();
void Append(char *s);
int Length();
void Select(int n);
int GetSelection();
int Find(const char *prefix);
void GetValue(int n, char *value, int len);
void Sort();
};
class Menu {
MenuID id;
public:
Menu();
MenuID GetID() { return id; }
void CreatePopUp();
void Destroy();
void Show(Point pt, Window &w);
};
// Platform class used to retrieve system wide parameters such as double click speed
// and chrome colour. Not a creatable object, more of a module with several functions.
class Platform {
// Private so Platform objects can not be copied
Platform(const Platform &) {}
Platform &operator=(const Platform &) { return *this; }
public:
// Should be private because no new Platforms are ever created
// but gcc warns about this
Platform() {}
~Platform() {}
static Colour Chrome();
static Colour ChromeHighlight();
static const char *DefaultFont();
static int DefaultFontSize();
static unsigned int DoubleClickTime();
static void DebugDisplay(const char *s);
static bool IsKeyDown(int key);
static long SendScintilla(
WindowID w, unsigned int msg, unsigned long wParam=0, long lParam=0);
// These are utility functions not really tied to a platform
static int Minimum(int a, int b);
static int Maximum(int a, int b);
// Next three assume 16 bit shorts and 32 bit longs
static long LongFromTwoShorts(short a,short b) {
return (a) | ((b) << 16);
}
static short HighShortFromLong(long x) {
return static_cast<short>(x >> 16);
}
static short LowShortFromLong(long x) {
return static_cast<short>(x & 0xffff);
}
static void DebugPrintf(const char *format, ...);
static int Clamp(int val, int minVal, int maxVal);
};
#endif

View File

@@ -1,138 +0,0 @@
#ifndef POSREGEXP_H
#define POSREGEXP_H
#define MatchesNum 0x10
enum EOps
{
ReBlockOps = 0x1000,
ReMul, // *
RePlus, // +
ReQuest, // ?
ReNGMul, // *?
ReNGPlus, // +?
ReNGQuest, // ??
ReRangeN, // {n,}
ReRangeNM, // {n,m}
ReNGRangeN, // {n,}?
ReNGRangeNM, // {n,m}?
ReOr, // |
ReBehind = 0x1100, // ?#n
ReNBehind = 0x1200, // ?~n
ReAhead = 0x1300, // ?=
ReNAhead = 0x1400, // ?!
ReSymbolOps = 0x2000,
ReEmpty,
ReSymb, // a b \W \s ...
ReEnum, // []
ReNEnum, // [^]
ReBrackets, // (...)
ReBkTrace = 0x2100, // \yN
ReBkBrack = 0x2200 // \N
};
enum ESymbols
{
ReAnyChr = 0x4000, // .
ReSoL, // ^
ReEoL, // $
ReDigit, // \d
ReNDigit, // \D
ReWordSymb, // \w
ReNWordSymb, // \W
ReWSpace, // \s
ReNWSpace, // \S
ReUCase, // \u
ReNUCase , // \l
ReWBound, // \b
ReNWBound, // \B
RePreNW, // \c
ReStart, // \m
ReEnd, // \M
ReChr = 0x0 // Char in Lower Byte
};
enum ETempSymb
{
ReTemp = 0x7000,
ReLBrack, ReRBrack,
ReEnumS, ReEnumE, ReNEnumS,
ReRangeS, ReRangeE, ReNGRangeE, ReFrToEnum
};
#define BackSlash '\\'
typedef union SCharData
{
int IArr[8];
char CArr[32];
void SetBit(unsigned char Bit);
void ClearBit(unsigned char Bit);
bool GetBit(unsigned char Bit);
} *PCharData;
typedef struct SRegInfo
{
SRegInfo();
~SRegInfo();
EOps Op;
union{
SRegInfo *Param;
int Symb;
PCharData ChrClass;
}un;
int s,e;
SRegInfo *Parent;
SRegInfo *Next;
} *PRegInfo;
typedef struct SMatches
{
int s[MatchesNum];
int e[MatchesNum];
int CurMatch;
} *PMatches;
typedef class PosRegExp
{
PRegInfo Info;
PMatches BkTrace;
bool NoCase,Extend,NoMoves;
bool Error;
int *Exprn;
int posParse;
int posEnd,posStart;
int posBkStr;
int FirstChar;
bool SetExprLow(const char *Expr);
bool SetStructs(PRegInfo &Info,int st,int end);
void Optimize();
bool CheckSymb(int Symb,bool Inc);
bool LowParse(PRegInfo Re);
bool LowParseRe(PRegInfo &Next);
bool LowCheckNext(PRegInfo Re);
bool ParseRe(int posStr);
bool QuickCheck();
public:
PMatches Matches;
int Ok, CurMatch;
void *param;
char (*CharAt)(int pos, void *param);
PosRegExp();
~PosRegExp();
bool isok();
bool SetNoMoves(bool Moves);
bool SetBkTrace(int posStr,PMatches Trace);
bool SetExpr(const char *Expr);
bool Parse(int posStr, int posStop, PMatches Mtch);
bool Parse(int posStr,int posSol, int posEol, PMatches Mtch, int Moves = -1);
bool Evaluate(char *Expr, int posStr, PMatches Mtch, char **Res);
} *PPosRegExp;
#endif /* POSREGEXP_H */

View File

@@ -1,244 +0,0 @@
// SciTE - Scintilla based Text Editor
// PropSet.h - a java style properties file module
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef PROPSET_H
#define PROPSET_H
bool EqualCaseInsensitive(const char *a, const char *b);
#if PLAT_WIN
#define strcasecmp stricmp
#define strncasecmp strnicmp
#endif
#ifdef __WXMSW__
#define strcasecmp stricmp
#define strncasecmp strnicmp
#endif
// Define another string class.
// While it would be 'better' to use std::string, that doubles the executable size.
inline char *StringDup(const char *s, int len=-1) {
if (!s)
return 0;
if (len == -1)
len = strlen(s);
char *sNew = new char[len + 1];
if (sNew) {
strncpy(sNew, s, len);
sNew[len] = '\0';
}
return sNew;
}
class SString {
char *s;
int ssize;
public:
typedef const char* const_iterator;
typedef int size_type;
static size_type npos;
const char* begin(void) const {
return s;
}
const char* end(void) const {
return &s[ssize];
}
size_type size(void) const {
if (s)
return ssize;
else
return 0;
}
SString &assign(const char* sother, int size_ = -1) {
char *t = s;
s = StringDup(sother,size_);
ssize = (s) ? strlen(s) : 0;
delete []t;
return *this;
}
SString &assign(const SString& sother, int size_ = -1) {
return assign(sother.s,size_);
}
SString &assign(const_iterator ibeg, const_iterator iend) {
return assign(ibeg,iend - ibeg);
}
SString() {
s = 0;
ssize = 0;
}
SString(const SString &source) {
s = StringDup(source.s);
ssize = (s) ? strlen(s) : 0;
}
SString(const char *s_) {
s = StringDup(s_);
ssize = (s) ? strlen(s) : 0;
}
SString(int i) {
char number[100];
sprintf(number, "%0d", i);
s = StringDup(number);
ssize = (s) ? strlen(s) : 0;
}
~SString() {
delete []s;
s = 0;
ssize = 0;
}
SString &operator=(const SString &source) {
if (this != &source) {
delete []s;
s = StringDup(source.s);
ssize = (s) ? strlen(s) : 0;
}
return *this;
}
bool operator==(const SString &other) const {
if ((s == 0) && (other.s == 0))
return true;
if ((s == 0) || (other.s == 0))
return false;
return strcmp(s, other.s) == 0;
}
bool operator!=(const SString &other) const {
return !operator==(other);
}
bool operator==(const char *sother) const {
if ((s == 0) && (sother == 0))
return true;
if ((s == 0) || (sother == 0))
return false;
return strcmp(s, sother) == 0;
}
bool operator!=(const char *sother) const {
return !operator==(sother);
}
const char *c_str() const {
if (s)
return s;
else
return "";
}
int length() const {
if (s)
return strlen(s);
else
return 0;
}
char operator[](int i) const {
if (s)
return s[i];
else
return '\0';
}
SString &operator +=(const char *sother) {
return append(sother,-1);
}
SString &operator +=(const SString &sother) {
return append(sother.s,sother.ssize);
}
SString &operator +=(char ch) {
return append(&ch,1);
}
SString &append(const char* sother, int lenOther) {
int len = length();
if(lenOther < 0)
lenOther = strlen(sother);
char *sNew = new char[len + lenOther + 1];
if (sNew) {
if (s)
memcpy(sNew, s, len);
strncpy(&sNew[len], sother, lenOther);
sNew[len + lenOther] = '\0';
delete []s;
s = sNew;
ssize = (s) ? strlen(s) : 0;
}
return *this;
}
int value() const {
if (s)
return atoi(s);
else
return 0;
}
void substitute(char find, char replace) {
char *t = s;
while (t) {
t = strchr(t, find);
if (t)
*t = replace;
}
}
// I don't think this really belongs here -- Neil
void correctPath() {
#ifdef unix
substitute('\\', '/');
#else
substitute('/', '\\');
#endif
}
};
struct Property {
unsigned int hash;
char *key;
char *val;
Property *next;
Property() : hash(0), key(0), val(0), next(0) {}
};
class PropSet {
private:
enum { hashRoots=31 };
Property *props[hashRoots];
public:
PropSet *superPS;
PropSet();
~PropSet();
void Set(const char *key, const char *val);
void Set(char *keyval);
SString Get(const char *key);
SString GetExpanded(const char *key);
SString Expand(const char *withvars);
int GetInt(const char *key, int defaultValue=0);
SString GetWild(const char *keybase, const char *filename);
SString GetNewExpand(const char *keybase, const char *filename);
void Clear();
void ReadFromMemory(const char *data, int len, const char *directoryForImports=0);
void Read(const char *filename, const char *directoryForImports);
};
class WordList {
public:
// Each word contains at least one character - a empty word acts as sentinal at the end.
char **words;
char **wordsNoCase;
char *list;
int len;
bool onlyLineEnds; // Delimited by any white space or only line ends
bool sorted;
int starts[256];
WordList(bool onlyLineEnds_ = false) :
words(0), wordsNoCase(0), list(0), len(0), onlyLineEnds(onlyLineEnds_), sorted(false) {}
~WordList() { Clear(); }
operator bool() { return words ? true : false; }
const char *operator[](int ind) { return words[ind]; }
void Clear();
void Set(const char *s);
char *Allocate(int size);
void SetFromAllocated();
bool InList(const char *s);
const char *GetNearestWord(const char *wordStart, int searchLen = -1, bool ignoreCase = false);
char *GetNearestWords(const char *wordStart, int searchLen = -1, bool ignoreCase = false);
};
inline bool nonFuncChar(char ch) {
return strchr("\t\n\r !\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~", ch) != NULL;
}
#endif

View File

@@ -1,204 +0,0 @@
// Scintilla source code edit control
// SciLexer - interface to the added lexer functions in the SciLexer version of the edit control
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
// Most of this file is automatically generated from the Scintilla.iface interface definition
// file which contains any comments about the definitions. HFacer.py does the generation.
#ifndef SCILEXER_H
#define SCILEXER_H
// SciLexer features - not in standard Scintilla
//++Autogenerated -- start of section automatically generated from Scintilla.iface
#define SCLEX_CONTAINER 0
#define SCLEX_NULL 1
#define SCLEX_PYTHON 2
#define SCLEX_CPP 3
#define SCLEX_HTML 4
#define SCLEX_XML 5
#define SCLEX_PERL 6
#define SCLEX_SQL 7
#define SCLEX_VB 8
#define SCLEX_PROPERTIES 9
#define SCLEX_ERRORLIST 10
#define SCLEX_MAKEFILE 11
#define SCLEX_BATCH 12
#define SCLEX_XCODE 13
#define SCLEX_LATEX 14
#define SCLEX_LUA 15
#define SCLEX_DIFF 16
#define SCE_P_DEFAULT 0
#define SCE_P_COMMENTLINE 1
#define SCE_P_NUMBER 2
#define SCE_P_STRING 3
#define SCE_P_CHARACTER 4
#define SCE_P_WORD 5
#define SCE_P_TRIPLE 6
#define SCE_P_TRIPLEDOUBLE 7
#define SCE_P_CLASSNAME 8
#define SCE_P_DEFNAME 9
#define SCE_P_OPERATOR 10
#define SCE_P_IDENTIFIER 11
#define SCE_P_COMMENTBLOCK 12
#define SCE_P_STRINGEOL 13
#define SCE_C_DEFAULT 0
#define SCE_C_COMMENT 1
#define SCE_C_COMMENTLINE 2
#define SCE_C_COMMENTDOC 3
#define SCE_C_NUMBER 4
#define SCE_C_WORD 5
#define SCE_C_STRING 6
#define SCE_C_CHARACTER 7
#define SCE_C_UUID 8
#define SCE_C_PREPROCESSOR 9
#define SCE_C_OPERATOR 10
#define SCE_C_IDENTIFIER 11
#define SCE_C_STRINGEOL 12
#define SCE_C_VERBATIM 13
#define SCE_H_DEFAULT 0
#define SCE_H_TAG 1
#define SCE_H_TAGUNKNOWN 2
#define SCE_H_ATTRIBUTE 3
#define SCE_H_ATTRIBUTEUNKNOWN 4
#define SCE_H_NUMBER 5
#define SCE_H_DOUBLESTRING 6
#define SCE_H_SINGLESTRING 7
#define SCE_H_OTHER 8
#define SCE_H_COMMENT 9
#define SCE_H_ENTITY 10
#define SCE_H_TAGEND 11
#define SCE_H_XMLSTART 12
#define SCE_H_XMLEND 13
#define SCE_H_SCRIPT 14
#define SCE_H_ASP 15
#define SCE_H_ASPAT 16
#define SCE_H_CDATA 17
#define SCE_H_QUESTION 18
#define SCE_H_VALUE 19
#define SCE_HJ_START 40
#define SCE_HJ_DEFAULT 41
#define SCE_HJ_COMMENT 42
#define SCE_HJ_COMMENTLINE 43
#define SCE_HJ_COMMENTDOC 44
#define SCE_HJ_NUMBER 45
#define SCE_HJ_WORD 46
#define SCE_HJ_KEYWORD 47
#define SCE_HJ_DOUBLESTRING 48
#define SCE_HJ_SINGLESTRING 49
#define SCE_HJ_SYMBOLS 50
#define SCE_HJ_STRINGEOL 51
#define SCE_HJA_START 55
#define SCE_HJA_DEFAULT 56
#define SCE_HJA_COMMENT 57
#define SCE_HJA_COMMENTLINE 58
#define SCE_HJA_COMMENTDOC 59
#define SCE_HJA_NUMBER 60
#define SCE_HJA_WORD 61
#define SCE_HJA_KEYWORD 62
#define SCE_HJA_DOUBLESTRING 63
#define SCE_HJA_SINGLESTRING 64
#define SCE_HJA_SYMBOLS 65
#define SCE_HJA_STRINGEOL 66
#define SCE_HB_START 70
#define SCE_HB_DEFAULT 71
#define SCE_HB_COMMENTLINE 72
#define SCE_HB_NUMBER 73
#define SCE_HB_WORD 74
#define SCE_HB_STRING 75
#define SCE_HB_IDENTIFIER 76
#define SCE_HB_STRINGEOL 77
#define SCE_HBA_START 80
#define SCE_HBA_DEFAULT 81
#define SCE_HBA_COMMENTLINE 82
#define SCE_HBA_NUMBER 83
#define SCE_HBA_WORD 84
#define SCE_HBA_STRING 85
#define SCE_HBA_IDENTIFIER 86
#define SCE_HBA_STRINGEOL 87
#define SCE_HP_START 90
#define SCE_HP_DEFAULT 91
#define SCE_HP_COMMENTLINE 92
#define SCE_HP_NUMBER 93
#define SCE_HP_STRING 94
#define SCE_HP_CHARACTER 95
#define SCE_HP_WORD 96
#define SCE_HP_TRIPLE 97
#define SCE_HP_TRIPLEDOUBLE 98
#define SCE_HP_CLASSNAME 99
#define SCE_HP_DEFNAME 100
#define SCE_HP_OPERATOR 101
#define SCE_HP_IDENTIFIER 102
#define SCE_HPA_START 105
#define SCE_HPA_DEFAULT 106
#define SCE_HPA_COMMENTLINE 107
#define SCE_HPA_NUMBER 108
#define SCE_HPA_STRING 109
#define SCE_HPA_CHARACTER 110
#define SCE_HPA_WORD 111
#define SCE_HPA_TRIPLE 112
#define SCE_HPA_TRIPLEDOUBLE 113
#define SCE_HPA_CLASSNAME 114
#define SCE_HPA_DEFNAME 115
#define SCE_HPA_OPERATOR 116
#define SCE_HPA_IDENTIFIER 117
#define SCE_HPHP_DEFAULT 118
#define SCE_HPHP_HSTRING 119
#define SCE_HPHP_SIMPLESTRING 120
#define SCE_HPHP_WORD 121
#define SCE_HPHP_NUMBER 122
#define SCE_HPHP_VARIABLE 123
#define SCE_HPHP_COMMENT 124
#define SCE_HPHP_COMMENTLINE 125
#define SCE_HPHP_STRINGEOL 126
#define SCE_PL_DEFAULT 0
#define SCE_PL_HERE 1
#define SCE_PL_COMMENTLINE 2
#define SCE_PL_POD 3
#define SCE_PL_NUMBER 4
#define SCE_PL_WORD 5
#define SCE_PL_STRING 6
#define SCE_PL_CHARACTER 7
#define SCE_PL_PUNCTUATION 8
#define SCE_PL_PREPROCESSOR 9
#define SCE_PL_OPERATOR 10
#define SCE_PL_IDENTIFIER 11
#define SCE_PL_SCALAR 12
#define SCE_PL_ARRAY 13
#define SCE_PL_HASH 14
#define SCE_PL_SYMBOLTABLE 15
#define SCE_PL_REF 16
#define SCE_PL_REGEX 17
#define SCE_PL_REGSUBST 18
#define SCE_PL_LONGQUOTE 19
#define SCE_PL_BACKTICKS 20
#define SCE_PL_DATASECTION 21
#define SCE_L_DEFAULT 0
#define SCE_L_COMMAND 1
#define SCE_L_TAG 2
#define SCE_L_MATH 3
#define SCE_L_COMMENT 4
#define SCE_LUA_DEFAULT 0
#define SCE_LUA_COMMENT 1
#define SCE_LUA_COMMENTLINE 2
#define SCE_LUA_COMMENTDOC 3
#define SCE_LUA_NUMBER 4
#define SCE_LUA_WORD 5
#define SCE_LUA_STRING 6
#define SCE_LUA_CHARACTER 7
#define SCE_LUA_LITERALSTRING 8
#define SCE_LUA_PREPROCESSOR 9
#define SCE_LUA_OPERATOR 10
#define SCE_LUA_IDENTIFIER 11
#define SCE_LUA_STRINGEOL 12
#define SCE_ERR_DEFAULT 0
#define SCE_ERR_PYTHON 1
#define SCE_ERR_GCC 2
#define SCE_ERR_MS 3
#define SCE_ERR_CMD 4
#define SCE_ERR_BORLAND 5
#define SCE_ERR_PERL 6
//--Autogenerated -- end of section automatically generated from Scintilla.iface
#endif

View File

@@ -1,508 +0,0 @@
// Scintilla source code edit control
// Scintilla.h - interface to the edit control
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
// Most of this file is automatically generated from the Scintilla.iface interface definition
// file which contains any comments about the definitions. HFacer.py does the generation.
#ifndef SCINTILLA_H
#define SCINTILLA_H
// Compile-time configuration options
#define MACRO_SUPPORT 1 // Comment out to remove macro hooks
#if PLAT_WIN
#ifdef STATIC_BUILD
void Scintilla_RegisterClasses(HINSTANCE hInstance);
#endif
#endif
typedef long (*SciFnDirect)(long ptr, unsigned int iMessage, unsigned long wParam, long lParam);
//++Autogenerated -- start of section automatically generated from Scintilla.iface
#define INVALID_POSITION -1
#define SCI_START 2000
#define SCI_OPTIONAL_START 3000
#define SCI_LEXER_START 4000
#define SCI_ADDTEXT 2001
#define SCI_ADDSTYLEDTEXT 2002
#define SCI_INSERTTEXT 2003
#define SCI_CLEARALL 2004
#define SCI_CLEARDOCUMENTSTYLE 2005
#define SCI_GETLENGTH 2006
#define SCI_GETCHARAT 2007
#define SCI_GETCURRENTPOS 2008
#define SCI_GETANCHOR 2009
#define SCI_GETSTYLEAT 2010
#define SCI_REDO 2011
#define SCI_SETUNDOCOLLECTION 2012
#define SCI_SELECTALL 2013
#define SCI_SETSAVEPOINT 2014
#define SCI_GETSTYLEDTEXT 2015
#define SCI_CANREDO 2016
#define SCI_MARKERLINEFROMHANDLE 2017
#define SCI_MARKERDELETEHANDLE 2018
#define SCI_GETUNDOCOLLECTION 2019
#define SCWS_INVISIBLE 0
#define SCWS_VISIBLEALWAYS 1
#define SCWS_VISIBLEAFTERINDENT 2
#define SCI_GETVIEWWS 2020
#define SCI_SETVIEWWS 2021
#define SCI_POSITIONFROMPOINT 2022
#define SCI_GOTOLINE 2024
#define SCI_GOTOPOS 2025
#define SCI_SETANCHOR 2026
#define SCI_GETCURLINE 2027
#define SCI_GETENDSTYLED 2028
#define SCI_CONVERTEOLS 2029
#define SC_EOL_CRLF 0
#define SC_EOL_CR 1
#define SC_EOL_LF 2
#define SCI_GETEOLMODE 2030
#define SCI_SETEOLMODE 2031
#define SCI_STARTSTYLING 2032
#define SCI_SETSTYLING 2033
#define SCI_GETBUFFEREDDRAW 2034
#define SCI_SETBUFFEREDDRAW 2035
#define SCI_SETTABWIDTH 2036
#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
#define SC_MARK_ARROW 2
#define SC_MARK_SMALLRECT 3
#define SC_MARK_SHORTARROW 4
#define SC_MARK_EMPTY 5
#define SC_MARK_ARROWDOWN 6
#define SC_MARK_MINUS 7
#define SC_MARK_PLUS 8
#define SC_MARKNUM_FOLDER 30
#define SC_MARKNUM_FOLDEROPEN 31
#define SCI_MARKERDEFINE 2040
#define SCI_MARKERSETFORE 2041
#define SCI_MARKERSETBACK 2042
#define SCI_MARKERADD 2043
#define SCI_MARKERDELETE 2044
#define SCI_MARKERDELETEALL 2045
#define SCI_MARKERGET 2046
#define SCI_MARKERNEXT 2047
#define SCI_MARKERPREVIOUS 2048
#define SC_MARGIN_SYMBOL 0
#define SC_MARGIN_NUMBER 1
#define SCI_SETMARGINTYPEN 2240
#define SCI_GETMARGINTYPEN 2241
#define SCI_SETMARGINWIDTHN 2242
#define SCI_GETMARGINWIDTHN 2243
#define SCI_SETMARGINMASKN 2244
#define SCI_GETMARGINMASKN 2245
#define SCI_SETMARGINSENSITIVEN 2246
#define SCI_GETMARGINSENSITIVEN 2247
#define STYLE_DEFAULT 32
#define STYLE_LINENUMBER 33
#define STYLE_BRACELIGHT 34
#define STYLE_BRACEBAD 35
#define STYLE_CONTROLCHAR 36
#define STYLE_INDENTGUIDE 37
#define STYLE_MAX 127
#define SC_CHARSET_ANSI 0
#define SC_CHARSET_DEFAULT 1
#define SC_CHARSET_BALTIC 186
#define SC_CHARSET_CHINESEBIG5 136
#define SC_CHARSET_EASTEUROPE 238
#define SC_CHARSET_GB2312 134
#define SC_CHARSET_GREEK 161
#define SC_CHARSET_HANGUL 129
#define SC_CHARSET_MAC 77
#define SC_CHARSET_OEM 255
#define SC_CHARSET_RUSSIAN 204
#define SC_CHARSET_SHIFTJIS 128
#define SC_CHARSET_SYMBOL 2
#define SC_CHARSET_TURKISH 162
#define SC_CHARSET_JOHAB 130
#define SC_CHARSET_HEBREW 177
#define SC_CHARSET_ARABIC 178
#define SC_CHARSET_VIETNAMESE 163
#define SC_CHARSET_THAI 222
#define SCI_STYLECLEARALL 2050
#define SCI_STYLESETFORE 2051
#define SCI_STYLESETBACK 2052
#define SCI_STYLESETBOLD 2053
#define SCI_STYLESETITALIC 2054
#define SCI_STYLESETSIZE 2055
#define SCI_STYLESETFONT 2056
#define SCI_STYLESETEOLFILLED 2057
#define SCI_STYLERESETDEFAULT 2058
#define SCI_STYLESETUNDERLINE 2059
#define SCI_STYLESETCHARACTERSET 2066
#define SCI_SETSELFORE 2067
#define SCI_SETSELBACK 2068
#define SCI_SETCARETFORE 2069
#define SCI_ASSIGNCMDKEY 2070
#define SCI_CLEARCMDKEY 2071
#define SCI_CLEARALLCMDKEYS 2072
#define SCI_SETSTYLINGEX 2073
#define SCI_STYLESETVISIBLE 2074
#define SCI_GETCARETPERIOD 2075
#define SCI_SETCARETPERIOD 2076
#define SCI_SETWORDCHARS 2077
#define SCI_BEGINUNDOACTION 2078
#define SCI_ENDUNDOACTION 2079
#define INDIC_MAX 7
#define INDIC_PLAIN 0
#define INDIC_SQUIGGLE 1
#define INDIC_TT 2
#define INDIC_DIAGONAL 3
#define INDIC_STRIKE 4
#define INDIC0_MASK 32
#define INDIC1_MASK 64
#define INDIC2_MASK 128
#define INDICS_MASK INDIC0_MASK | INDIC1_MASK | INDIC2_MASK
#define SCI_INDICSETSTYLE 2080
#define SCI_INDICGETSTYLE 2081
#define SCI_INDICSETFORE 2082
#define SCI_INDICGETFORE 2083
#define SCI_SETSTYLEBITS 2090
#define SCI_GETSTYLEBITS 2091
#define SCI_SETLINESTATE 2092
#define SCI_GETLINESTATE 2093
#define SCI_GETMAXLINESTATE 2094
#define SCI_AUTOCSHOW 2100
#define SCI_AUTOCCANCEL 2101
#define SCI_AUTOCACTIVE 2102
#define SCI_AUTOCPOSSTART 2103
#define SCI_AUTOCCOMPLETE 2104
#define SCI_AUTOCSTOPS 2105
#define SCI_AUTOCSETSEPARATOR 2106
#define SCI_AUTOCGETSEPARATOR 2107
#define SCI_AUTOCSELECT 2108
#define SCI_AUTOCSETCANCELATSTART 2110
#define SCI_AUTOCGETCANCELATSTART 2111
#define SCI_AUTOCSETFILLUPS 2112
#define SCI_AUTOCSETCHOOSESINGLE 2113
#define SCI_AUTOCGETCHOOSESINGLE 2114
#define SCI_AUTOCSETIGNORECASE 2115
#define SCI_AUTOCGETIGNORECASE 2116
#define SCI_SETINDENT 2122
#define SCI_GETINDENT 2123
#define SCI_SETUSETABS 2124
#define SCI_GETUSETABS 2125
#define SCI_SETLINEINDENTATION 2126
#define SCI_GETLINEINDENTATION 2127
#define SCI_GETLINEINDENTPOSITION 2128
#define SCI_GETCOLUMN 2129
#define SCI_SETHSCROLLBAR 2130
#define SCI_GETHSCROLLBAR 2131
#define SCI_SETINDENTATIONGUIDES 2132
#define SCI_GETINDENTATIONGUIDES 2133
#define SCI_SETHIGHLIGHTGUIDE 2134
#define SCI_GETHIGHLIGHTGUIDE 2135
#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
#define SCI_GETSELECTIONSTART 2143
#define SCI_SETSELECTIONEND 2144
#define SCI_GETSELECTIONEND 2145
#define SCI_SETPRINTMAGNIFICATION 2146
#define SCI_GETPRINTMAGNIFICATION 2147
#define SC_PRINT_NORMAL 0
#define SC_PRINT_INVERTLIGHT 1
#define SC_PRINT_BLACKONWHITE 2
#define SCI_SETPRINTCOLOURMODE 2148
#define SCI_GETPRINTCOLOURMODE 2149
#define SCFIND_DOWN 1
#define SCFIND_WHOLEWORD 2
#define SCFIND_MATCHCASE 4
#define SCFIND_WORDSTART 0x00100000
#define SCFIND_REGEXP 0x00200000
#define SCI_FINDTEXT 2150
#define SCI_FORMATRANGE 2151
#define SCI_GETFIRSTVISIBLELINE 2152
#define SCI_GETLINE 2153
#define SCI_GETLINECOUNT 2154
#define SCI_SETMARGINLEFT 2155
#define SCI_GETMARGINLEFT 2156
#define SCI_SETMARGINRIGHT 2157
#define SCI_GETMARGINRIGHT 2158
#define SCI_GETMODIFY 2159
#define SCI_SETSEL 2160
#define SCI_GETSELTEXT 2161
#define SCI_GETTEXTRANGE 2162
#define SCI_HIDESELECTION 2163
#define SCI_POINTXFROMPOSITION 2164
#define SCI_POINTYFROMPOSITION 2165
#define SCI_LINEFROMPOSITION 2166
#define SCI_POSITIONFROMLINE 2167
#define SCI_LINESCROLL 2168
#define SCI_SCROLLCARET 2169
#define SCI_REPLACESEL 2170
#define SCI_SETREADONLY 2171
#define SCI_NULL 2172
#define SCI_CANPASTE 2173
#define SCI_CANUNDO 2174
#define SCI_EMPTYUNDOBUFFER 2175
#define SCI_UNDO 2176
#define SCI_CUT 2177
#define SCI_COPY 2178
#define SCI_PASTE 2179
#define SCI_CLEAR 2180
#define SCI_SETTEXT 2181
#define SCI_GETTEXT 2182
#define SCI_GETTEXTLENGTH 2183
#define SCI_GETDIRECTFUNCTION 2184
#define SCI_GETDIRECTPOINTER 2185
#define SCI_SETOVERTYPE 2186
#define SCI_GETOVERTYPE 2187
#define SCI_CALLTIPSHOW 2200
#define SCI_CALLTIPCANCEL 2201
#define SCI_CALLTIPACTIVE 2202
#define SCI_CALLTIPPOSSTART 2203
#define SCI_CALLTIPSETHLT 2204
#define SCI_CALLTIPSETBACK 2205
#define SCI_VISIBLEFROMDOCLINE 2220
#define SCI_DOCLINEFROMVISIBLE 2221
#define SC_FOLDLEVELBASE 0x400
#define SC_FOLDLEVELWHITEFLAG 0x1000
#define SC_FOLDLEVELHEADERFLAG 0x2000
#define SC_FOLDLEVELNUMBERMASK 0x0FFF
#define SCI_SETFOLDLEVEL 2222
#define SCI_GETFOLDLEVEL 2223
#define SCI_GETLASTCHILD 2224
#define SCI_GETFOLDPARENT 2225
#define SCI_SHOWLINES 2226
#define SCI_HIDELINES 2227
#define SCI_GETLINEVISIBLE 2228
#define SCI_SETFOLDEXPANDED 2229
#define SCI_GETFOLDEXPANDED 2230
#define SCI_TOGGLEFOLD 2231
#define SCI_ENSUREVISIBLE 2232
#define SCI_SETFOLDFLAGS 2233
#define SCI_LINEDOWN 2300
#define SCI_LINEDOWNEXTEND 2301
#define SCI_LINEUP 2302
#define SCI_LINEUPEXTEND 2303
#define SCI_CHARLEFT 2304
#define SCI_CHARLEFTEXTEND 2305
#define SCI_CHARRIGHT 2306
#define SCI_CHARRIGHTEXTEND 2307
#define SCI_WORDLEFT 2308
#define SCI_WORDLEFTEXTEND 2309
#define SCI_WORDRIGHT 2310
#define SCI_WORDRIGHTEXTEND 2311
#define SCI_HOME 2312
#define SCI_HOMEEXTEND 2313
#define SCI_LINEEND 2314
#define SCI_LINEENDEXTEND 2315
#define SCI_DOCUMENTSTART 2316
#define SCI_DOCUMENTSTARTEXTEND 2317
#define SCI_DOCUMENTEND 2318
#define SCI_DOCUMENTENDEXTEND 2319
#define SCI_PAGEUP 2320
#define SCI_PAGEUPEXTEND 2321
#define SCI_PAGEDOWN 2322
#define SCI_PAGEDOWNEXTEND 2323
#define SCI_EDITTOGGLEOVERTYPE 2324
#define SCI_CANCEL 2325
#define SCI_DELETEBACK 2326
#define SCI_TAB 2327
#define SCI_BACKTAB 2328
#define SCI_NEWLINE 2329
#define SCI_FORMFEED 2330
#define SCI_VCHOME 2331
#define SCI_VCHOMEEXTEND 2332
#define SCI_ZOOMIN 2333
#define SCI_ZOOMOUT 2334
#define SCI_DELWORDLEFT 2335
#define SCI_DELWORDRIGHT 2336
#define SCI_LINECUT 2337
#define SCI_LINEDELETE 2338
#define SCI_LINETRANSPOSE 2339
#define SCI_LOWERCASE 2340
#define SCI_UPPERCASE 2341
#define SCI_LINESCROLLDOWN 2342
#define SCI_LINESCROLLUP 2343
#define SCI_LINELENGTH 2350
#define SCI_BRACEHIGHLIGHT 2351
#define SCI_BRACEBADLIGHT 2352
#define SCI_BRACEMATCH 2353
#define SCI_GETVIEWEOL 2355
#define SCI_SETVIEWEOL 2356
#define SCI_GETDOCPOINTER 2357
#define SCI_SETDOCPOINTER 2358
#define SCI_SETMODEVENTMASK 2359
#define EDGE_NONE 0
#define EDGE_LINE 1
#define EDGE_BACKGROUND 2
#define SCI_GETEDGECOLUMN 2360
#define SCI_SETEDGECOLUMN 2361
#define SCI_GETEDGEMODE 2362
#define SCI_SETEDGEMODE 2363
#define SCI_GETEDGECOLOUR 2364
#define SCI_SETEDGECOLOUR 2365
#define SCI_SEARCHANCHOR 2366
#define SCI_SEARCHNEXT 2367
#define SCI_SEARCHPREV 2368
#define CARET_SLOP 0x01
#define CARET_CENTER 0x02
#define CARET_STRICT 0x04
#define SCI_SETCARETPOLICY 2369
#define SCI_LINESONSCREEN 2370
#define SCI_USEPOPUP 2371
#define SCI_SELECTIONISRECTANGLE 2372
#define SCI_SETZOOM 2373
#define SCI_GETZOOM 2374
#define SCI_CREATEDOCUMENT 2375
#define SCI_ADDREFDOCUMENT 2376
#define SCI_RELEASEDOCUMENT 2377
#define SCI_GETMODEVENTMASK 2378
#define SCI_GRABFOCUS 2400
#define SCI_STARTRECORD 3001
#define SCI_STOPRECORD 3002
#define SCI_SETLEXER 4001
#define SCI_GETLEXER 4002
#define SCI_COLOURISE 4003
#define SCI_SETPROPERTY 4004
#define SCI_SETKEYWORDS 4005
#define SC_MOD_INSERTTEXT 0x1
#define SC_MOD_DELETETEXT 0x2
#define SC_MOD_CHANGESTYLE 0x4
#define SC_MOD_CHANGEFOLD 0x8
#define SC_PERFORMED_USER 0x10
#define SC_PERFORMED_UNDO 0x20
#define SC_PERFORMED_REDO 0x40
#define SC_LASTSTEPINUNDOREDO 0x100
#define SC_MOD_CHANGEMARKER 0x200
#define SC_MOD_BEFOREINSERT 0x400
#define SC_MOD_BEFOREDELETE 0x800
#define SC_MODEVENTMASKALL 0xF77
#define SCEN_CHANGE 768
#define SCEN_SETFOCUS 512
#define SCEN_KILLFOCUS 256
#define SCK_DOWN 300
#define SCK_UP 301
#define SCK_LEFT 302
#define SCK_RIGHT 303
#define SCK_HOME 304
#define SCK_END 305
#define SCK_PRIOR 306
#define SCK_NEXT 307
#define SCK_DELETE 308
#define SCK_INSERT 309
#define SCK_ESCAPE 7
#define SCK_BACK 8
#define SCK_TAB 9
#define SCK_RETURN 13
#define SCK_ADD 310
#define SCK_SUBTRACT 311
#define SCK_DIVIDE 312
#define SCMOD_SHIFT 1
#define SCMOD_CTRL 2
#define SCMOD_ALT 4
#define SCN_STYLENEEDED 2000
#define SCN_CHARADDED 2001
#define SCN_SAVEPOINTREACHED 2002
#define SCN_SAVEPOINTLEFT 2003
#define SCN_MODIFYATTEMPTRO 2004
#define SCN_KEY 2005
#define SCN_DOUBLECLICK 2006
#define SCN_UPDATEUI 2007
#define SCN_CHECKBRACE 2007
#define SCN_MODIFIED 2008
#define SCN_MACRORECORD 2009
#define SCN_MARGINCLICK 2010
#define SCN_NEEDSHOWN 2011
#define SCN_POSCHANGED 2012
//--Autogenerated -- end of section automatically generated from Scintilla.iface
// Optional module for macro recording
#ifdef MACRO_SUPPORT
typedef void (tMacroRecorder)(unsigned int iMessage, unsigned long wParam,
long lParam, void *userData);
#endif
// These structures are defined to be exactly the same shape as the Win32
// CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs.
// So older code that treats Scintilla as a RichEdit will work.
struct CharacterRange {
long cpMin;
long cpMax;
};
struct TextRange {
CharacterRange chrg;
char *lpstrText;
};
struct TextToFind {
CharacterRange chrg;
char *lpstrText;
CharacterRange chrgText;
};
#ifdef PLATFORM_H
// This structure is used in printing and requires some of the graphics types
// from Platform.h. Not needed by most client code.
struct RangeToFormat {
SurfaceID hdc;
SurfaceID hdcTarget;
PRectangle rc;
PRectangle rcPage;
CharacterRange chrg;
};
#endif
struct NotifyHeader {
// hwndFrom is really an environment specifc window handle or pointer
// but most clients of Scintilla.h do not have this type visible.
//WindowID hwndFrom;
void *hwndFrom;
unsigned int idFrom;
unsigned int code;
};
struct SCNotification {
NotifyHeader nmhdr;
int position; // SCN_STYLENEEDED, SCN_MODIFIED
int ch; // SCN_CHARADDED, SCN_KEY
int modifiers; // SCN_KEY
int modificationType; // SCN_MODIFIED
const char *text; // SCN_MODIFIED
int length; // SCN_MODIFIED
int linesAdded; // SCN_MODIFIED
#ifdef MACRO_SUPPORT
int message; // SCN_MACRORECORD
int wParam; // SCN_MACRORECORD
int lParam; // SCN_MACRORECORD
#endif
int line; // SCN_MODIFIED
int foldLevelNow; // SCN_MODIFIED
int foldLevelPrev; // SCN_MODIFIED
int margin; // SCN_MARGINCLICK
};
#define SC_MASK_FOLDERS ((1<<SC_MARKNUM_FOLDER) | (1<<SC_MARKNUM_FOLDEROPEN))
// Deprecation section listing all API features that are deprecated and will
// will be removed completely in a future version.
// To enable these features define INCLUDE_DEPRECATED_FEATURES
#ifdef INCLUDE_DEPRECATED_FEATURES
// Deprecated in 1.27
#define SC_UNDOCOLLECT_NONE 0
#define SC_UNDOCOLLECT_AUTOSTART 1
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,46 +0,0 @@
// Scintilla source code edit control
// ScintillaWidget.h - definition of Scintilla widget for GTK+
// Only needed by GTK+ code but is harmless on other platforms.
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef SCINTILLAWIDGET_H
#define SCINTILLAWIDGET_H
#if PLAT_GTK
#ifdef __cplusplus
extern "C" {
#endif
#define SCINTILLA(obj) GTK_CHECK_CAST (obj, scintilla_get_type (), ScintillaObject)
#define SCINTILLA_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, scintilla_get_type (), ScintillaClass)
#define IS_SCINTILLA(obj) GTK_CHECK_TYPE (obj, scintilla_get_type ())
typedef struct _ScintillaObject ScintillaObject;
typedef struct _ScintillaClass ScintillaClass;
struct _ScintillaObject {
GtkFixed vbox;
void *pscin;
};
struct _ScintillaClass {
GtkFixedClass parent_class;
void (* command) (ScintillaObject *ttt);
void (* notify) (ScintillaObject *ttt);
};
guint scintilla_get_type (void);
GtkWidget* scintilla_new (void);
void scintilla_set_id (ScintillaObject *sci,int id);
long scintilla_send_message (ScintillaObject *sci,int iMessage,int wParam,int lParam);
#ifdef __cplusplus
}
#endif
#endif
#endif

View File

@@ -1,183 +0,0 @@
// Scintilla source code edit control
// WinDefs.h - the subset of definitions from Windows needed by Scintilla for GTK+
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef WINDEFS_H
#define WINDEFS_H
#define WORD short
#define WPARAM unsigned long
#define LPARAM long
#define LRESULT long
#define DWORD long
#define UINT unsigned int
#define LPSTR char *
#define LONG long
//#if 0
/* RTF control */
#define EM_CANPASTE (1074)
#define EM_CANUNDO (198)
#define EM_CHARFROMPOS (215)
#define EM_EMPTYUNDOBUFFER (205)
#define EM_EXGETSEL (1076)
#define EM_EXLINEFROMCHAR (1078)
#define EM_EXSETSEL (1079)
#define EM_FINDTEXT (1080)
#define EM_FINDTEXTEX (1103)
#define EM_FORMATRANGE (1081)
#define EM_GETFIRSTVISIBLELINE (206)
#define EM_GETLINE (196)
#define EM_GETLINECOUNT (186)
#define EM_GETMARGINS (212)
#define EM_GETMODIFY (184)
#define EM_GETRECT (178)
#define EM_GETSEL (176)
#define EM_GETSELTEXT (1086)
#define EM_GETTEXTRANGE (1099)
#define EM_HIDESELECTION (1087)
#define EM_LINEFROMCHAR (201)
#define EM_LINEINDEX (187)
#define EM_LINELENGTH (193)
#define EM_LINESCROLL (182)
#define EM_POSFROMCHAR (214)
#define EM_REPLACESEL (194)
#define EM_SCROLLCARET (183)
#define EM_SELECTIONTYPE (1090)
#define EM_SETMARGINS (211)
#define EM_SETREADONLY (207)
#define EM_SETSEL (177)
#define EM_UNDO (199)
#define WM_NULL (0)
#define WM_CLEAR (771)
#define WM_COPY (769)
#define WM_CUT (768)
#define WM_GETTEXT (13)
#define WM_GETTEXTLENGTH (14)
#define WM_PASTE (770)
#define WM_SETTEXT (12)
#define WM_UNDO (772)
#define EN_CHANGE (768)
#define EN_KILLFOCUS (512)
#define EN_SETFOCUS (256)
#define EC_LEFTMARGIN 1
#define EC_RIGHTMARGIN 2
#define EC_USEFONTINFO 0xffff
//#endif
#if 0
#if PLAT_GTK
#define VK_DOWN GDK_Down
#define VK_UP GDK_Up
#define VK_LEFT GDK_Left
#define VK_RIGHT GDK_Right
#define VK_HOME GDK_Home
#define VK_END GDK_End
#define VK_PRIOR GDK_Page_Up
#define VK_NEXT GDK_Page_Down
#define VK_DELETE GDK_Delete
#define VK_INSERT GDK_Insert
#define VK_ESCAPE GDK_Escape
#define VK_BACK GDK_BackSpace
#define VK_TAB GDK_Tab
#define VK_RETURN GDK_Return
#define VK_ADD GDK_KP_Add
#define VK_SUBTRACT GDK_KP_Subtract
#define VK_DIVIDE GDK_KP_Divide
#endif
#if PLAT_WX
#define VK_DOWN WXK_DOWN
#define VK_UP WXK_UP
#define VK_LEFT WXK_LEFT
#define VK_RIGHT WXK_RIGHT
#define VK_HOME WXK_HOME
#define VK_END WXK_END
#define VK_PRIOR WXK_PRIOR
#define VK_NEXT WXK_NEXT
#define VK_DELETE WXK_DELETE
#define VK_INSERT WXK_INSERT
#define VK_ESCAPE WXK_ESCAPE
#define VK_BACK WXK_BACK
#define VK_TAB WXK_TAB
#define VK_RETURN WXK_RETURN
#define VK_ADD WXK_ADD
#define VK_SUBTRACT WXK_SUBTRACT
//TODO:
#define VK_DIVIDE WXK_DIVIDE
#endif
#define SHIFT_PRESSED 1
#define LEFT_CTRL_PRESSED 2
#define LEFT_ALT_PRESSED 4
// Are these needed any more
#define LPSTR char *
#define LONG long
#define LPDWORD (long *)
/* SELCHANGE structure */
#define SEL_EMPTY (0)
#define SEL_TEXT (1)
#define SEL_OBJECT (2)
#define SEL_MULTICHAR (4)
#define SEL_MULTIOBJECT (8)
struct RECT {
LONG left;
LONG top;
LONG right;
LONG bottom;
};
/* FINDREPLACE structure */
#define FR_MATCHCASE (0x4)
#define FR_WHOLEWORD (0x2)
#define FR_DOWN (0x1)
#endif
#if 0
struct CHARRANGE {
LONG cpMin;
LONG cpMax;
};
struct TEXTRANGE {
CHARRANGE chrg;
LPSTR lpstrText;
};
struct FINDTEXTEX {
CHARRANGE chrg;
LPSTR lpstrText;
CHARRANGE chrgText;
};
struct NMHDR {
WindowID hwndFrom;
UINT idFrom;
UINT code;
};
struct FORMATRANGE {
SurfaceID hdc;
SurfaceID hdcTarget;
RECT rc;
RECT rcPage;
CHARRANGE chrg;
};
#endif
//#define MAKELONG(a, b) ((a) | ((b) << 16))
//#define LOWORD(x) (x & 0xffff)
//#define HIWORD(x) (x >> 16)
#endif

View File

@@ -1,47 +0,0 @@
// WindowAccessor.h - implementation of BufferAccess and StylingAccess on a Scintilla rapid easy access to contents of a Scintilla
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
class WindowAccessor : public Accessor {
// Private so WindowAccessor objects can not be copied
WindowAccessor(const WindowAccessor &source) : Accessor(), props(source.props) {}
WindowAccessor &operator=(const WindowAccessor &) { return *this; }
protected:
WindowID id;
PropSet &props;
int lenDoc;
char styleBuf[bufferSize];
int validLen;
char chFlags;
char chWhile;
unsigned int startSeg;
bool InternalIsLeadByte(char ch);
void Fill(int position);
public:
WindowAccessor(WindowID id_, PropSet &props_) :
Accessor(), id(id_), props(props_),
lenDoc(-1), validLen(0), chFlags(0), chWhile(0) {
}
~WindowAccessor();
char StyleAt(int position);
int GetLine(int position);
int LineStart(int line);
int LevelAt(int line);
int Length();
void Flush();
int GetLineState(int line);
int SetLineState(int line, int state);
int GetPropertyInt(const char *key, int defaultValue=0) {
return props.GetInt(key, defaultValue);
}
void StartAt(unsigned int start, char chMask=31);
void SetFlags(char chFlags_, char chWhile_) {chFlags = chFlags_; chWhile = chWhile_; };
unsigned int GetStartSegment() { return startSeg; }
void StartSegment(unsigned int pos);
void ColourTo(unsigned int pos, int chAttr);
void SetLevel(int line, int level);
int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0);
};

View File

@@ -1,121 +0,0 @@
// Scintilla source code edit control
// AutoComplete.cxx - defines the auto completion list box
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include "Platform.h"
#include "AutoComplete.h"
AutoComplete::AutoComplete() :
active(false),
separator(' '),
ignoreCase(false),
chooseSingle(false),
posStart(0),
startLen(0),
cancelAtStartPos(true) {
stopChars[0] = '\0';
fillUpChars[0] = '\0';
}
AutoComplete::~AutoComplete() {
lb.Destroy();
}
bool AutoComplete::Active() {
return active;
}
void AutoComplete::Start(Window &parent, int ctrlID, int position, int startLen_) {
if (!lb.Created()) {
lb.Create(parent, ctrlID);
}
lb.Clear();
active = true;
startLen = startLen_;
posStart = position;
}
void AutoComplete::SetStopChars(const char *stopChars_) {
strncpy(stopChars, stopChars_, sizeof(stopChars));
stopChars[sizeof(stopChars) - 1] = '\0';
}
bool AutoComplete::IsStopChar(char ch) {
return ch && strchr(stopChars, ch);
}
void AutoComplete::SetFillUpChars(const char *fillUpChars_) {
strncpy(fillUpChars, fillUpChars_, sizeof(fillUpChars));
fillUpChars[sizeof(fillUpChars) - 1] = '\0';
}
bool AutoComplete::IsFillUpChar(char ch) {
return ch && strchr(fillUpChars, ch);
}
void AutoComplete::SetSeparator(char separator_) {
separator = separator_;
}
char AutoComplete::GetSeparator() {
return separator;
}
void AutoComplete::SetList(const char *list) {
lb.Clear();
char *words = new char[strlen(list) + 1];
if (words) {
strcpy(words, list);
char *startword = words;
int i = 0;
for (; words && words[i]; i++) {
if (words[i] == separator) {
words[i] = '\0';
lb.Append(startword);
startword = words + i + 1;
}
}
if (startword) {
lb.Append(startword);
}
delete []words;
}
lb.Sort();
}
void AutoComplete::Show() {
lb.Show();
lb.Select(0);
}
void AutoComplete::Cancel() {
if (lb.Created()) {
lb.Destroy();
active = false;
}
}
void AutoComplete::Move(int delta) {
int count = lb.Length();
int current = lb.GetSelection();
current += delta;
if (current >= count)
current = count - 1;
if (current < 0)
current = 0;
lb.Select(current);
}
void AutoComplete::Select(const char *word) {
int pos = lb.Find(word);
//Platform::DebugPrintf("Autocompleting at <%s> %d\n", wordCurrent, pos);
if (pos != -1)
lb.Select(pos);
}

View File

@@ -1,57 +0,0 @@
// Scintilla source code edit control
// AutoComplete.h - defines the auto completion list box
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef AUTOCOMPLETE_H
#define AUTOCOMPLETE_H
class AutoComplete {
bool active;
char stopChars[256];
char fillUpChars[256];
char separator;
public:
bool ignoreCase;
bool chooseSingle;
ListBox lb;
int posStart;
int startLen;
// Should autocompletion be canceled if editor's currentPos <= startPos?
bool cancelAtStartPos;
AutoComplete();
~AutoComplete();
// Is the auto completion list displayed?
bool Active();
// Display the auto completion list positioned to be near a character position
void Start(Window &parent, int ctrlID, int position, int startLen_);
// The stop chars are characters which, when typed, cause the auto completion list to disappear
void SetStopChars(const char *stopChars_);
bool IsStopChar(char ch);
// The fillup chars are characters which, when typed, fill up the selected word
void SetFillUpChars(const char *fillUpChars_);
bool IsFillUpChar(char ch);
// The separator character is used when interpreting the list in SetList
void SetSeparator(char separator_);
char GetSeparator();
// The list string contains a sequence of words separated by the separator character
void SetList(const char *list);
void Show();
void Cancel();
// Move the current list element by delta, scrolling appropriately
void Move(int delta);
// Select a list element that starts with word as the current element
void Select(const char *word);
};
#endif

View File

@@ -1,169 +0,0 @@
// Scintilla source code edit control
// CallTip.cxx - code for displaying call tips
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include "Platform.h"
#include "Scintilla.h"
#include "CallTip.h"
CallTip::CallTip() {
wCallTip = 0;
inCallTipMode = false;
posStartCallTip = 0;
val = 0;
startHighlight = 0;
endHighlight = 0;
colourBG.desired = Colour(0xff, 0xff, 0xff);
colourUnSel.desired = Colour(0x80, 0x80, 0x80);
colourSel.desired = Colour(0, 0, 0x80);
colourShade.desired = Colour(0, 0, 0);
colourLight.desired = Colour(0xc0, 0xc0, 0xc0);
}
CallTip::~CallTip() {
wCallTip.Destroy();
delete []val;
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);
}
void CallTip::PaintCT(Surface *surfaceWindow) {
if (!val)
return;
PRectangle rcClientPos = wCallTip.GetClientPosition();
PRectangle rcClientSize(0, 0, rcClientPos.right - rcClientPos.left,
rcClientPos.bottom - rcClientPos.top);
PRectangle rcClient(1, 1, rcClientSize.right - 1, rcClientSize.bottom - 1);
surfaceWindow->FillRectangle(rcClient, colourBG.allocated);
// To make a nice small call tip window, it is only sized to fit most normal characters without accents
int lineHeight = surfaceWindow->Height(font);
int ascent = surfaceWindow->Ascent(font) - surfaceWindow->InternalLeading(font);
// For each line...
// Draw the definition in three parts: before highlight, highlighted, after highlight
int ytext = rcClient.top + ascent + 1;
char *chunkVal = val;
bool moreChunks = true;
while (moreChunks) {
char *chunkEnd = strchr(chunkVal, '\n');
if (chunkEnd == NULL) {
chunkEnd = chunkVal + strlen(chunkVal);
moreChunks = false;
}
int chunkOffset = chunkVal - val;
int chunkLength = chunkEnd - chunkVal;
int chunkEndOffset = chunkOffset + chunkLength;
int thisStartHighlight = Platform::Maximum(startHighlight, chunkOffset);
thisStartHighlight = Platform::Minimum(thisStartHighlight, chunkEndOffset);
thisStartHighlight -= chunkOffset;
int thisEndHighlight = Platform::Maximum(endHighlight, chunkOffset);
thisEndHighlight = Platform::Minimum(thisEndHighlight, chunkEndOffset);
thisEndHighlight -= chunkOffset;
int x = 5;
int xEnd = x + surfaceWindow->WidthText(font, chunkVal, thisStartHighlight);
rcClient.left = x;
rcClient.top = ytext - ascent - 1;
rcClient.right = xEnd;
surfaceWindow->DrawText(rcClient, font, ytext,
chunkVal, thisStartHighlight,
colourUnSel.allocated, colourBG.allocated);
x = xEnd;
xEnd = x + surfaceWindow->WidthText(font, chunkVal + thisStartHighlight,
thisEndHighlight - thisStartHighlight);
rcClient.top = ytext;
rcClient.left = x;
rcClient.right = xEnd;
surfaceWindow->DrawText(rcClient, font, ytext,
chunkVal + thisStartHighlight, thisEndHighlight - thisStartHighlight,
colourSel.allocated, colourBG.allocated);
x = xEnd;
xEnd = x + surfaceWindow->WidthText(font, chunkVal + thisEndHighlight,
chunkLength - thisEndHighlight);
rcClient.left = x;
rcClient.right = xEnd;
surfaceWindow->DrawText(rcClient, font, ytext,
chunkVal + thisEndHighlight, chunkLength - thisEndHighlight,
colourUnSel.allocated, colourBG.allocated);
chunkVal = chunkEnd + 1;
ytext += lineHeight;
}
// Draw a raised border around the edges of the window
surfaceWindow->MoveTo(0, rcClientSize.bottom - 1);
surfaceWindow->PenColour(colourShade.allocated);
surfaceWindow->LineTo(rcClientSize.right - 1, rcClientSize.bottom - 1);
surfaceWindow->LineTo(rcClientSize.right - 1, 0);
surfaceWindow->PenColour(colourLight.allocated);
surfaceWindow->LineTo(0, 0);
surfaceWindow->LineTo(0, rcClientSize.bottom - 1);
}
PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn,
const char *faceName, int size) {
Surface surfaceMeasure;
surfaceMeasure.Init();
int deviceHeight = (size * surfaceMeasure.LogPixelsY()) / 72;
font.Create(faceName, SC_CHARSET_DEFAULT, deviceHeight, false, false);
if (val)
delete []val;
val = new char[strlen(defn) + 1];
if (!val)
return PRectangle();
strcpy(val, defn);
startHighlight = 0;
endHighlight = 0;
inCallTipMode = true;
posStartCallTip = pos;
// Look for multiple lines in the text
// Only support \n here - simply means container must avoid \r!
int width = 0;
int numLines = 1;
const char *newline;
const char *look = val;
while ((newline = strchr(look, '\n')) != NULL) {
int thisWidth = surfaceMeasure.WidthText(font, look, newline - look);
width = Platform::Maximum(width, thisWidth);
look = newline + 1;
numLines++;
}
int lastWidth = surfaceMeasure.WidthText(font, look, strlen(look));
width = Platform::Maximum(width, lastWidth) + 10;
int lineHeight = surfaceMeasure.Height(font);
// Extra line for border and an empty line at top and bottom
int height = lineHeight * numLines - surfaceMeasure.InternalLeading(font) + 2 + 2;
return PRectangle(pt.x -5, pt.y + lineHeight + 1, pt.x + width - 5, pt.y + lineHeight + 1 + height);
}
void CallTip::CallTipCancel() {
inCallTipMode = false;
if (wCallTip.Created()) {
wCallTip.Destroy();
}
}
void CallTip::SetHighlight(int start, int end) {
// Avoid flashing by checking something has really changed
if ((start != startHighlight) || (end != endHighlight)) {
startHighlight = start;
endHighlight = end;
if (wCallTip.Created()) {
wCallTip.InvalidateAll();
}
}
}

View File

@@ -1,47 +0,0 @@
// Scintilla source code edit control
// CallTip.h - interface to the call tip control
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef CALLTIP_H
#define CALLTIP_H
class CallTip {
int startHighlight;
int endHighlight;
char *val;
Font font;
// Private so CallTip objects can not be copied
CallTip(const CallTip &) {}
CallTip &operator=(const CallTip &) { return *this; }
public:
Window wCallTip;
Window wDraw;
bool inCallTipMode;
int posStartCallTip;
ColourPair colourBG;
ColourPair colourUnSel;
ColourPair colourSel;
ColourPair colourShade;
ColourPair colourLight;
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);
// Setup the calltip and return a rectangle of the area required
PRectangle CallTipStart(int pos, Point pt, const char *defn,
const char *faceName, int size);
void CallTipCancel();
// Set a range of characters to be displayed in a highlight style.
// Commonly used to highlight the current parameter.
void SetHighlight(int start, int end);
};
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,229 +0,0 @@
// Scintilla source code edit control
// CellBuffer.h - manages the text of the document
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef CELLBUFFER_H
#define CELLBUFFER_H
// This holds the marker identifier and the marker type to display.
// MarkerHandleNumbers are members of lists.
struct MarkerHandleNumber {
int handle;
int number;
MarkerHandleNumber *next;
};
// A marker handle set contains any number of MarkerHandleNumbers
class MarkerHandleSet {
MarkerHandleNumber *root;
public:
MarkerHandleSet();
~MarkerHandleSet();
int Length();
int NumberFromHandle(int handle);
int MarkValue(); // Bit set of marker numbers
bool Contains(int handle);
bool InsertHandle(int handle, int markerNum);
void RemoveHandle(int handle);
void RemoveNumber(int markerNum);
void CombineWith(MarkerHandleSet *other);
};
// Each line stores the starting position of the first character of the line in the cell buffer
// and potentially a marker handle set. Often a line will not have any attached markers.
struct LineData {
int startPosition;
MarkerHandleSet *handleSet;
LineData() : startPosition(0), handleSet(0) {
}
};
// The line vector contains information about each of the lines in a cell buffer.
class LineVector {
public:
enum { growSize = 4000 };
int lines;
LineData *linesData;
int size;
int *levels;
int sizeLevels;
// Handles are allocated sequentially and should never have to be reused as 32 bit ints are very big.
int handleCurrent;
LineVector();
~LineVector();
void Init();
void Expand(int sizeNew);
void ExpandLevels(int sizeNew=-1);
void ClearLevels();
void InsertValue(int pos, int value);
void SetValue(int pos, int value);
void Remove(int pos);
int LineFromPosition(int pos);
int AddMark(int line, int marker);
void MergeMarkers(int pos);
void DeleteMark(int line, int markerNum);
void DeleteMarkFromHandle(int markerHandle);
int LineFromHandle(int markerHandle);
};
// Actions are used to store all the information required to perform one undo/redo step.
enum actionType { insertAction, removeAction, startAction };
class Action {
public:
actionType at;
int position;
char *data;
int lenData;
bool mayCoalesce;
Action();
~Action();
void Create(actionType at_, int position_=0, char *data_=0, int lenData_=0, bool mayCoalesce_=true);
void Destroy();
void Grab(Action *source);
};
class UndoHistory {
Action *actions;
int lenActions;
int maxAction;
int currentAction;
int undoSequenceDepth;
int savePoint;
void EnsureUndoRoom();
public:
UndoHistory();
~UndoHistory();
void AppendAction(actionType at, int position, char *data, int length);
void BeginUndoAction();
void EndUndoAction();
void DropUndoSequence();
void DeleteUndoHistory();
// The save point is a marker in the undo stack where the container has stated that
// the buffer was saved. Undo and redo can move over the save point.
void SetSavePoint();
bool IsSavePoint() const;
// To perform an undo, StartUndo is called to retrieve the number of steps, then UndoStep is
// called that many times. Similarly for redo.
bool CanUndo() const;
int StartUndo();
const Action &GetUndoStep() const;
void CompletedUndoStep();
bool CanRedo() const;
int StartRedo();
const Action &GetRedoStep() const;
void CompletedRedoStep();
};
// Holder for an expandable array of characters that supports undo and line markers
// Based on article "Data Structures in a Bit-Mapped Text Editor"
// by Wilfred J. Hansen, Byte January 1987, page 183
class CellBuffer {
private:
char *body;
int size;
int length;
int part1len;
int gaplen;
char *part2body;
bool readOnly;
bool collectingUndo;
UndoHistory uh;
LineVector lv;
SVector lineStates;
void GapTo(int position);
void RoomFor(int insertionLength);
inline char ByteAt(int position);
void SetByteAt(int position, char ch);
public:
CellBuffer(int initialLength = 4000);
~CellBuffer();
// Retrieving positions outside the range of the buffer works and returns 0
char CharAt(int position);
void GetCharRange(char *buffer, int position, int lengthRetrieve);
char StyleAt(int position);
int ByteLength();
int Length();
int Lines();
int LineStart(int line);
int LineFromPosition(int pos) { return lv.LineFromPosition(pos); }
const char *InsertString(int position, char *s, int insertLength);
void InsertCharStyle(int position, char ch, char style);
// Setting styles for positions outside the range of the buffer is safe and has no effect.
// True is returned if the style of a character changed.
bool SetStyleAt(int position, char style, char mask='\377');
bool SetStyleFor(int position, int length, char style, char mask);
const char *DeleteChars(int position, int deleteLength);
bool IsReadOnly();
void SetReadOnly(bool set);
// The save point is a marker in the undo stack where the container has stated that
// the buffer was saved. Undo and redo can move over the save point.
void SetSavePoint();
bool IsSavePoint();
// Line marker functions
int AddMark(int line, int markerNum);
void DeleteMark(int line, int markerNum);
void DeleteMarkFromHandle(int markerHandle);
int GetMark(int line);
void DeleteAllMarks(int markerNum);
int LineFromHandle(int markerHandle);
// Without undo
void BasicInsertString(int position, char *s, int insertLength);
void BasicDeleteChars(int position, int deleteLength);
bool SetUndoCollection(bool collectUndo);
bool IsCollectingUndo();
void BeginUndoAction();
void EndUndoAction();
void DeleteUndoHistory();
// To perform an undo, StartUndo is called to retrieve the number of steps, then UndoStep is
// called that many times. Similarly for redo.
bool CanUndo();
int StartUndo();
const Action &GetUndoStep() const;
void PerformUndoStep();
bool CanRedo();
int StartRedo();
const Action &GetRedoStep() const;
void PerformRedoStep();
int SetLineState(int line, int state);
int GetLineState(int line);
int GetMaxLineState();
int SetLevel(int line, int level);
int GetLevel(int line);
void ClearLevels();
};
#define CELL_SIZE 2
#endif

View File

@@ -1,208 +0,0 @@
// Scintilla source code edit control
// ContractionState.cxx - manages visibility of lines for folding
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include "Platform.h"
#include "ContractionState.h"
OneLine::OneLine() {
displayLine = 0;
docLine = 0;
visible = true;
expanded = true;
}
ContractionState::ContractionState() {
lines = 0;
size = 0;
linesInDoc = 1;
linesInDisplay = 1;
valid = false;
}
ContractionState::~ContractionState() {
Clear();
}
void ContractionState::MakeValid() const {
if (!valid) {
// Could be cleverer by keeping the index of the last still valid entry
// rather than invalidating all.
int lineDisplay = 0;
for (int line=0; line<linesInDoc; line++) {
lines[line].displayLine = lineDisplay;
if (lines[line].visible) {
lines[lineDisplay].docLine = line;
lineDisplay++;
}
}
valid = true;
}
}
void ContractionState::Clear() {
delete []lines;
lines = 0;
size = 0;
linesInDoc = 1;
linesInDisplay = 1;
}
int ContractionState::LinesInDoc() const {
return linesInDoc;
}
int ContractionState::LinesDisplayed() const {
return linesInDisplay;
}
int ContractionState::DisplayFromDoc(int lineDoc) const {
if (size == 0) {
return lineDoc;
}
MakeValid();
if ((lineDoc >= 0) && (lineDoc < linesInDoc)) {
return lines[lineDoc].displayLine;
}
return -1;
}
int ContractionState::DocFromDisplay(int lineDisplay) const {
if (lineDisplay <= 0)
return 0;
if (lineDisplay >= linesInDisplay)
return linesInDoc-1;
if (size == 0)
return lineDisplay;
MakeValid();
return lines[lineDisplay].docLine;
}
void ContractionState::Grow(int sizeNew) {
OneLine *linesNew = new OneLine[sizeNew];
if (linesNew) {
int i = 0;
for (; i < size; i++) {
linesNew[i] = lines[i];
}
for (; i < sizeNew; i++) {
linesNew[i].displayLine = i;
}
delete []lines;
lines = linesNew;
size = sizeNew;
valid = false;
} else {
Platform::DebugPrintf("No memory available\n");
// TODO: Blow up
}
}
void ContractionState::InsertLines(int lineDoc, int lineCount) {
if (size == 0) {
linesInDoc += lineCount;
linesInDisplay += lineCount;
return;
}
//Platform::DebugPrintf("InsertLine[%d] = %d\n", lineDoc);
if ((linesInDoc + lineCount + 2) >= size) {
Grow(linesInDoc + lineCount + growSize);
}
linesInDoc += lineCount;
linesInDisplay += lineCount;
for (int i = linesInDoc; i >= lineDoc + lineCount; i--) {
lines[i].visible = lines[i - lineCount].visible;
lines[i].expanded = lines[i - lineCount].expanded;
}
for (int d=0;d<lineCount;d++) {
lines[lineDoc+d].visible = true; // Should inherit visibility from context ?
lines[lineDoc+d].expanded = true;
}
valid = false;
}
void ContractionState::DeleteLines(int lineDoc, int lineCount) {
if (size == 0) {
linesInDoc -= lineCount;
linesInDisplay -= lineCount;
return;
}
int deltaDisplayed = 0;
for (int d=0;d<lineCount;d++) {
if (lines[lineDoc+d].visible)
deltaDisplayed--;
}
for (int i = lineDoc; i < linesInDoc-lineCount; i++) {
if (i != 0) // Line zero is always visible
lines[i].visible = lines[i + lineCount].visible;
lines[i].expanded = lines[i + lineCount].expanded;
}
linesInDoc -= lineCount;
linesInDisplay += deltaDisplayed;
valid = false;
}
bool ContractionState::GetVisible(int lineDoc) const {
if (size == 0)
return true;
if ((lineDoc >= 0) && (lineDoc < linesInDoc)) {
return lines[lineDoc].visible;
} else {
return false;
}
}
bool ContractionState::SetVisible(int lineDocStart, int lineDocEnd, bool visible) {
if (lineDocStart == 0)
lineDocStart++;
if (lineDocStart > lineDocEnd)
return false;
if (size == 0) {
Grow(linesInDoc + growSize);
}
// TODO: modify docLine members to mirror displayLine
int delta = 0;
// Change lineDocs
if ((lineDocStart <= lineDocEnd) && (lineDocStart >= 0) && (lineDocEnd < linesInDoc)) {
for (int line=lineDocStart; line <= lineDocEnd; line++) {
if (lines[line].visible != visible) {
delta += visible ? 1 : -1;
lines[line].visible = visible;
}
}
}
linesInDisplay += delta;
valid = false;
return delta != 0;
}
bool ContractionState::GetExpanded(int lineDoc) const {
if (size == 0)
return true;
if ((lineDoc >= 0) && (lineDoc < linesInDoc)) {
return lines[lineDoc].expanded;
} else {
return false;
}
}
bool ContractionState::SetExpanded(int lineDoc, bool expanded) {
if (size == 0) {
Grow(linesInDoc + growSize);
}
if ((lineDoc >= 0) && (lineDoc < linesInDoc)) {
if (lines[lineDoc].expanded != expanded) {
lines[lineDoc].expanded = expanded;
return true;
}
}
return false;
}
void ContractionState::ShowAll() {
delete []lines;
lines = 0;
size = 0;
}

View File

@@ -1,52 +0,0 @@
// Scintilla source code edit control
// ContractionState.h - manages visibility of lines for folding
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef CONTRACTIONSTATE_H
#define CONTRACTIONSTATE_H
class OneLine {
public:
int displayLine; // position within set of visible lines
int docLine; // inverse of displayLine
bool visible;
bool expanded;
OneLine();
virtual ~OneLine() {}
};
class ContractionState {
void Grow(int sizeNew);
enum { growSize = 4000 };
int linesInDoc;
int linesInDisplay;
mutable OneLine *lines;
int size;
mutable bool valid;
void MakeValid() const;
public:
ContractionState();
virtual ~ContractionState();
void Clear();
int LinesInDoc() const;
int LinesDisplayed() const;
int DisplayFromDoc(int lineDoc) const;
int DocFromDisplay(int lineDisplay) const;
void InsertLines(int lineDoc, int lineCount);
void DeleteLines(int lineDoc, int lineCount);
bool GetVisible(int lineDoc) const;
bool SetVisible(int lineDocStart, int lineDocEnd, bool visible);
bool GetExpanded(int lineDoc) const;
bool SetExpanded(int lineDoc, bool expanded);
void ShowAll();
};
#endif

View File

@@ -1,960 +0,0 @@
// Scintilla source code edit control
// Document.cxx - text document that handles notifications, DBCS, styling, words and end of line
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include "Platform.h"
#include "Scintilla.h"
#include "SVector.h"
#include "CellBuffer.h"
#include "Document.h"
Document::Document() {
refCount = 0;
#ifdef unix
eolMode = SC_EOL_LF;
#else
eolMode = SC_EOL_CRLF;
#endif
dbcsCodePage = 0;
stylingBits = 5;
stylingBitsMask = 0x1F;
stylingPos = 0;
stylingMask = 0;
for (int ch = 0; ch < 256; ch++) {
wordchars[ch] = isalnum(ch) || ch == '_';
}
endStyled = 0;
enteredCount = 0;
enteredReadOnlyCount = 0;
tabInChars = 8;
indentInChars = 0;
useTabs = true;
watchers = 0;
lenWatchers = 0;
}
Document::~Document() {
for (int i = 0; i < lenWatchers; i++) {
watchers[i].watcher->NotifyDeleted(this, watchers[i].userData);
}
delete []watchers;
watchers = 0;
lenWatchers = 0;
}
// Increase reference count and return its previous value.
int Document::AddRef() {
return refCount++;
}
// Decrease reference count and return its previous value.
// Delete the document if reference count reaches zero.
int Document::Release() {
int curRefCount = --refCount;
if (curRefCount == 0)
delete this;
return curRefCount;
}
void Document::SetSavePoint() {
cb.SetSavePoint();
NotifySavePoint(true);
}
int Document::AddMark(int line, int markerNum) {
int prev = cb.AddMark(line, markerNum);
DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0);
NotifyModified(mh);
return prev;
}
void Document::DeleteMark(int line, int markerNum) {
cb.DeleteMark(line, markerNum);
DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0);
NotifyModified(mh);
}
void Document::DeleteMarkFromHandle(int markerHandle) {
cb.DeleteMarkFromHandle(markerHandle);
DocModification mh(SC_MOD_CHANGEMARKER, 0, 0, 0, 0);
NotifyModified(mh);
}
void Document::DeleteAllMarks(int markerNum) {
cb.DeleteAllMarks(markerNum);
DocModification mh(SC_MOD_CHANGEMARKER, 0, 0, 0, 0);
NotifyModified(mh);
}
int Document::LineStart(int line) {
return cb.LineStart(line);
}
int Document::LineEnd(int line) {
if (line == LinesTotal() - 1) {
return LineStart(line + 1);
} else {
int position = LineStart(line + 1) - 1;
// When line terminator is CR+LF, may need to go back one more
if ((position > LineStart(line)) && (cb.CharAt(position - 1) == '\r')) {
position--;
}
return position;
}
}
int Document::LineFromPosition(int pos) {
return cb.LineFromPosition(pos);
}
int Document::LineEndPosition(int position) {
return LineEnd(LineFromPosition(position));
}
int Document::VCHomePosition(int position) {
int line = LineFromPosition(position);
int startPosition = LineStart(line);
int endLine = LineStart(line + 1) - 1;
int startText = startPosition;
while (startText < endLine && (cb.CharAt(startText) == ' ' || cb.CharAt(startText) == '\t' ) )
startText++;
if (position == startText)
return startPosition;
else
return startText;
}
int Document::SetLevel(int line, int level) {
int prev = cb.SetLevel(line, level);
if (prev != level) {
DocModification mh(SC_MOD_CHANGEFOLD, LineStart(line), 0, 0, 0);
mh.line = line;
mh.foldLevelNow = level;
mh.foldLevelPrev = prev;
NotifyModified(mh);
}
return prev;
}
static bool IsSubordinate(int levelStart, int levelTry) {
if (levelTry & SC_FOLDLEVELWHITEFLAG)
return true;
else
return (levelStart & SC_FOLDLEVELNUMBERMASK) < (levelTry & SC_FOLDLEVELNUMBERMASK);
}
int Document::GetLastChild(int lineParent, int level) {
if (level == -1)
level = GetLevel(lineParent) & SC_FOLDLEVELNUMBERMASK;
int maxLine = LinesTotal();
int lineMaxSubord = lineParent;
while (lineMaxSubord < maxLine-1) {
EnsureStyledTo(LineStart(lineMaxSubord+2));
if (!IsSubordinate(level, GetLevel(lineMaxSubord+1)))
break;
lineMaxSubord++;
}
if (lineMaxSubord > lineParent) {
if (level > (GetLevel(lineMaxSubord+1) & SC_FOLDLEVELNUMBERMASK)) {
// Have chewed up some whitespace that belongs to a parent so seek back
if ((lineMaxSubord > lineParent) && (GetLevel(lineMaxSubord) & SC_FOLDLEVELWHITEFLAG)) {
lineMaxSubord--;
}
}
}
return lineMaxSubord;
}
int Document::GetFoldParent(int line) {
int level = GetLevel(line);
int lineLook = line-1;
while ((lineLook > 0) && (
(!(GetLevel(lineLook) & SC_FOLDLEVELHEADERFLAG)) ||
((GetLevel(lineLook) & SC_FOLDLEVELNUMBERMASK) >= level))
) {
lineLook--;
}
if ((GetLevel(lineLook) & SC_FOLDLEVELHEADERFLAG) &&
((GetLevel(lineLook) & SC_FOLDLEVELNUMBERMASK) < level)) {
return lineLook;
} else {
return -1;
}
}
int Document::ClampPositionIntoDocument(int pos) {
return Platform::Clamp(pos, 0, Length());
}
bool Document::IsCrLf(int pos) {
if (pos < 0)
return false;
if (pos >= (Length() - 1))
return false;
return (cb.CharAt(pos) == '\r') && (cb.CharAt(pos + 1) == '\n');
}
#if PLAT_WIN
bool Document::IsDBCS(int pos) {
if (dbcsCodePage) {
if (SC_CP_UTF8 == dbcsCodePage) {
unsigned char ch = static_cast<unsigned char>(cb.CharAt(pos));
return ch >= 0x80;
} else {
// Anchor DBCS calculations at start of line because start of line can
// not be a DBCS trail byte.
int startLine = pos;
while (startLine > 0 && cb.CharAt(startLine) != '\r' && cb.CharAt(startLine) != '\n')
startLine--;
while (startLine <= pos) {
if (IsDBCSLeadByteEx(dbcsCodePage, cb.CharAt(startLine))) {
startLine++;
if (startLine >= pos)
return true;
}
startLine++;
}
}
}
return false;
}
#else
// PLAT_GTK or PLAT_WX
// TODO: support DBCS under GTK+ and WX
bool Document::IsDBCS(int) {
return false;
}
#endif
int Document::LenChar(int pos) {
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))
len = 3;
int lengthDoc = Length();
if ((pos + len) > lengthDoc)
return lengthDoc-pos;
else
return len;
} else if (IsDBCS(pos)) {
return 2;
} else {
return 1;
}
}
// Normalise a position so that it is not halfway through a two byte character.
// This can occur in two situations -
// When lines are terminated with \r\n pairs which should be treated as one character.
// When displaying DBCS text such as Japanese.
// If moving, move the position in the indicated direction.
int Document::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) {
//Platform::DebugPrintf("NoCRLF %d %d\n", pos, moveDir);
// If out of range, just return value - should be fixed up after
if (pos < 0)
return pos;
if (pos > Length())
return pos;
// Position 0 and Length() can not be between any two characters
if (pos == 0)
return pos;
if (pos == Length())
return pos;
// assert pos > 0 && pos < Length()
if (checkLineEnd && IsCrLf(pos - 1)) {
if (moveDir > 0)
return pos + 1;
else
return pos - 1;
}
// Not between CR and LF
#if PLAT_WIN
if (dbcsCodePage) {
if (SC_CP_UTF8 == dbcsCodePage) {
unsigned char ch = static_cast<unsigned char>(cb.CharAt(pos));
while ((pos > 0) && (pos < Length()) && (ch >= 0x80) && (ch < (0x80 + 0x40))) {
// ch is a trail byte
if (moveDir > 0)
pos++;
else
pos--;
ch = static_cast<unsigned char>(cb.CharAt(pos));
}
} else {
// Anchor DBCS calculations at start of line because start of line can
// not be a DBCS trail byte.
int startLine = pos;
while (startLine > 0 && cb.CharAt(startLine) != '\r' && cb.CharAt(startLine) != '\n')
startLine--;
bool atLeadByte = false;
while (startLine < pos) {
if (atLeadByte)
atLeadByte = false;
else if (IsDBCSLeadByteEx(dbcsCodePage, cb.CharAt(startLine)))
atLeadByte = true;
else
atLeadByte = false;
startLine++;
//Platform::DebugPrintf("DBCS %s\n", atlead ? "D" : "-");
}
if (atLeadByte) {
// Position is between a lead byte and a trail byte
if (moveDir > 0)
return pos + 1;
else
return pos - 1;
}
}
}
#endif
return pos;
}
void Document::ModifiedAt(int pos) {
if (endStyled > pos)
endStyled = pos;
}
// Document only modified by gateways DeleteChars, InsertStyledString, Undo, Redo, and SetStyleAt.
// SetStyleAt does not change the persistent state of a document
// Unlike Undo, Redo, and InsertStyledString, the pos argument is a cell number not a char number
void Document::DeleteChars(int pos, int len) {
if ((pos + len) > Length())
return;
if (cb.IsReadOnly() && enteredReadOnlyCount==0) {
enteredReadOnlyCount++;
NotifyModifyAttempt();
enteredReadOnlyCount--;
}
if (enteredCount == 0) {
enteredCount++;
if (!cb.IsReadOnly()) {
NotifyModified(
DocModification(
SC_MOD_BEFOREDELETE | SC_PERFORMED_USER,
pos, len,
0, 0));
int prevLinesTotal = LinesTotal();
bool startSavePoint = cb.IsSavePoint();
const char *text = cb.DeleteChars(pos*2, len * 2);
if (startSavePoint && cb.IsCollectingUndo())
NotifySavePoint(!startSavePoint);
ModifiedAt(pos);
NotifyModified(
DocModification(
SC_MOD_DELETETEXT | SC_PERFORMED_USER,
pos, len,
LinesTotal() - prevLinesTotal, text));
}
enteredCount--;
}
}
void Document::InsertStyledString(int position, char *s, int insertLength) {
if (cb.IsReadOnly() && enteredReadOnlyCount==0) {
enteredReadOnlyCount++;
NotifyModifyAttempt();
enteredReadOnlyCount--;
}
if (enteredCount == 0) {
enteredCount++;
if (!cb.IsReadOnly()) {
NotifyModified(
DocModification(
SC_MOD_BEFOREINSERT | SC_PERFORMED_USER,
position / 2, insertLength / 2,
0, 0));
int prevLinesTotal = LinesTotal();
bool startSavePoint = cb.IsSavePoint();
const char *text = cb.InsertString(position, s, insertLength);
if (startSavePoint && cb.IsCollectingUndo())
NotifySavePoint(!startSavePoint);
ModifiedAt(position / 2);
NotifyModified(
DocModification(
SC_MOD_INSERTTEXT | SC_PERFORMED_USER,
position / 2, insertLength / 2,
LinesTotal() - prevLinesTotal, text));
}
enteredCount--;
}
}
int Document::Undo() {
int newPos = 0;
if (enteredCount == 0) {
enteredCount++;
bool startSavePoint = cb.IsSavePoint();
int steps = cb.StartUndo();
//Platform::DebugPrintf("Steps=%d\n", steps);
for (int step=0; step<steps; step++) {
int prevLinesTotal = LinesTotal();
const Action &action = cb.GetUndoStep();
if (action.at == removeAction) {
NotifyModified(DocModification(
SC_MOD_BEFOREINSERT | SC_PERFORMED_UNDO, action));
} else {
NotifyModified(DocModification(
SC_MOD_BEFOREDELETE | SC_PERFORMED_UNDO, action));
}
cb.PerformUndoStep();
int cellPosition = action.position / 2;
ModifiedAt(cellPosition);
newPos = cellPosition;
int modFlags = SC_PERFORMED_UNDO;
// With undo, an insertion action becomes a deletion notification
if (action.at == removeAction) {
newPos += action.lenData;
modFlags |= SC_MOD_INSERTTEXT;
} else {
modFlags |= SC_MOD_DELETETEXT;
}
if (step == steps-1)
modFlags |= SC_LASTSTEPINUNDOREDO;
NotifyModified(DocModification(modFlags, cellPosition, action.lenData,
LinesTotal() - prevLinesTotal, action.data));
}
bool endSavePoint = cb.IsSavePoint();
if (startSavePoint != endSavePoint)
NotifySavePoint(endSavePoint);
enteredCount--;
}
return newPos;
}
int Document::Redo() {
int newPos = 0;
if (enteredCount == 0) {
enteredCount++;
bool startSavePoint = cb.IsSavePoint();
int steps = cb.StartRedo();
for (int step=0; step<steps; step++) {
int prevLinesTotal = LinesTotal();
const Action &action = cb.GetRedoStep();
if (action.at == insertAction) {
NotifyModified(DocModification(
SC_MOD_BEFOREINSERT | SC_PERFORMED_REDO, action));
} else {
NotifyModified(DocModification(
SC_MOD_BEFOREDELETE | SC_PERFORMED_REDO, action));
}
cb.PerformRedoStep();
ModifiedAt(action.position / 2);
newPos = action.position / 2;
int modFlags = SC_PERFORMED_REDO;
if (action.at == insertAction) {
newPos += action.lenData;
modFlags |= SC_MOD_INSERTTEXT;
} else {
modFlags |= SC_MOD_DELETETEXT;
}
if (step == steps-1)
modFlags |= SC_LASTSTEPINUNDOREDO;
NotifyModified(
DocModification(modFlags, action.position / 2, action.lenData,
LinesTotal() - prevLinesTotal, action.data));
}
bool endSavePoint = cb.IsSavePoint();
if (startSavePoint != endSavePoint)
NotifySavePoint(endSavePoint);
enteredCount--;
}
return newPos;
}
void Document::InsertChar(int pos, char ch) {
char chs[2];
chs[0] = ch;
chs[1] = 0;
InsertStyledString(pos*2, chs, 2);
}
// Insert a null terminated string
void Document::InsertString(int position, const char *s) {
InsertString(position, s, strlen(s));
}
// Insert a string with a length
void Document::InsertString(int position, const char *s, int insertLength) {
char *sWithStyle = new char[insertLength * 2];
if (sWithStyle) {
for (int i = 0; i < insertLength; i++) {
sWithStyle[i*2] = s[i];
sWithStyle[i*2 + 1] = 0;
}
InsertStyledString(position*2, sWithStyle, insertLength*2);
delete []sWithStyle;
}
}
void Document::ChangeChar(int pos, char ch) {
DeleteChars(pos, 1);
InsertChar(pos, ch);
}
void Document::DelChar(int pos) {
DeleteChars(pos, LenChar(pos));
}
int Document::DelCharBack(int pos) {
if (pos <= 0) {
return pos;
} else if (IsCrLf(pos - 2)) {
DeleteChars(pos - 2, 2);
return pos - 2;
} else if (SC_CP_UTF8 == dbcsCodePage) {
int startChar = MovePositionOutsideChar(pos-1, -1, false);
DeleteChars(startChar, pos - startChar);
return startChar;
} else if (IsDBCS(pos - 1)) {
DeleteChars(pos - 2, 2);
return pos - 2;
} else {
DeleteChars(pos - 1, 1);
return pos - 1;
}
}
static bool isindentchar(char ch) {
return (ch == ' ') || (ch == '\t');
}
static int NextTab(int pos, int tabSize) {
return ((pos / tabSize) + 1) * tabSize;
}
static void CreateIndentation(char *linebuf, int length, int indent, int tabSize, bool insertSpaces) {
length--; // ensure space for \0
if (!insertSpaces) {
while ((indent >= tabSize) && (length > 0)) {
*linebuf++ = '\t';
indent -= tabSize;
length--;
}
}
while ((indent > 0) && (length > 0)) {
*linebuf++ = ' ';
indent--;
length--;
}
*linebuf = '\0';
}
int Document::GetLineIndentation(int line) {
int indent = 0;
if ((line >= 0) && (line < LinesTotal())) {
int lineStart = LineStart(line);
int length = Length();
for (int i=lineStart;i<length;i++) {
char ch = cb.CharAt(i);
if (ch == ' ')
indent++;
else if (ch == '\t')
indent = NextTab(indent, tabInChars);
else
return indent;
}
}
return indent;
}
void Document::SetLineIndentation(int line, int indent) {
int indentOfLine = GetLineIndentation(line);
if (indent < 0)
indent = 0;
if (indent != indentOfLine) {
char linebuf[1000];
CreateIndentation(linebuf, sizeof(linebuf), indent, tabInChars, !useTabs);
int thisLineStart = LineStart(line);
int indentPos = GetLineIndentPosition(line);
DeleteChars(thisLineStart, indentPos - thisLineStart);
InsertString(thisLineStart, linebuf);
}
}
int Document::GetLineIndentPosition(int line) {
if (line < 0)
return 0;
int pos = LineStart(line);
int length = Length();
while ((pos < length) && isindentchar(cb.CharAt(pos))) {
pos++;
}
return pos;
}
int Document::GetColumn(int pos) {
int column = 0;
int line = LineFromPosition(pos);
if ((line >= 0) && (line < LinesTotal())) {
for (int i=LineStart(line);i<pos;i++) {
char ch = cb.CharAt(i);
if (ch == '\t')
column = NextTab(column, tabInChars);
else if (ch == '\r')
return column;
else if (ch == '\n')
return column;
else
column++;
}
}
return column;
}
void Document::Indent(bool forwards, int lineBottom, int lineTop) {
// Dedent - suck white space off the front of the line to dedent by equivalent of a tab
for (int line = lineBottom; line >= lineTop; line--) {
int indentOfLine = GetLineIndentation(line);
if (forwards)
SetLineIndentation(line, indentOfLine + IndentSize());
else
SetLineIndentation(line, indentOfLine - IndentSize());
}
}
void Document::ConvertLineEnds(int eolModeSet) {
BeginUndoAction();
for (int pos = 0; pos < Length(); pos++) {
if (cb.CharAt(pos) == '\r') {
if (cb.CharAt(pos+1) == '\n') {
if (eolModeSet != SC_EOL_CRLF) {
DeleteChars(pos, 2);
if (eolModeSet == SC_EOL_CR)
InsertString(pos, "\r", 1);
else
InsertString(pos, "\n", 1);
} else {
pos++;
}
} else {
if (eolModeSet != SC_EOL_CR) {
DeleteChars(pos, 1);
if (eolModeSet == SC_EOL_CRLF) {
InsertString(pos, "\r\n", 2);
pos++;
} else {
InsertString(pos, "\n", 1);
}
}
}
} else if (cb.CharAt(pos) == '\n') {
if (eolModeSet != SC_EOL_LF) {
DeleteChars(pos, 1);
if (eolModeSet == SC_EOL_CRLF) {
InsertString(pos, "\r\n", 2);
pos++;
} else {
InsertString(pos, "\r", 1);
}
}
}
}
EndUndoAction();
}
bool Document::IsWordChar(unsigned char ch) {
if ((SC_CP_UTF8 == dbcsCodePage) && (ch >0x80))
return true;
return wordchars[ch];
}
int Document::ExtendWordSelect(int pos, int delta) {
if (delta < 0) {
while (pos > 0 && IsWordChar(cb.CharAt(pos - 1)))
pos--;
} else {
while (pos < (Length()) && IsWordChar(cb.CharAt(pos)))
pos++;
}
return pos;
}
int Document::NextWordStart(int pos, int delta) {
if (delta < 0) {
while (pos > 0 && (cb.CharAt(pos - 1) == ' ' || cb.CharAt(pos - 1) == '\t'))
pos--;
if (isspace(cb.CharAt(pos - 1))) { // Back up to previous line
while (pos > 0 && isspace(cb.CharAt(pos - 1)))
pos--;
} else {
bool startAtWordChar = IsWordChar(cb.CharAt(pos - 1));
while (pos > 0 && !isspace(cb.CharAt(pos - 1)) && (startAtWordChar == IsWordChar(cb.CharAt(pos - 1))))
pos--;
}
} else {
bool startAtWordChar = IsWordChar(cb.CharAt(pos));
while (pos < (Length()) && isspace(cb.CharAt(pos)))
pos++;
while (pos < (Length()) && !isspace(cb.CharAt(pos)) && (startAtWordChar == IsWordChar(cb.CharAt(pos))))
pos++;
while (pos < (Length()) && (cb.CharAt(pos) == ' ' || cb.CharAt(pos) == '\t'))
pos++;
}
return pos;
}
bool Document::IsWordStartAt(int pos) {
if (pos > 0) {
return !IsWordChar(CharAt(pos - 1));
}
return true;
}
bool Document::IsWordEndAt(int pos) {
if (pos < Length() - 1) {
return !IsWordChar(CharAt(pos));
}
return true;
}
bool Document::IsWordAt(int start, int end) {
return IsWordStartAt(start) && IsWordEndAt(end);
}
// Find text in document, supporting both forward and backward
// searches (just pass minPos > maxPos to do a backward search)
// Has not been tested with backwards DBCS searches yet.
long Document::FindText(int minPos, int maxPos, const char *s,
bool caseSensitive, bool word, bool wordStart) {
bool forward = minPos <= maxPos;
int increment = forward ? 1 : -1;
// Range endpoints should not be inside DBCS characters, but just in case, move them.
int startPos = MovePositionOutsideChar(minPos, increment, false);
int endPos = MovePositionOutsideChar(maxPos, increment, false);
// Compute actual search ranges needed
int lengthFind = strlen(s);
int endSearch = endPos;
if (startPos <= endPos) {
endSearch = endPos - lengthFind + 1;
}
//Platform::DebugPrintf("Find %d %d %s %d\n", startPos, endPos, ft->lpstrText, lengthFind);
char firstChar = s[0];
if (!caseSensitive)
firstChar = static_cast<char>(toupper(firstChar));
int pos = startPos;
while (forward ? (pos < endSearch) : (pos >= endSearch)) {
char ch = CharAt(pos);
if (caseSensitive) {
if (ch == firstChar) {
bool found = true;
for (int posMatch = 1; posMatch < lengthFind && found; posMatch++) {
ch = CharAt(pos + posMatch);
if (ch != s[posMatch])
found = false;
}
if (found) {
if ((!word && !wordStart) ||
word && IsWordAt(pos, pos + lengthFind) ||
wordStart && IsWordStartAt(pos))
return pos;
}
}
} else {
if (toupper(ch) == firstChar) {
bool found = true;
for (int posMatch = 1; posMatch < lengthFind && found; posMatch++) {
ch = CharAt(pos + posMatch);
if (toupper(ch) != toupper(s[posMatch]))
found = false;
}
if (found) {
if (!(word && wordStart) ||
word && IsWordAt(pos, pos + lengthFind) ||
wordStart && IsWordStartAt(pos))
return pos;
}
}
}
pos += increment;
if (dbcsCodePage) {
// Ensure trying to match from start of character
pos = MovePositionOutsideChar(pos, increment, false);
}
}
//Platform::DebugPrintf("Not found\n");
return - 1;
}
int Document::LinesTotal() {
return cb.Lines();
}
void Document::ChangeCase(Range r, bool makeUpperCase) {
for (int pos=r.start; pos<r.end; pos++) {
char ch = CharAt(pos);
if (dbcsCodePage && IsDBCS(pos)) {
pos += LenChar(pos);
} else {
if (makeUpperCase) {
if (islower(ch)) {
ChangeChar(pos, static_cast<char>(toupper(ch)));
}
} else {
if (isupper(ch)) {
ChangeChar(pos, static_cast<char>(tolower(ch)));
}
}
}
}
}
void Document::SetWordChars(unsigned char *chars) {
int ch;
for (ch = 0; ch < 256; ch++) {
wordchars[ch] = false;
}
if (chars) {
while (*chars) {
wordchars[*chars] = true;
chars++;
}
} else {
for (ch = 0; ch < 256; ch++) {
wordchars[ch] = isalnum(ch) || ch == '_';
}
}
}
void Document::SetStylingBits(int bits) {
stylingBits = bits;
stylingBitsMask = 0;
for (int bit=0; bit<stylingBits; bit++) {
stylingBitsMask <<= 1;
stylingBitsMask |= 1;
}
}
void Document::StartStyling(int position, char mask) {
stylingPos = position;
stylingMask = mask;
}
void Document::SetStyleFor(int length, char style) {
if (enteredCount == 0) {
enteredCount++;
int prevEndStyled = endStyled;
if (cb.SetStyleFor(stylingPos, length, style, stylingMask)) {
DocModification mh(SC_MOD_CHANGESTYLE | SC_PERFORMED_USER,
prevEndStyled, length);
NotifyModified(mh);
}
stylingPos += length;
endStyled = stylingPos;
enteredCount--;
}
}
void Document::SetStyles(int length, char *styles) {
if (enteredCount == 0) {
enteredCount++;
int prevEndStyled = endStyled;
bool didChange = false;
for (int iPos = 0; iPos < length; iPos++, stylingPos++) {
if (cb.SetStyleAt(stylingPos, styles[iPos], stylingMask)) {
didChange = true;
}
}
endStyled = stylingPos;
if (didChange) {
DocModification mh(SC_MOD_CHANGESTYLE | SC_PERFORMED_USER,
prevEndStyled, endStyled - prevEndStyled);
NotifyModified(mh);
}
enteredCount--;
}
}
bool Document::EnsureStyledTo(int pos) {
// Ask the watchers to style, and stop as soon as one responds.
for (int i = 0; pos > GetEndStyled() && i < lenWatchers; i++)
watchers[i].watcher->NotifyStyleNeeded(this, watchers[i].userData, pos);
return pos <= GetEndStyled();
}
bool Document::AddWatcher(DocWatcher *watcher, void *userData) {
for (int i = 0; i < lenWatchers; i++) {
if ((watchers[i].watcher == watcher) &&
(watchers[i].userData == userData))
return false;
}
WatcherWithUserData *pwNew = new WatcherWithUserData[lenWatchers + 1];
if (!pwNew)
return false;
for (int j = 0; j < lenWatchers; j++)
pwNew[j] = watchers[j];
pwNew[lenWatchers].watcher = watcher;
pwNew[lenWatchers].userData = userData;
delete []watchers;
watchers = pwNew;
lenWatchers++;
return true;
}
bool Document::RemoveWatcher(DocWatcher *watcher, void *userData) {
for (int i = 0; i < lenWatchers; i++) {
if ((watchers[i].watcher == watcher) &&
(watchers[i].userData == userData)) {
if (lenWatchers == 1) {
delete []watchers;
watchers = 0;
lenWatchers = 0;
} else {
WatcherWithUserData *pwNew = new WatcherWithUserData[lenWatchers];
if (!pwNew)
return false;
for (int j = 0; j < lenWatchers - 1; j++) {
pwNew[j] = (j < i) ? watchers[j] : watchers[j + 1];
}
delete []watchers;
watchers = pwNew;
lenWatchers--;
}
return true;
}
}
return false;
}
void Document::NotifyModifyAttempt() {
for (int i = 0; i < lenWatchers; i++) {
watchers[i].watcher->NotifyModifyAttempt(this, watchers[i].userData);
}
}
void Document::NotifySavePoint(bool atSavePoint) {
for (int i = 0; i < lenWatchers; i++) {
watchers[i].watcher->NotifySavePoint(this, watchers[i].userData, atSavePoint);
}
}
void Document::NotifyModified(DocModification mh) {
for (int i = 0; i < lenWatchers; i++) {
watchers[i].watcher->NotifyModified(this, mh, watchers[i].userData);
}
}

View File

@@ -1,255 +0,0 @@
// Scintilla source code edit control
// Document.h - text document that handles notifications, DBCS, styling, words and end of line
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef DOCUMENT_H
#define DOCUMENT_H
// A Position is a position within a document between two characters or at the beginning or end.
// Sometimes used as a character index where it identifies the character after the position.
typedef int Position;
const Position invalidPosition = -1;
// The range class represents a range of text in a document.
// The two values are not sorted as one end may be more significant than the other
// as is the case for the selection where the end position is the position of the caret.
// If either position is invalidPosition then the range is invalid and most operations will fail.
class Range {
public:
Position start;
Position end;
Range(Position pos=0) :
start(pos), end(pos) {
};
Range(Position start_, Position end_) :
start(start_), end(end_) {
};
bool Valid() const {
return (start != invalidPosition) && (end != invalidPosition);
}
bool Contains(Position pos) const {
if (start < end) {
return (pos >= start && pos <= end);
} else {
return (pos <= start && pos >= end);
}
}
bool Contains(Range other) const {
return Contains(other.start) && Contains(other.end);
}
bool Overlaps(Range other) const {
return
Contains(other.start) ||
Contains(other.end) ||
other.Contains(start) ||
other.Contains(end);
}
};
class DocWatcher;
class DocModification;
class Document {
public:
// Used to pair watcher pointer with user data
class WatcherWithUserData {
public:
DocWatcher *watcher;
void *userData;
WatcherWithUserData() {
watcher = 0;
userData = 0;
}
};
private:
int refCount;
CellBuffer cb;
bool wordchars[256];
int stylingPos;
char stylingMask;
int endStyled;
int enteredCount;
int enteredReadOnlyCount;
WatcherWithUserData *watchers;
int lenWatchers;
public:
int stylingBits;
int stylingBitsMask;
int eolMode;
// dbcsCodePage can also be SC_CP_UTF8 to enable UTF-8 mode
int dbcsCodePage;
int tabInChars;
int indentInChars;
bool useTabs;
Document();
virtual ~Document();
int AddRef();
int Release();
int LineFromPosition(int pos);
int ClampPositionIntoDocument(int pos);
bool IsCrLf(int pos);
int LenChar(int pos);
int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true);
// Gateways to modifying document
void DeleteChars(int pos, int len);
void InsertStyledString(int position, char *s, int insertLength);
int Undo();
int Redo();
bool CanUndo() { return cb.CanUndo(); }
bool CanRedo() { return cb.CanRedo(); }
void DeleteUndoHistory() { cb.DeleteUndoHistory(); }
bool SetUndoCollection(bool collectUndo) {
return cb.SetUndoCollection(collectUndo);
}
bool IsCollectingUndo() { return cb.IsCollectingUndo(); }
void BeginUndoAction() { cb.BeginUndoAction(); }
void EndUndoAction() { cb.EndUndoAction(); }
void SetSavePoint();
bool IsSavePoint() { return cb.IsSavePoint(); }
int GetLineIndentation(int line);
void SetLineIndentation(int line, int indent);
int GetLineIndentPosition(int line);
int GetColumn(int position);
void Indent(bool forwards, int lineBottom, int lineTop);
void ConvertLineEnds(int eolModeSet);
void SetReadOnly(bool set) { cb.SetReadOnly(set); }
bool IsReadOnly() { return cb.IsReadOnly(); }
void InsertChar(int pos, char ch);
void InsertString(int position, const char *s);
void InsertString(int position, const char *s, int insertLength);
void ChangeChar(int pos, char ch);
void DelChar(int pos);
int DelCharBack(int pos);
char CharAt(int position) { return cb.CharAt(position); }
void GetCharRange(char *buffer, int position, int lengthRetrieve) {
cb.GetCharRange(buffer, position, lengthRetrieve);
}
char StyleAt(int position) { return cb.StyleAt(position); }
int GetMark(int line) { return cb.GetMark(line); }
int AddMark(int line, int markerNum);
void DeleteMark(int line, int markerNum);
void DeleteMarkFromHandle(int markerHandle);
void DeleteAllMarks(int markerNum);
int LineFromHandle(int markerHandle) { return cb.LineFromHandle(markerHandle); }
int LineStart(int line);
int LineEnd(int line);
int LineEndPosition(int position);
int VCHomePosition(int position);
int SetLevel(int line, int level);
int GetLevel(int line) { return cb.GetLevel(line); }
void ClearLevels() { cb.ClearLevels(); }
int GetLastChild(int lineParent, int level=-1);
int GetFoldParent(int line);
void Indent(bool forwards);
int ExtendWordSelect(int pos, int delta);
int NextWordStart(int pos, int delta);
int Length() { return cb.Length(); }
long FindText(int minPos, int maxPos, const char *s,
bool caseSensitive, bool word, bool wordStart);
long FindText(int iMessage, unsigned long wParam, long lParam);
int LinesTotal();
void ChangeCase(Range r, bool makeUpperCase);
void SetWordChars(unsigned char *chars);
void SetStylingBits(int bits);
void StartStyling(int position, char mask);
void SetStyleFor(int length, char style);
void SetStyles(int length, char *styles);
int GetEndStyled() { return endStyled; }
bool EnsureStyledTo(int pos);
int SetLineState(int line, int state) { return cb.SetLineState(line, state); }
int GetLineState(int line) { return cb.GetLineState(line); }
int GetMaxLineState() { return cb.GetMaxLineState(); }
bool AddWatcher(DocWatcher *watcher, void *userData);
bool RemoveWatcher(DocWatcher *watcher, void *userData);
const WatcherWithUserData *GetWatchers() const { return watchers; }
int GetLenWatchers() const { return lenWatchers; }
private:
bool IsDBCS(int pos);
bool IsWordChar(unsigned char ch);
bool IsWordStartAt(int pos);
bool IsWordEndAt(int pos);
bool IsWordAt(int start, int end);
void ModifiedAt(int pos);
void NotifyModifyAttempt();
void NotifySavePoint(bool atSavePoint);
void NotifyModified(DocModification mh);
int IndentSize() { return indentInChars ? indentInChars : tabInChars; }
};
// To optimise processing of document modifications by DocWatchers, a hint is passed indicating the
// scope of the change.
// If the DocWatcher is a document view then this can be used to optimise screen updating.
class DocModification {
public:
int modificationType;
int position;
int length;
int linesAdded; // Negative if lines deleted
const char *text; // Only valid for changes to text, not for changes to style
int line;
int foldLevelNow;
int foldLevelPrev;
DocModification(int modificationType_, int position_=0, int length_=0,
int linesAdded_=0, const char *text_=0) :
modificationType(modificationType_),
position(position_),
length(length_),
linesAdded(linesAdded_),
text(text_),
line(0),
foldLevelNow(0),
foldLevelPrev(0) {}
DocModification(int modificationType_, const Action &act, int linesAdded_=0) :
modificationType(modificationType_),
position(act.position / 2),
length(act.lenData),
linesAdded(linesAdded_),
text(act.data),
line(0),
foldLevelNow(0),
foldLevelPrev(0) {}
};
// A class that wants to receive notifications from a Document must be derived from DocWatcher
// and implement the notification methods. It can then be added to the watcher list with AddWatcher.
class DocWatcher {
public:
virtual ~DocWatcher() {}
virtual void NotifyModifyAttempt(Document *doc, void *userData) = 0;
virtual void NotifySavePoint(Document *doc, void *userData, bool atSavePoint) = 0;
virtual void NotifyModified(Document *doc, DocModification mh, void *userData) = 0;
virtual void NotifyDeleted(Document *doc, void *userData) = 0;
virtual void NotifyStyleNeeded(Document *doc, void *userData, int endPos) = 0;
};
#endif

View File

@@ -1,176 +0,0 @@
// SciTE - Scintilla based Text Editor
// Accessor.cxx - rapid easy access to contents of a Scintilla
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include "Platform.h"
#include "PropSet.h"
#include "SVector.h"
#include "Accessor.h"
#include "DocumentAccessor.h"
#include "CellBuffer.h"
#include "Scintilla.h"
#include "Document.h"
DocumentAccessor::~DocumentAccessor() {
}
#if PLAT_WIN
bool DocumentAccessor::InternalIsLeadByte(char ch) {
if (SC_CP_UTF8 == codePage)
// For lexing, all characters >= 0x80 are treated the
// same so none is considered a lead byte.
return false;
else
return IsDBCSLeadByteEx(codePage, ch);
}
#else
// PLAT_GTK or PLAT_WX
// TODO: support DBCS under GTK+ and WX
bool DocumentAccessor::InternalIsLeadByte(char) {
return false;
}
#endif
void DocumentAccessor::Fill(int position) {
if (lenDoc == -1)
lenDoc = pdoc->Length();
startPos = position - slopSize;
if (startPos + bufferSize > lenDoc)
startPos = lenDoc - bufferSize;
if (startPos < 0)
startPos = 0;
endPos = startPos + bufferSize;
if (endPos > lenDoc)
endPos = lenDoc;
pdoc->GetCharRange(buf, startPos, endPos-startPos);
buf[endPos-startPos] = '\0';
}
char DocumentAccessor::StyleAt(int position) {
return pdoc->StyleAt(position);
}
int DocumentAccessor::GetLine(int position) {
return pdoc->LineFromPosition(position);
}
int DocumentAccessor::LineStart(int line) {
return pdoc->LineStart(line);
}
int DocumentAccessor::LevelAt(int line) {
return pdoc->GetLevel(line);
}
int DocumentAccessor::Length() {
if (lenDoc == -1)
lenDoc = pdoc->Length();
return lenDoc;
}
int DocumentAccessor::GetLineState(int line) {
return pdoc->GetLineState(line);
}
int DocumentAccessor::SetLineState(int line, int state) {
return pdoc->SetLineState(line, state);
}
void DocumentAccessor::StartAt(unsigned int start, char chMask) {
pdoc->StartStyling(start, chMask);
}
void DocumentAccessor::StartSegment(unsigned int pos) {
startSeg = pos;
}
void DocumentAccessor::ColourTo(unsigned int pos, int chAttr) {
// Only perform styling if non empty range
if (pos != startSeg - 1) {
if (pos < startSeg) {
Platform::DebugPrintf("Bad colour positions %d - %d\n", startSeg, pos);
}
if (validLen + (pos - startSeg + 1) >= bufferSize)
Flush();
if (validLen + (pos - startSeg + 1) >= bufferSize) {
// Too big for buffer so send directly
pdoc->SetStyleFor(pos - startSeg + 1, static_cast<char>(chAttr));
} else {
if (chAttr != chWhile)
chFlags = 0;
chAttr |= chFlags;
for (unsigned int i = startSeg; i <= pos; i++) {
styleBuf[validLen++] = static_cast<char>(chAttr);
}
}
}
startSeg = pos+1;
}
void DocumentAccessor::SetLevel(int line, int level) {
pdoc->SetLevel(line, level);
}
void DocumentAccessor::Flush() {
startPos = extremePosition;
lenDoc = -1;
if (validLen > 0) {
pdoc->SetStyles(validLen, styleBuf);
validLen = 0;
}
}
int DocumentAccessor::IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader) {
int end = Length();
int spaceFlags = 0;
// Determines the indentation level of the current line and also checks for consistent
// indentation compared to the previous line.
// Indentation is judged consistent when the indentation whitespace of each line lines
// the same or the indentation of one line is a prefix of the other.
int pos = LineStart(line);
char ch = (*this)[pos];
int indent = 0;
bool inPrevPrefix = line > 0;
int posPrev = inPrevPrefix ? LineStart(line-1) : 0;
while ((ch == ' ' || ch == '\t') && (pos < end)) {
if (inPrevPrefix) {
char chPrev = (*this)[posPrev++];
if (chPrev == ' ' || chPrev == '\t') {
if (chPrev != ch)
spaceFlags |= wsInconsistent;
} else {
inPrevPrefix = false;
}
}
if (ch == ' ') {
spaceFlags |= wsSpace;
indent++;
} else { // Tab
spaceFlags |= wsTab;
if (spaceFlags & wsSpace)
spaceFlags |= wsSpaceTab;
indent = (indent / 8 + 1) * 8;
}
ch = (*this)[++pos];
}
*flags = spaceFlags;
indent += SC_FOLDLEVELBASE;
// if completely empty line or the start of a comment...
if (isspace(ch) || (pfnIsCommentLeader && (*pfnIsCommentLeader)(*this, pos, end-pos)) )
return indent | SC_FOLDLEVELWHITEFLAG;
else
return indent;
}

View File

@@ -1,49 +0,0 @@
// DocumentAccessor.h - implementation of BufferAccess and StylingAccess on a Scintilla rapid easy access to contents of a Scintilla
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
class Document;
class DocumentAccessor : public Accessor {
// Private so DocumentAccessor objects can not be copied
DocumentAccessor(const DocumentAccessor &source) : Accessor(), props(source.props) {}
DocumentAccessor &operator=(const DocumentAccessor &) { return *this; }
protected:
Document *pdoc;
PropSet &props;
int lenDoc;
char styleBuf[bufferSize];
int validLen;
char chFlags;
char chWhile;
unsigned int startSeg;
bool InternalIsLeadByte(char ch);
void Fill(int position);
public:
DocumentAccessor(Document *pdoc_, PropSet &props_) :
Accessor(), pdoc(pdoc_), props(props_),
lenDoc(-1), validLen(0), chFlags(0), chWhile(0) {
}
~DocumentAccessor();
char StyleAt(int position);
int GetLine(int position);
int LineStart(int line);
int LevelAt(int line);
int Length();
void Flush();
int GetLineState(int line);
int SetLineState(int line, int state);
int GetPropertyInt(const char *key, int defaultValue=0) {
return props.GetInt(key, defaultValue);
}
void StartAt(unsigned int start, char chMask=31);
void SetFlags(char chFlags_, char chWhile_) {chFlags = chFlags_; chWhile = chWhile_; };
unsigned int GetStartSegment() { return startSeg; }
void StartSegment(unsigned int pos);
void ColourTo(unsigned int pos, int chAttr);
void SetLevel(int line, int level);
int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0);
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,308 +0,0 @@
// Scintilla source code edit control
// Editor.h - defines the main editor class
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef EDITOR_H
#define EDITOR_H
class Caret {
public:
bool active;
bool on;
int period;
Caret();
};
class Timer {
public:
bool ticking;
int ticksToWait;
enum {tickSize = 100};
int tickerID;
Timer();
};
class LineLayout {
public:
// Drawing is only performed for maxLineLength characters on each line.
enum {maxLineLength = 4000};
int numCharsInLine;
int xHighlightGuide;
bool highlightColumn;
int selStart;
int selEnd;
int edgeColumn;
char chars[maxLineLength+1];
char styles[maxLineLength+1];
char indicators[maxLineLength+1];
int positions[maxLineLength+1];
};
class Editor : public DocWatcher {
// Private so Editor objects can not be copied
Editor(const Editor &) : DocWatcher() {}
Editor &operator=(const Editor &) { return *this; }
protected: // ScintillaBase subclass needs access to much of Editor
// On GTK+, Scintilla is a container widget holding two scroll bars and a drawing area
// whereas on Windows there is just one window with both scroll bars turned on.
// Therefore, on GTK+ the following are separate windows but only one window on Windows.
Window wMain; // The Scintilla parent window
Window wDraw; // The text drawing area
// Style resources may be expensive to allocate so are cached between uses.
// When a style attribute is changed, this cache is flushed.
bool stylesValid;
ViewStyle vs;
Palette palette;
int printMagnification;
int printColourMode;
bool hideSelection;
bool inOverstrike;
// In bufferedDraw mode, graphics operations are drawn to a pixmap and then copied to
// the screen. This avoids flashing but is about 30% slower.
bool bufferedDraw;
int xOffset; // Horizontal scrolled amount in pixels
int xCaretMargin; // Ensure this many pixels visible on both sides of caret
bool horizontalScrollBarVisible;
Surface pixmapLine;
Surface pixmapSelMargin;
Surface pixmapSelPattern;
Surface pixmapIndentGuide;
Surface pixmapIndentGuideHighlight;
// Intellimouse support - currently only implemented for Windows
unsigned int ucWheelScrollLines;
int cWheelDelta; //wheel delta from roll
KeyMap kmap;
Caret caret;
Timer timer;
Point lastClick;
unsigned int lastClickTime;
enum { selChar, selWord, selLine } selectionType;
Point ptMouseLast;
bool firstExpose;
bool inDragDrop;
bool dropWentOutside;
int posDrag;
int posDrop;
int lastXChosen;
int lineAnchor;
int originalAnchorPos;
int currentPos;
int anchor;
int topLine;
int posTopLine;
bool needUpdateUI;
Position braces[2];
int bracesMatchStyle;
int highlightGuideColumn;
int theEdge;
enum { notPainting, painting, paintAbandoned } paintState;
PRectangle rcPaint;
bool paintingAllText;
int modEventMask;
char *dragChars;
int lenDrag;
bool dragIsRectangle;
enum { selStream, selRectangle, selRectangleFixed } selType;
int xStartSelect;
int xEndSelect;
bool primarySelection;
int caretPolicy;
int caretSlop;
int searchAnchor;
int displayPopupMenu;
#ifdef MACRO_SUPPORT
int recordingMacro;
#endif
int foldFlags;
ContractionState cs;
Document *pdoc;
Editor();
virtual ~Editor();
virtual void Initialise() = 0;
virtual void Finalise();
void InvalidateStyleData();
void InvalidateStyleRedraw();
virtual void RefreshColourPalette(Palette &pal, bool want);
void RefreshStyleData();
void DropGraphics();
PRectangle GetClientRectangle();
PRectangle GetTextRectangle();
int LinesOnScreen();
int LinesToScroll();
int MaxScrollPos();
Point LocationFromPosition(unsigned int pos);
int XFromPosition(unsigned int pos);
int PositionFromLocation(Point pt);
int PositionFromLineX(int line, int x);
int LineFromLocation(Point pt);
void SetTopLine(int topLineNew);
void RedrawRect(PRectangle rc);
void Redraw();
void RedrawSelMargin();
PRectangle RectangleFromRange(int start, int end);
void InvalidateRange(int start, int end);
int CurrentPosition();
bool SelectionEmpty();
int SelectionStart(int line=-1);
int SelectionEnd(int line=-1);
void SetSelection(int currentPos_, int anchor_);
void SetSelection(int currentPos_);
void SetEmptySelection(int currentPos_);
int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true);
int MovePositionTo(int newPos, bool extend = false);
int MovePositionSoVisible(int pos, int moveDir);
void SetLastXChosen();
void ScrollTo(int line);
virtual void ScrollText(int linesToMove);
void HorizontalScrollTo(int xPos);
void MoveCaretInsideView();
void EnsureCaretVisible(bool useMargin=true);
void ShowCaretAtCurrentPosition();
void DropCaret();
void InvalidateCaret();
void PaintSelMargin(Surface *surface, PRectangle &rc);
void LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayout &ll);
void DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVisible, int xStart,
PRectangle rcLine, LineLayout &ll);
void Paint(Surface *surfaceWindow, PRectangle rcArea);
long FormatRange(bool draw, RangeToFormat *pfr);
virtual void SetVerticalScrollPos() = 0;
virtual void SetHorizontalScrollPos() = 0;
virtual bool ModifyScrollBars(int nMax, int nPage) = 0;
virtual void ReconfigureScrollBars();
void SetScrollBarsTo(PRectangle rsClient);
void SetScrollBars();
void AddChar(char ch);
virtual void AddCharUTF(char *s, unsigned int len);
void ClearSelection();
void ClearAll();
void ClearDocumentStyle();
void Cut();
void PasteRectangular(int pos, const char *ptr, int len);
virtual void Copy() = 0;
virtual void Paste() = 0;
void Clear();
void SelectAll();
void Undo();
void Redo();
void DelChar();
void DelCharBack();
virtual void ClaimSelection() = 0;
virtual void NotifyChange() = 0;
virtual void NotifyFocus(bool focus);
virtual void NotifyParent(SCNotification scn) = 0;
virtual void NotifyStyleToNeeded(int endStyleNeeded);
void NotifyChar(char ch);
void NotifyMove(int position);
void NotifySavePoint(bool isSavePoint);
void NotifyModifyAttempt();
virtual void NotifyDoubleClick(Point pt, bool shift);
void NotifyUpdateUI();
bool NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt);
void NotifyNeedShown(int pos, int len);
void NotifyModifyAttempt(Document *document, void *userData);
void NotifySavePoint(Document *document, void *userData, bool atSavePoint);
void NotifyModified(Document *document, DocModification mh, void *userData);
void NotifyDeleted(Document *document, void *userData);
void NotifyStyleNeeded(Document *doc, void *userData, int endPos);
#ifdef MACRO_SUPPORT
void NotifyMacroRecord(unsigned int iMessage, unsigned long wParam, long lParam);
#endif
void PageMove(int direction, bool extend=false);
void ChangeCaseOfSelection(bool makeUpperCase);
void LineTranspose();
virtual void CancelModes();
virtual int KeyCommand(unsigned int iMessage);
virtual int KeyDefault(int /* key */, int /*modifiers*/);
int KeyDown(int key, bool shift, bool ctrl, bool alt);
int GetWhitespaceVisible();
void SetWhitespaceVisible(int view);
void Indent(bool forwards);
long FindText(unsigned int iMessage, unsigned long wParam, long lParam);
void SearchAnchor();
long SearchText(unsigned int iMessage, unsigned long wParam, long lParam);
void GoToLine(int lineNo);
char *CopyRange(int start, int end);
int SelectionRangeLength();
char *CopySelectionRange();
void CopySelectionIntoDrag();
void SetDragPosition(int newPos);
virtual void StartDrag();
void DropAt(int position, const char *value, bool moving, bool rectangular);
// PositionInSelection returns 0 if position in selection, -1 if position before selection, and 1 if after.
// Before means either before any line of selection or before selection on its line, with a similar meaning to after
int PositionInSelection(int pos);
bool PointInSelection(Point pt);
bool PointInSelMargin(Point pt);
virtual void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt);
void ButtonMove(Point pt);
void ButtonUp(Point pt, unsigned int curTime, bool ctrl);
void Tick();
virtual void SetTicking(bool on) = 0;
virtual void SetMouseCapture(bool on) = 0;
virtual bool HaveMouseCapture() = 0;
void CheckForChangeOutsidePaint(Range r);
int BraceMatch(int position, int maxReStyle);
void SetBraceHighlight(Position pos0, Position pos1, int matchStyle);
void SetDocPointer(Document *document);
void Expand(int &line, bool doExpand);
void ToggleContraction(int line);
void EnsureLineVisible(int line);
virtual long DefWndProc(unsigned int iMessage, unsigned long wParam, long lParam) = 0;
public:
// Public so scintilla_send_message can use it
virtual long WndProc(unsigned int iMessage, unsigned long wParam, long lParam);
// Public so scintilla_set_id can use it
int ctrlID;
};
#endif

View File

@@ -1,61 +0,0 @@
// Scintilla source code edit control
// Indicator.cxx - defines the style of indicators which are text decorations such as underlining
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include "Platform.h"
#include "Scintilla.h"
#include "Indicator.h"
void Indicator::Draw(Surface *surface, PRectangle &rc) {
surface->PenColour(fore.allocated);
int ymid = (rc.bottom + rc.top) / 2;
if (style == INDIC_SQUIGGLE) {
surface->MoveTo(rc.left, rc.top);
int x = rc.left + 2;
int y = 2;
while (x < rc.right) {
surface->LineTo(x, rc.top + y);
x += 2;
y = 2 - y;
}
surface->LineTo(rc.right, rc.top + y); // Finish the line
} else if (style == INDIC_TT) {
surface->MoveTo(rc.left, ymid);
int x = rc.left + 5;
while (x < rc.right) {
surface->LineTo(x, ymid);
surface->MoveTo(x-3, ymid);
surface->LineTo(x-3, ymid+2);
x++;
surface->MoveTo(x, ymid);
x += 5;
}
surface->LineTo(rc.right, ymid); // Finish the line
if (x - 3 <= rc.right) {
surface->MoveTo(x-3, ymid);
surface->LineTo(x-3, ymid+2);
}
} else if (style == INDIC_DIAGONAL) {
int x = rc.left;
while (x < rc.right) {
surface->MoveTo(x, rc.top+2);
int endX = x+3;
int endY = rc.top - 1;
if (endX > rc.right) {
endY += endX - rc.right;
endX = rc.right;
}
surface->LineTo(endX, endY);
x += 4;
}
} else if (style == INDIC_STRIKE) {
surface->MoveTo(rc.left, rc.top - 4);
surface->LineTo(rc.right, rc.top - 4);
} else { // Either INDIC_PLAIN or unknown
surface->MoveTo(rc.left, ymid);
surface->LineTo(rc.right, ymid);
}
}

View File

@@ -1,18 +0,0 @@
// Scintilla source code edit control
// Indicator.h - defines the style of indicators which are text decorations such as underlining
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef INDICATOR_H
#define INDICATOR_H
class Indicator {
public:
int style;
ColourPair fore;
Indicator() : style(INDIC_PLAIN), fore(Colour(0,0,0)) {
}
void Draw(Surface *surface, PRectangle &rc);
};
#endif

View File

@@ -1,121 +0,0 @@
// Scintilla source code edit control
// KeyMap.cxx - defines a mapping between keystrokes and commands
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include "Platform.h"
#include "Scintilla.h"
#include "KeyMap.h"
KeyMap::KeyMap() : kmap(0), len(0), alloc(0) {
for (int i = 0; MapDefault[i].key; i++) {
AssignCmdKey(MapDefault[i].key,
MapDefault[i].modifiers,
MapDefault[i].msg);
}
}
KeyMap::~KeyMap() {
Clear();
}
void KeyMap::Clear() {
delete []kmap;
kmap = 0;
len = 0;
alloc = 0;
}
void KeyMap::AssignCmdKey(int key, int modifiers, unsigned int msg) {
if ((len+1) >= alloc) {
KeyToCommand *ktcNew = new KeyToCommand[alloc + 5];
if (!ktcNew)
return;
for (int k=0;k<len;k++)
ktcNew[k] = kmap[k];
alloc += 5;
delete []kmap;
kmap = ktcNew;
}
for (int keyIndex = 0; keyIndex < len; keyIndex++) {
if ((key == kmap[keyIndex].key) && (modifiers == kmap[keyIndex].modifiers)) {
kmap[keyIndex].msg = msg;
return;
}
}
kmap[len].key = key;
kmap[len].modifiers = modifiers;
kmap[len].msg = msg;
len++;
}
unsigned int KeyMap::Find(int key, int modifiers) {
for (int i=0; i < len; i++) {
if ((key == kmap[i].key) && (modifiers == kmap[i].modifiers)) {
return kmap[i].msg;
}
}
return 0;
}
KeyToCommand KeyMap::MapDefault[] = {
{SCK_DOWN, SCI_NORM, SCI_LINEDOWN},
{SCK_DOWN, SCI_SHIFT, SCI_LINEDOWNEXTEND},
{SCK_DOWN, SCI_CTRL, SCI_LINESCROLLDOWN},
{SCK_UP, SCI_NORM, SCI_LINEUP},
{SCK_UP, SCI_SHIFT, SCI_LINEUPEXTEND},
{SCK_UP, SCI_CTRL, SCI_LINESCROLLUP},
{SCK_LEFT, SCI_NORM, SCI_CHARLEFT},
{SCK_LEFT, SCI_SHIFT, SCI_CHARLEFTEXTEND},
{SCK_LEFT, SCI_CTRL, SCI_WORDLEFT},
{SCK_LEFT, SCI_CSHIFT, SCI_WORDLEFTEXTEND},
{SCK_RIGHT, SCI_NORM, SCI_CHARRIGHT},
{SCK_RIGHT, SCI_SHIFT, SCI_CHARRIGHTEXTEND},
{SCK_RIGHT, SCI_CTRL, SCI_WORDRIGHT},
{SCK_RIGHT, SCI_CSHIFT, SCI_WORDRIGHTEXTEND},
{SCK_HOME, SCI_NORM, SCI_VCHOME},
{SCK_HOME, SCI_SHIFT, SCI_VCHOMEEXTEND},
{SCK_HOME, SCI_CTRL, SCI_DOCUMENTSTART},
{SCK_HOME, SCI_CSHIFT, SCI_DOCUMENTSTARTEXTEND},
{SCK_END, SCI_NORM, SCI_LINEEND},
{SCK_END, SCI_SHIFT, SCI_LINEENDEXTEND},
{SCK_END, SCI_CTRL, SCI_DOCUMENTEND},
{SCK_END, SCI_CSHIFT, SCI_DOCUMENTENDEXTEND},
{SCK_PRIOR, SCI_NORM, SCI_PAGEUP},
{SCK_PRIOR, SCI_SHIFT, SCI_PAGEUPEXTEND},
{SCK_NEXT, SCI_NORM, SCI_PAGEDOWN},
{SCK_NEXT, SCI_SHIFT, SCI_PAGEDOWNEXTEND},
{SCK_DELETE, SCI_NORM, SCI_CLEAR},
{SCK_DELETE, SCI_SHIFT, SCI_CUT},
{SCK_DELETE, SCI_CTRL, SCI_DELWORDRIGHT},
{SCK_INSERT, SCI_NORM, SCI_EDITTOGGLEOVERTYPE},
{SCK_INSERT, SCI_SHIFT, SCI_PASTE},
{SCK_INSERT, SCI_CTRL, SCI_COPY},
{SCK_ESCAPE, SCI_NORM, SCI_CANCEL},
{SCK_BACK, SCI_NORM, SCI_DELETEBACK},
{SCK_BACK, SCI_SHIFT, SCI_DELETEBACK},
{SCK_BACK, SCI_CTRL, SCI_DELWORDLEFT},
{SCK_BACK, SCI_ALT, SCI_UNDO},
{'Z', SCI_CTRL, SCI_UNDO},
{'Y', SCI_CTRL, SCI_REDO},
{'X', SCI_CTRL, SCI_CUT},
{'C', SCI_CTRL, SCI_COPY},
{'V', SCI_CTRL, SCI_PASTE},
{'A', SCI_CTRL, SCI_SELECTALL},
{SCK_TAB, SCI_NORM, SCI_TAB},
{SCK_TAB, SCI_SHIFT, SCI_BACKTAB},
{SCK_RETURN, SCI_NORM, SCI_NEWLINE},
{SCK_ADD, SCI_CTRL, SCI_ZOOMIN},
{SCK_SUBTRACT, SCI_CTRL, SCI_ZOOMOUT},
{SCK_DIVIDE, SCI_CTRL, SCI_SETZOOM},
//'L', SCI_CTRL, SCI_FORMFEED,
{'L', SCI_CTRL, SCI_LINECUT},
{'L', SCI_CSHIFT, SCI_LINEDELETE},
{'T', SCI_CTRL, SCI_LINETRANSPOSE},
{'U', SCI_CTRL, SCI_LOWERCASE},
{'U', SCI_CSHIFT, SCI_UPPERCASE},
{0,0,0},
};

View File

@@ -1,36 +0,0 @@
// Scintilla source code edit control
// KeyMap.h - defines a mapping between keystrokes and commands
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef KEYTOCOMMAND_H
#define KEYTOCOMMAND_H
#define SCI_NORM 0
#define SCI_SHIFT SCMOD_SHIFT
#define SCI_CTRL SCMOD_CTRL
#define SCI_ALT SCMOD_ALT
#define SCI_CSHIFT (SCI_CTRL | SCI_SHIFT)
#define SCI_ASHIFT (SCI_ALT | SCI_SHIFT)
class KeyToCommand {
public:
int key;
int modifiers;
unsigned int msg;
};
class KeyMap {
KeyToCommand *kmap;
int len;
int alloc;
static KeyToCommand MapDefault[];
public:
KeyMap();
~KeyMap();
void Clear();
void AssignCmdKey(int key, int modifiers, unsigned int msg);
unsigned int Find(int key, int modifiers); // 0 returned on failure
};
#endif

View File

@@ -1,45 +0,0 @@
// SciTE - Scintilla based Text Editor
// KeyWords.cxx - colourise for particular languages
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include "Platform.h"
#include "PropSet.h"
#include "Accessor.h"
#include "KeyWords.h"
#include "Scintilla.h"
#include "SciLexer.h"
LexerModule *LexerModule::base = 0;
LexerModule::LexerModule(int language_, LexerFunction fn_) :
language(language_), fn(fn_) {
next = base;
base = this;
}
void LexerModule::Colourise(unsigned int startPos, int lengthDoc, int initStyle,
int language, WordList *keywordlists[], Accessor &styler) {
LexerModule *lm = base;
while (lm) {
if (lm->language == language) {
lm->fn(startPos, lengthDoc, initStyle, keywordlists, styler);
return;
}
lm = lm->next;
}
// Unknown language
// Null language means all style bytes are 0 so just mark the end - no need to fill in.
if (lengthDoc > 0) {
styler.StartAt(startPos + lengthDoc - 1);
styler.StartSegment(startPos + lengthDoc - 1);
styler.ColourTo(startPos + lengthDoc - 1, 0);
}
}

View File

@@ -1,262 +0,0 @@
// SciTE - Scintilla based Text Editor
// LexCPP.cxx - lexer for C++, C, Java, and Javascript
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include "Platform.h"
#include "PropSet.h"
#include "Accessor.h"
#include "KeyWords.h"
#include "Scintilla.h"
#include "SciLexer.h"
static bool classifyWordCpp(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) {
char s[100];
for (unsigned int i = 0; i < end - start + 1 && i < 30; i++) {
s[i] = styler[start + i];
s[i + 1] = '\0';
}
bool wordIsUUID = false;
char chAttr = SCE_C_IDENTIFIER;
if (isdigit(s[0]) || (s[0] == '.'))
chAttr = SCE_C_NUMBER;
else {
if (keywords.InList(s)) {
chAttr = SCE_C_WORD;
wordIsUUID = strcmp(s, "uuid") == 0;
}
}
styler.ColourTo(end, chAttr);
return wordIsUUID;
}
static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
Accessor &styler) {
WordList &keywords = *keywordlists[0];
styler.StartAt(startPos);
bool fold = styler.GetPropertyInt("fold");
bool stylingWithinPreprocessor = styler.GetPropertyInt("styling.within.preprocessor");
int lineCurrent = styler.GetLine(startPos);
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
int levelCurrent = levelPrev;
int state = initStyle;
if (state == SCE_C_STRINGEOL) // Does not leak onto next line
state = SCE_C_DEFAULT;
char chPrev = ' ';
char chNext = styler[startPos];
unsigned int lengthDoc = startPos + length;
int visibleChars = 0;
styler.StartSegment(startPos);
bool lastWordWasUUID = false;
for (unsigned int i = startPos; i < lengthDoc; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
if ((ch == '\r' && chNext != '\n') || (ch == '\n')) {
// Trigger on CR only (Mac style) or either on LF from CR+LF (Dos/Win) or on LF alone (Unix)
// Avoid triggering two times on Dos/Win
// End of line
if (state == SCE_C_STRINGEOL) {
styler.ColourTo(i, state);
state = SCE_C_DEFAULT;
}
if (fold) {
int lev = levelPrev;
if (visibleChars == 0)
lev |= SC_FOLDLEVELWHITEFLAG;
if ((levelCurrent > levelPrev) && (visibleChars > 0))
lev |= SC_FOLDLEVELHEADERFLAG;
styler.SetLevel(lineCurrent, lev);
lineCurrent++;
levelPrev = levelCurrent;
}
visibleChars = 0;
}
if (!isspace(ch))
visibleChars++;
if (styler.IsLeadByte(ch)) {
chNext = styler.SafeGetCharAt(i + 2);
chPrev = ' ';
i += 1;
continue;
}
if (state == SCE_C_DEFAULT) {
if (ch == '@' && chNext == '\"') {
styler.ColourTo(i-1, state);
state = SCE_C_VERBATIM;
i++;
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
} else if (iswordstart(ch) || (ch == '@')) {
styler.ColourTo(i-1, state);
if (lastWordWasUUID) {
state = SCE_C_UUID;
lastWordWasUUID = false;
} else {
state = SCE_C_IDENTIFIER;
}
} else if (ch == '/' && chNext == '*') {
styler.ColourTo(i-1, state);
if (styler.SafeGetCharAt(i + 2) == '*')
state = SCE_C_COMMENTDOC;
else
state = SCE_C_COMMENT;
} else if (ch == '/' && chNext == '/') {
styler.ColourTo(i-1, state);
state = SCE_C_COMMENTLINE;
} else if (ch == '\"') {
styler.ColourTo(i-1, state);
state = SCE_C_STRING;
} else if (ch == '\'') {
styler.ColourTo(i-1, state);
state = SCE_C_CHARACTER;
} else if (ch == '#' && visibleChars == 1) {
// Preprocessor commands are alone on their line
styler.ColourTo(i-1, state);
state = SCE_C_PREPROCESSOR;
// Skip whitespace between # and preprocessor word
do {
i++;
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
} while (isspace(ch) && (i < lengthDoc));
} else if (isoperator(ch)) {
styler.ColourTo(i-1, state);
styler.ColourTo(i, SCE_C_OPERATOR);
if ((ch == '{') || (ch == '}')) {
levelCurrent += (ch == '{') ? 1 : -1;
}
}
} else if (state == SCE_C_IDENTIFIER) {
if (!iswordchar(ch)) {
lastWordWasUUID = classifyWordCpp(styler.GetStartSegment(), i - 1, keywords, styler);
state = SCE_C_DEFAULT;
if (ch == '/' && chNext == '*') {
if (styler.SafeGetCharAt(i + 2) == '*')
state = SCE_C_COMMENTDOC;
else
state = SCE_C_COMMENT;
} else if (ch == '/' && chNext == '/') {
state = SCE_C_COMMENTLINE;
} else if (ch == '\"') {
state = SCE_C_STRING;
} else if (ch == '\'') {
state = SCE_C_CHARACTER;
} else if (isoperator(ch)) {
styler.ColourTo(i, SCE_C_OPERATOR);
if ((ch == '{') || (ch == '}')) {
levelCurrent += (ch == '{') ? 1 : -1;
}
}
}
} else {
if (state == SCE_C_PREPROCESSOR) {
if (stylingWithinPreprocessor) {
if (isspace(ch)) {
styler.ColourTo(i-1, state);
state = SCE_C_DEFAULT;
}
} else {
if ((ch == '\r' || ch == '\n') && !(chPrev == '\\' || chPrev == '\r')) {
styler.ColourTo(i-1, state);
state = SCE_C_DEFAULT;
}
}
} else if (state == SCE_C_COMMENT) {
if (ch == '/' && chPrev == '*') {
if (((i > styler.GetStartSegment() + 2) || (
(initStyle == SCE_C_COMMENT) &&
(styler.GetStartSegment() == static_cast<unsigned int>(startPos))))) {
styler.ColourTo(i, state);
state = SCE_C_DEFAULT;
}
}
} else if (state == SCE_C_COMMENTDOC) {
if (ch == '/' && chPrev == '*') {
if (((i > styler.GetStartSegment() + 2) || (
(initStyle == SCE_C_COMMENTDOC) &&
(styler.GetStartSegment() == static_cast<unsigned int>(startPos))))) {
styler.ColourTo(i, state);
state = SCE_C_DEFAULT;
}
}
} else if (state == SCE_C_COMMENTLINE) {
if (ch == '\r' || ch == '\n') {
styler.ColourTo(i-1, state);
state = SCE_C_DEFAULT;
}
} else if (state == SCE_C_STRING) {
if (ch == '\\') {
if (chNext == '\"' || chNext == '\'' || chNext == '\\') {
i++;
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
}
} else if (ch == '\"') {
styler.ColourTo(i, state);
state = SCE_C_DEFAULT;
} else if (chNext == '\r' || chNext == '\n') {
styler.ColourTo(i-1, SCE_C_STRINGEOL);
state = SCE_C_STRINGEOL;
}
} else if (state == SCE_C_CHARACTER) {
if ((ch == '\r' || ch == '\n') && (chPrev != '\\')) {
styler.ColourTo(i-1, SCE_C_STRINGEOL);
state = SCE_C_STRINGEOL;
} else if (ch == '\\') {
if (chNext == '\"' || chNext == '\'' || chNext == '\\') {
i++;
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
}
} else if (ch == '\'') {
styler.ColourTo(i, state);
state = SCE_C_DEFAULT;
}
} else if (state == SCE_C_VERBATIM) {
if (ch == '\"') {
if (chNext == '\"') {
i++;
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
} else {
styler.ColourTo(i, state);
state = SCE_C_DEFAULT;
}
}
} else if (state == SCE_C_UUID) {
if (ch == '\r' || ch == '\n' || ch == ')') {
styler.ColourTo(i-1, state);
if (ch == ')')
styler.ColourTo(i, SCE_C_OPERATOR);
state = SCE_C_DEFAULT;
}
}
}
chPrev = ch;
}
styler.ColourTo(lengthDoc - 1, state);
// Fill in the real level of the next line, keeping the current flags as they will be filled in later
if (fold) {
int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
//styler.SetLevel(lineCurrent, levelCurrent | flagsNext);
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
}
}
LexerModule lmCPP(SCLEX_CPP, ColouriseCppDoc);

File diff suppressed because it is too large Load Diff

View File

@@ -1,298 +0,0 @@
// LexLua.cxx - lexer for Lua language
// Written by Paul Winwood
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdarg.h>
#include <stdio.h>
#include <fcntl.h>
#include "Platform.h"
#include "PropSet.h"
#include "Accessor.h"
#include "KeyWords.h"
#include "Scintilla.h"
#include "SciLexer.h"
static void classifyWordLua(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler)
{
char s[100];
bool wordIsNumber = isdigit(styler[start]) || (styler[start] == '.');
for (unsigned int i = 0; i < end - start + 1 && i < 30; i++)
{
s[i] = styler[start + i];
s[i + 1] = '\0';
}
char chAttr = SCE_LUA_IDENTIFIER;
if (wordIsNumber)
chAttr = SCE_LUA_NUMBER;
else
{
if (keywords.InList(s))
{
chAttr = SCE_LUA_WORD;
}
}
styler.ColourTo(end, chAttr);
}
static void ColouriseLuaDoc(unsigned int startPos,
int length,
int initStyle,
WordList *keywordlists[],
Accessor &styler)
{
WordList &keywords = *keywordlists[0];
styler.StartAt(startPos);
styler.GetLine(startPos);
int state = initStyle;
char chPrev = ' ';
char chNext = styler[startPos];
unsigned int lengthDoc = startPos + length;
bool firstChar = true;
int literalString = 0;
styler.StartSegment(startPos);
for (unsigned int i = startPos; i <= lengthDoc; i++)
{
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
if (styler.IsLeadByte(ch))
{
chNext = styler.SafeGetCharAt(i + 2);
chPrev = ' ';
i += 1;
continue;
}
if (state == SCE_LUA_STRINGEOL)
{
if (ch != '\r' && ch != '\n')
{
styler.ColourTo(i-1, state);
state = SCE_LUA_DEFAULT;
}
}
if (state == SCE_LUA_LITERALSTRING && ch == '[' && chNext == '[')
{
literalString++;
}
else
if (state == SCE_LUA_DEFAULT)
{
if (ch == '-' && chNext == '-')
{
styler.ColourTo(i-1, state);
state = SCE_LUA_COMMENTLINE;
}
else
if (ch == '[' && chNext == '[')
{
state = SCE_LUA_LITERALSTRING;
literalString = 1;
}
else
if (iswordstart(ch))
{
styler.ColourTo(i-1, state);
state = SCE_LUA_WORD;
}
else
if (ch == '\"')
{
styler.ColourTo(i-1, state);
state = SCE_LUA_STRING;
}
else
if (ch == '\'')
{
styler.ColourTo(i-1, state);
state = SCE_LUA_CHARACTER;
}
else
if (ch == '$' && firstChar)
{
styler.ColourTo(i-1, state);
state = SCE_LUA_PREPROCESSOR;
}
else
if (isoperator(ch))
{
styler.ColourTo(i-1, state);
styler.ColourTo(i, SCE_LUA_OPERATOR);
}
}
else
if (state == SCE_LUA_WORD)
{
if (!iswordchar(ch))
{
classifyWordLua(styler.GetStartSegment(), i - 1, keywords, styler);
state = SCE_LUA_DEFAULT;
if (ch == '[' && chNext == '[')
{
literalString = 1;
state = SCE_LUA_LITERALSTRING;
}
else
if (ch == '-' && chNext == '-')
{
state = SCE_LUA_COMMENTLINE;
}
else
if (ch == '\"')
{
state = SCE_LUA_STRING;
}
else
if (ch == '\'')
{
state = SCE_LUA_CHARACTER;
}
else
if (ch == '$' && firstChar)
{
state = SCE_LUA_PREPROCESSOR;
}
else
if (isoperator(ch))
{
styler.ColourTo(i, SCE_LUA_OPERATOR);
}
}
}
else
{
if (state == SCE_LUA_LITERALSTRING)
{
if (ch == ']' && (chPrev == ']') && (--literalString == 0))
{
styler.ColourTo(i, state);
state = SCE_LUA_DEFAULT;
}
}
else
if (state == SCE_LUA_PREPROCESSOR)
{
if ((ch == '\r' || ch == '\n') && (chPrev != '\\'))
{
styler.ColourTo(i-1, state);
state = SCE_LUA_DEFAULT;
}
}
else
if (state == SCE_LUA_COMMENTLINE)
{
if (ch == '\r' || ch == '\n')
{
styler.ColourTo(i-1, state);
state = SCE_LUA_DEFAULT;
}
}
else
if (state == SCE_LUA_STRING)
{
if ((ch == '\r' || ch == '\n') && (chPrev != '\\'))
{
styler.ColourTo(i-1, state);
state = SCE_LUA_STRINGEOL;
}
else
if (ch == '\\')
{
if (chNext == '\"' || chNext == '\\')
{
i++;
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
}
}
else
if (ch == '\"')
{
styler.ColourTo(i, state);
state = SCE_LUA_DEFAULT;
i++;
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
}
}
else
if (state == SCE_LUA_CHARACTER)
{
if ((ch == '\r' || ch == '\n') && (chPrev != '\\'))
{
styler.ColourTo(i-1, state);
state = SCE_LUA_STRINGEOL;
}
else
if (ch == '\\')
{
if (chNext == '\'' || chNext == '\\')
{
i++;
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
}
}
else
if (ch == '\'')
{
styler.ColourTo(i, state);
state = SCE_LUA_DEFAULT;
i++;
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
}
}
if (state == SCE_LUA_DEFAULT)
{
if (ch == '-' && chNext == '-')
{
state = SCE_LUA_COMMENTLINE;
}
else
if (ch == '\"')
{
state = SCE_LUA_STRING;
}
else
if (ch == '\'')
{
state = SCE_LUA_CHARACTER;
}
else
if (ch == '$' && firstChar)
{
state = SCE_LUA_PREPROCESSOR;
}
else
if (iswordstart(ch))
{
state = SCE_LUA_WORD;
}
else
if (isoperator(ch))
{
styler.ColourTo(i, SCE_LUA_OPERATOR);
}
}
}
chPrev = ch;
firstChar = (ch == '\r' || ch == '\n');
}
styler.ColourTo(lengthDoc - 1, state);
}
LexerModule lmLua(SCLEX_LUA, ColouriseLuaDoc);

View File

@@ -1,351 +0,0 @@
// SciTE - Scintilla based Text Editor
// LexOthers.cxx - lexers for properties files, batch files, make files and error lists
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include "Platform.h"
#include "PropSet.h"
#include "Accessor.h"
#include "KeyWords.h"
#include "Scintilla.h"
#include "SciLexer.h"
static void ColouriseBatchLine(char *lineBuffer, int endLine, Accessor &styler) {
if (0 == strncmp(lineBuffer, "REM", 3)) {
styler.ColourTo(endLine, 1);
} else if (0 == strncmp(lineBuffer, "rem", 3)) {
styler.ColourTo(endLine, 1);
} else if (0 == strncmp(lineBuffer, "SET", 3)) {
styler.ColourTo(endLine, 2);
} else if (0 == strncmp(lineBuffer, "set", 3)) {
styler.ColourTo(endLine, 2);
} else if (lineBuffer[0] == ':') {
styler.ColourTo(endLine, 3);
} else {
styler.ColourTo(endLine, 0);
}
}
static void ColouriseBatchDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
char lineBuffer[1024];
styler.StartAt(startPos);
styler.StartSegment(startPos);
unsigned int linePos = 0;
for (unsigned int i = startPos; i < startPos + length; i++) {
lineBuffer[linePos++] = styler[i];
if (styler[i] == '\r' || styler[i] == '\n' || (linePos >= sizeof(lineBuffer) - 1)) {
ColouriseBatchLine(lineBuffer, i, styler);
linePos = 0;
}
}
if (linePos > 0)
ColouriseBatchLine(lineBuffer, startPos + length, styler);
}
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
// difference starts then each line starting with ' ' is a whitespace
// otherwise it is considered a comment (Only in..., Binary file...)
if (0 == strncmp(lineBuffer, "diff ", 3)) {
styler.ColourTo(endLine, 2);
} else if (0 == strncmp(lineBuffer, "--- ", 3)) {
styler.ColourTo(endLine, 3);
} else if (0 == strncmp(lineBuffer, "+++ ", 3)) {
styler.ColourTo(endLine, 3);
} else if (lineBuffer[0] == '@') {
styler.ColourTo(endLine, 4);
} else if (lineBuffer[0] == '-') {
styler.ColourTo(endLine, 5);
} else if (lineBuffer[0] == '+') {
styler.ColourTo(endLine, 6);
} else if (lineBuffer[0] != ' ') {
styler.ColourTo(endLine, 1);
} else {
styler.ColourTo(endLine, 0);
}
}
static void ColouriseDiffDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
char lineBuffer[1024];
styler.StartAt(startPos);
styler.StartSegment(startPos);
unsigned int linePos = 0;
for (unsigned int i = startPos; i < startPos + length; i++) {
lineBuffer[linePos++] = styler[i];
if (styler[i] == '\r' || styler[i] == '\n' || (linePos >= sizeof(lineBuffer) - 1)) {
ColouriseDiffLine(lineBuffer, i, styler);
linePos = 0;
}
}
if (linePos > 0)
ColouriseDiffLine(lineBuffer, startPos + length, styler);
}
static void ColourisePropsLine(char *lineBuffer, int lengthLine, int startLine, int endPos, Accessor &styler) {
int i = 0;
while (isspace(lineBuffer[i]) && (i < lengthLine)) // Skip initial spaces
i++;
if (lineBuffer[i] == '#' || lineBuffer[i] == '!' || lineBuffer[i] == ';') {
styler.ColourTo(endPos, 1);
} else if (lineBuffer[i] == '[') {
styler.ColourTo(endPos, 2);
} else if (lineBuffer[i] == '@') {
styler.ColourTo(startLine+i, 4);
if (lineBuffer[++i] == '=')
styler.ColourTo(startLine+i, 3);
styler.ColourTo(endPos, 0);
} else {
while (lineBuffer[i] != '=' && (i < lengthLine)) // Search the '=' character
i++;
if (lineBuffer[i] == '=') {
styler.ColourTo(startLine+i-1, 0);
styler.ColourTo(startLine+i, 3);
styler.ColourTo(endPos, 0);
} else {
styler.ColourTo(endPos, 0);
}
}
}
static void ColourisePropsDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
char lineBuffer[1024];
styler.StartAt(startPos);
styler.StartSegment(startPos);
unsigned int linePos = 0;
int startLine = startPos;
for (unsigned int i = startPos; i <= startPos + length; i++) {
lineBuffer[linePos++] = styler[i];
if ((styler[i] == '\r' && styler.SafeGetCharAt(i+1) != '\n') ||
styler[i] == '\n' ||
(linePos >= sizeof(lineBuffer) - 1)) {
lineBuffer[linePos] = '\0';
ColourisePropsLine(lineBuffer, linePos, startLine, i, styler);
linePos = 0;
startLine = i+1;
}
}
if (linePos > 0)
ColourisePropsLine(lineBuffer, linePos, startLine, startPos + length, styler);
}
static void ColouriseMakeLine(char *lineBuffer, int lengthLine, int endPos, Accessor &styler) {
int i = 0;
while (isspace(lineBuffer[i]) && (i < lengthLine))
i++;
if (lineBuffer[i] == '#' || lineBuffer[i] == '!') {
styler.ColourTo(endPos, 1);
} else {
styler.ColourTo(endPos, 0);
}
}
static void ColouriseMakeDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
char lineBuffer[1024];
styler.StartAt(startPos);
styler.StartSegment(startPos);
unsigned int linePos = 0;
for (unsigned int i = startPos; i <= startPos + length; i++) {
lineBuffer[linePos++] = styler[i];
if (styler[i] == '\r' || styler[i] == '\n' || (linePos >= sizeof(lineBuffer) - 1)) {
ColouriseMakeLine(lineBuffer, linePos, i, styler);
linePos = 0;
}
}
if (linePos > 0)
ColouriseMakeLine(lineBuffer, linePos, startPos + length, styler);
}
static void ColouriseErrorListLine(char *lineBuffer, int lengthLine, int endPos, Accessor &styler) {
if (lineBuffer[0] == '>') {
// Command or return status
styler.ColourTo(endPos, SCE_ERR_CMD);
} else if (strstr(lineBuffer, "File \"") && strstr(lineBuffer, ", line ")) {
styler.ColourTo(endPos, SCE_ERR_PYTHON);
} else if (0 == strncmp(lineBuffer, "Error ", strlen("Error "))) {
// Borland error message
styler.ColourTo(endPos, SCE_ERR_BORLAND);
} else if (0 == strncmp(lineBuffer, "Warning ", strlen("Warning "))) {
// Borland warning message
styler.ColourTo(endPos, SCE_ERR_BORLAND);
} else if (strstr(lineBuffer, " at " ) &&
strstr(lineBuffer, " at " ) < lineBuffer+lengthLine &&
strstr(lineBuffer, " line ") &&
strstr(lineBuffer, " line ") < lineBuffer+lengthLine) {
// perl error message
styler.ColourTo(endPos, SCE_ERR_PERL);
} else {
// Look for <filename>:<line>:message
// Look for <filename>(line)message
// Look for <filename>(line,pos)message
int state = 0;
for (int i = 0; i < lengthLine; i++) {
if (state == 0 && lineBuffer[i] == ':' && isdigit(lineBuffer[i + 1])) {
state = 1;
} else if (state == 0 && lineBuffer[i] == '(') {
state = 10;
} else if (state == 1 && isdigit(lineBuffer[i])) {
state = 2;
} else if (state == 2 && lineBuffer[i] == ':') {
state = 3;
break;
} else if (state == 2 && !isdigit(lineBuffer[i])) {
state = 99;
} else if (state == 10 && isdigit(lineBuffer[i])) {
state = 11;
} else if (state == 11 && lineBuffer[i] == ',') {
state = 14;
} else if (state == 11 && lineBuffer[i] == ')') {
state = 12;
} else if (state == 12 && lineBuffer[i] == ':') {
state = 13;
} else if (state == 14 && lineBuffer[i] == ')') {
state = 15;
break;
} else if (((state == 11) || (state == 14)) && !((lineBuffer[i] == ' ') || isdigit(lineBuffer[i]))) {
state = 99;
}
}
if (state == 3) {
styler.ColourTo(endPos, SCE_ERR_GCC);
} else if ((state == 13) || (state == 14) || (state == 15)) {
styler.ColourTo(endPos, SCE_ERR_MS);
} else {
styler.ColourTo(endPos, SCE_ERR_DEFAULT);
}
}
}
static void ColouriseErrorListDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
char lineBuffer[1024];
styler.StartAt(startPos);
styler.StartSegment(startPos);
unsigned int linePos = 0;
for (unsigned int i = startPos; i <= startPos + length; i++) {
lineBuffer[linePos++] = styler[i];
if (styler[i] == '\r' || styler[i] == '\n' || (linePos >= sizeof(lineBuffer) - 1)) {
ColouriseErrorListLine(lineBuffer, linePos, i, styler);
linePos = 0;
}
}
if (linePos > 0)
ColouriseErrorListLine(lineBuffer, linePos, startPos + length, styler);
}
static int isSpecial(char s) {
return (s == '\\') || (s == ',') || (s == ';') || (s == '\'') || (s == ' ') ||
(s == '\"') || (s == '`') || (s == '^') || (s == '~');
}
static int isTag(int start, Accessor &styler) {
char s[6];
unsigned int i = 0, e=1;
while (i < 5 && e) {
s[i] = styler[start + i];
i++;
e = styler[start + i] != '{';
}
s[i] = '\0';
return (strcmp(s, "begin") == 0) || (strcmp(s, "end") == 0);
}
static void ColouriseLatexDoc(unsigned int startPos, int length, int initStyle,
WordList *[], Accessor &styler) {
styler.StartAt(startPos);
int state = initStyle;
char chNext = styler[startPos];
styler.StartSegment(startPos);
int lengthDoc = startPos + length;
for (int i = startPos; i < lengthDoc; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
if (styler.IsLeadByte(ch)) {
chNext = styler.SafeGetCharAt(i + 2);
i++;
continue;
}
switch(state) {
case SCE_L_DEFAULT :
switch(ch) {
case '\\' :
styler.ColourTo(i - 1, state);
if (isSpecial(styler[i + 1])) {
styler.ColourTo(i + 1, SCE_L_COMMAND);
i++;
chNext = styler.SafeGetCharAt(i + 1);
}
else {
if (isTag(i+1, styler))
state = SCE_L_TAG;
else
state = SCE_L_COMMAND;
}
break;
case '$' :
styler.ColourTo(i - 1, state);
state = SCE_L_MATH;
if (chNext == '$') {
i++;
chNext = styler.SafeGetCharAt(i + 1);
}
break;
case '%' :
styler.ColourTo(i - 1, state);
state = SCE_L_COMMENT;
break;
}
break;
case SCE_L_COMMAND :
if (chNext == '[' || chNext == '{' || chNext == '}' ||
chNext == ' ' || chNext == '\r' || chNext == '\n') {
styler.ColourTo(i, state);
state = SCE_L_DEFAULT;
i++;
chNext = styler.SafeGetCharAt(i + 1);
}
break;
case SCE_L_TAG :
if (ch == '}') {
styler.ColourTo(i, state);
state = SCE_L_DEFAULT;
}
break;
case SCE_L_MATH :
if (ch == '$') {
if (chNext == '$') {
i++;
chNext = styler.SafeGetCharAt(i + 1);
}
styler.ColourTo(i, state);
state = SCE_L_DEFAULT;
}
break;
case SCE_L_COMMENT :
if (ch == '\r' || ch == '\n') {
styler.ColourTo(i - 1, state);
state = SCE_L_DEFAULT;
}
}
}
styler.ColourTo(lengthDoc, state);
}
LexerModule lmBatch(SCLEX_BATCH, ColouriseBatchDoc);
LexerModule lmDiff(SCLEX_DIFF, ColouriseDiffDoc);
LexerModule lmProps(SCLEX_PROPERTIES, ColourisePropsDoc);
LexerModule lmMake(SCLEX_MAKEFILE, ColouriseMakeDoc);
LexerModule lmErrorList(SCLEX_ERRORLIST, ColouriseErrorListDoc);
LexerModule lmLatex(SCLEX_LATEX, ColouriseLatexDoc);

View File

@@ -1,508 +0,0 @@
// SciTE - Scintilla based Text Editor
// LexPerl.cxx - lexer for subset of Perl
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include "Platform.h"
#include "PropSet.h"
#include "Accessor.h"
#include "KeyWords.h"
#include "Scintilla.h"
#include "SciLexer.h"
inline bool isPerlOperator(char ch) {
if (isalnum(ch))
return false;
// '.' left out as it is used to make up numbers
if (ch == '%' || ch == '^' || ch == '&' || ch == '*' || ch == '\\' ||
ch == '(' || ch == ')' || ch == '-' || ch == '+' ||
ch == '=' || ch == '|' || ch == '{' || ch == '}' ||
ch == '[' || ch == ']' || ch == ':' || ch == ';' ||
ch == '<' || ch == '>' || ch == ',' || ch == '/' ||
ch == '?' || ch == '!' || ch == '.' || ch == '~')
return true;
return false;
}
static int classifyWordPerl(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) {
char s[100];
bool wordIsNumber = isdigit(styler[start]) || (styler[start] == '.');
for (unsigned int i = 0; i < end - start + 1 && i < 30; i++) {
s[i] = styler[start + i];
s[i + 1] = '\0';
}
char chAttr = SCE_PL_IDENTIFIER;
if (wordIsNumber)
chAttr = SCE_PL_NUMBER;
else {
if (keywords.InList(s))
chAttr = SCE_PL_WORD;
}
styler.ColourTo(end, chAttr);
return chAttr;
}
static bool isEndVar(char ch) {
return !isalnum(ch) && ch != '#' && ch != '$' &&
ch != '_' && ch != '\'';
}
static bool isMatch(Accessor &styler, int lengthDoc, int pos, const char *val) {
if ((pos + static_cast<int>(strlen(val))) >= lengthDoc) {
return false;
}
while (*val) {
if (*val != styler[pos++]) {
return false;
}
val++;
}
return true;
}
static char opposite(char ch) {
if (ch == '(')
return ')';
if (ch == '[')
return ']';
if (ch == '{')
return '}';
if (ch == '<')
return '>';
return ch;
}
static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
WordList *keywordlists[], Accessor &styler) {
// Lexer for perl often has to backtrack to start of current style to determine
// which characters are being used as quotes, how deeply nested is the
// start position and what the termination string is for here documents
WordList &keywords = *keywordlists[0];
char sooked[100];
int quotes = 0;
char quoteDown = 'd';
char quoteUp = 'd';
int quoteRep = 1;
int sookedpos = 0;
bool preferRE = true;
sooked[sookedpos] = '\0';
int state = initStyle;
int lengthDoc = startPos + length;
// If in a long distance lexical state, seek to the beginning to find quote characters
if (state == SCE_PL_HERE || state == SCE_PL_REGEX ||
state == SCE_PL_REGSUBST || state == SCE_PL_LONGQUOTE) {
while ((startPos > 1) && (styler.StyleAt(startPos - 1) == state)) {
startPos--;
}
state = SCE_PL_DEFAULT;
}
styler.StartAt(startPos);
char chPrev = styler.SafeGetCharAt(startPos - 1);
char chNext = styler[startPos];
styler.StartSegment(startPos);
for (int i = startPos; i < lengthDoc; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
char chNext2 = styler.SafeGetCharAt(i + 2);
if (styler.IsLeadByte(ch)) {
chNext = styler.SafeGetCharAt(i + 2);
chPrev = ' ';
i += 1;
continue;
}
if (state == SCE_PL_DEFAULT) {
if (iswordstart(ch)) {
styler.ColourTo(i - 1, state);
if (ch == 's' && !isalnum(chNext)) {
state = SCE_PL_REGSUBST;
quotes = 0;
quoteUp = '\0';
quoteDown = '\0';
quoteRep = 2;
} else if (ch == 'm' && !isalnum(chNext)) {
state = SCE_PL_REGEX;
quotes = 0;
quoteUp = '\0';
quoteDown = '\0';
quoteRep = 1;
} else if (ch == 't' && chNext == 'r' && !isalnum(chNext2)) {
state = SCE_PL_REGSUBST;
quotes = 0;
quoteUp = '\0';
quoteDown = '\0';
quoteRep = 2;
i++;
chNext = chNext2;
} else if (ch == 'q' && (chNext == 'q' || chNext == 'r' || chNext == 'w' || chNext == 'x') && !isalnum(chNext2)) {
state = SCE_PL_LONGQUOTE;
i++;
chNext = chNext2;
quotes = 0;
quoteUp = '\0';
quoteDown = '\0';
quoteRep = 1;
} else {
state = SCE_PL_WORD;
preferRE = false;
}
} else if (ch == '#') {
styler.ColourTo(i - 1, state);
state = SCE_PL_COMMENTLINE;
} else if (ch == '\"') {
styler.ColourTo(i - 1, state);
state = SCE_PL_STRING;
} else if (ch == '\'') {
if (chPrev == '&') {
// Archaic call
styler.ColourTo(i, state);
} else {
styler.ColourTo(i - 1, state);
state = SCE_PL_CHARACTER;
}
} else if (ch == '`') {
styler.ColourTo(i - 1, state);
state = SCE_PL_BACKTICKS;
} else if (ch == '$') {
preferRE = false;
styler.ColourTo(i - 1, state);
if (isalnum(chNext) || chNext == '#' || chNext == '$' || chNext == '_') {
state = SCE_PL_SCALAR;
} else if (chNext != '{' && chNext != '[') {
styler.ColourTo(i, SCE_PL_SCALAR);
i++;
ch = ' ';
chNext = ' ';
} else {
styler.ColourTo(i, SCE_PL_SCALAR);
}
} else if (ch == '@') {
preferRE = false;
styler.ColourTo(i - 1, state);
if (isalpha(chNext) || chNext == '#' || chNext == '$' || chNext == '_') {
state = SCE_PL_ARRAY;
} else if (chNext != '{' && chNext != '[') {
styler.ColourTo(i, SCE_PL_ARRAY);
i++;
ch = ' ';
} else {
styler.ColourTo(i, SCE_PL_ARRAY);
}
} else if (ch == '%') {
preferRE = false;
styler.ColourTo(i - 1, state);
if (isalpha(chNext) || chNext == '#' || chNext == '$' || chNext == '_') {
state = SCE_PL_HASH;
} else if (chNext != '{' && chNext != '[') {
styler.ColourTo(i, SCE_PL_HASH);
i++;
ch = ' ';
} else {
styler.ColourTo(i, SCE_PL_HASH);
}
} else if (ch == '*') {
styler.ColourTo(i - 1, state);
state = SCE_PL_SYMBOLTABLE;
} else if (ch == '/' && preferRE) {
styler.ColourTo(i - 1, state);
state = SCE_PL_REGEX;
quoteUp = '/';
quoteDown = '/';
quotes = 1;
quoteRep = 1;
} else if (ch == '<' && chNext == '<') {
styler.ColourTo(i - 1, state);
state = SCE_PL_HERE;
i++;
ch = chNext;
chNext = chNext2;
quotes = 0;
sookedpos = 0;
sooked[sookedpos] = '\0';
} else if (ch == '=' && (chPrev == '\r' || chPrev == '\n') && isalpha(chNext)) {
styler.ColourTo(i - 1, state);
state = SCE_PL_POD;
quotes = 0;
sookedpos = 0;
sooked[sookedpos] = '\0';
} else if (isPerlOperator(ch)) {
if (ch == ')' || ch == ']')
preferRE = false;
else
preferRE = true;
styler.ColourTo(i - 1, state);
styler.ColourTo(i, SCE_PL_OPERATOR);
}
} else if (state == SCE_PL_WORD) {
if (!iswordchar(ch) && ch != '\'') { // Archaic Perl has quotes inside names
if (isMatch(styler, lengthDoc, styler.GetStartSegment(), "__DATA__")) {
styler.ColourTo(i, SCE_PL_DATASECTION);
state = SCE_PL_DATASECTION;
} else if (isMatch(styler, lengthDoc, styler.GetStartSegment(), "__END__")) {
styler.ColourTo(i, SCE_PL_DATASECTION);
state = SCE_PL_DATASECTION;
} else {
if (classifyWordPerl(styler.GetStartSegment(), i - 1, keywords, styler) == SCE_PL_WORD)
preferRE = true;
state = SCE_PL_DEFAULT;
if (ch == '#') {
state = SCE_PL_COMMENTLINE;
} else if (ch == '\"') {
state = SCE_PL_STRING;
} else if (ch == '\'') {
state = SCE_PL_CHARACTER;
} else if (ch == '<' && chNext == '<') {
state = SCE_PL_HERE;
quotes = 0;
sookedpos = 0;
sooked[sookedpos] = '\0';
} else if (isPerlOperator(ch)) {
if (ch == ')' || ch == ']')
preferRE = false;
else
preferRE = true;
styler.ColourTo(i, SCE_PL_OPERATOR);
state = SCE_PL_DEFAULT;
}
}
}
} else {
if (state == SCE_PL_COMMENTLINE) {
if (ch == '\r' || ch == '\n') {
styler.ColourTo(i - 1, state);
state = SCE_PL_DEFAULT;
}
} else if (state == SCE_PL_HERE) {
if ((isalnum(ch) || ch == '_') && quotes < 2) {
sooked[sookedpos++] = ch;
sooked[sookedpos] = '\0';
if (quotes == 0)
quotes = 1;
} else {
quotes++;
}
if ((quotes > 1) &&
(chPrev == '\n' || chPrev == '\r') &&
isMatch(styler, lengthDoc, i, sooked)) {
i += sookedpos;
chNext = styler.SafeGetCharAt(i);
if (chNext == '\n' || chNext == '\r') {
styler.ColourTo(i - 1, SCE_PL_HERE);
state = SCE_PL_DEFAULT;
}
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
}
} else if (state == SCE_PL_STRING) {
if (ch == '\\') {
if (chNext == '\"' || chNext == '\'' || chNext == '\\') {
i++;
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
}
} else if (ch == '\"') {
styler.ColourTo(i, state);
state = SCE_PL_DEFAULT;
i++;
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
}
} else if (state == SCE_PL_CHARACTER) {
if (ch == '\\') {
if (chNext == '\"' || chNext == '\'' || chNext == '\\') {
i++;
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
}
} else if (ch == '\'') {
styler.ColourTo(i, state);
state = SCE_PL_DEFAULT;
i++;
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
}
} else if (state == SCE_PL_BACKTICKS) {
if (ch == '`') {
styler.ColourTo(i, state);
state = SCE_PL_DEFAULT;
i++;
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
}
} else if (state == SCE_PL_POD) {
if (ch == '=' && (chPrev == '\r' || chPrev == '\n')) {
if (isMatch(styler, lengthDoc, i, "=cut")) {
styler.ColourTo(i - 1 + 4, state);
i += 4;
state = SCE_PL_DEFAULT;
ch = styler.SafeGetCharAt(i);
chNext = styler.SafeGetCharAt(i + 1);
}
}
} else if (state == SCE_PL_SCALAR) {
if (isEndVar(ch)) {
styler.ColourTo(i - 1, state);
state = SCE_PL_DEFAULT;
}
} else if (state == SCE_PL_ARRAY) {
if (isEndVar(ch)) {
styler.ColourTo(i - 1, state);
state = SCE_PL_DEFAULT;
}
} else if (state == SCE_PL_HASH) {
if (isEndVar(ch)) {
styler.ColourTo(i - 1, state);
state = SCE_PL_DEFAULT;
}
} else if (state == SCE_PL_SYMBOLTABLE) {
if (isEndVar(ch)) {
styler.ColourTo(i - 1, state);
state = SCE_PL_DEFAULT;
}
} else if (state == SCE_PL_REF) {
if (isEndVar(ch)) {
styler.ColourTo(i - 1, state);
state = SCE_PL_DEFAULT;
}
} else if (state == SCE_PL_REGEX) {
if (!quoteUp && !isspace(ch)) {
quoteUp = ch;
quoteDown = opposite(ch);
quotes++;
} else {
if (ch == quoteDown && chPrev != '\\') {
quotes--;
if (quotes == 0) {
quoteRep--;
if (quoteUp == quoteDown) {
quotes++;
}
}
if (!isalpha(chNext)) {
if (quoteRep <= 0) {
styler.ColourTo(i, state);
state = SCE_PL_DEFAULT;
ch = ' ';
}
}
} else if (ch == quoteUp && chPrev != '\\') {
quotes++;
} else if (!isalpha(chNext)) {
if (quoteRep <= 0) {
styler.ColourTo(i, state);
state = SCE_PL_DEFAULT;
ch = ' ';
}
}
}
} else if (state == SCE_PL_REGSUBST) {
if (!quoteUp && !isspace(ch)) {
quoteUp = ch;
quoteDown = opposite(ch);
quotes++;
} else {
if (quotes == 0 && quoteRep == 1) {
/* We matched something like s(...) or tr{...}
* and are looking for the next matcher characters,
* which could be either bracketed ({...}) or non-bracketed
* (/.../).
*
* Number-signs are problematic. If they occur after
* the close of the first part, treat them like
* a quoteUp char, even if they actually start comments.
*
* If we find an alnum, we end the regsubst, and punt.
*
* Eric Promislow ericp@activestate.com Aug 9,2000
*/
if (isspace(ch)) {
// Keep going
} else if (isalnum(ch)) {
styler.ColourTo(i, state);
state = SCE_PL_DEFAULT;
ch = ' ';
} else {
quoteUp = ch;
quoteDown = opposite(ch);
quotes++;
}
} else if (ch == quoteDown && chPrev != '\\') {
quotes--;
if (quotes == 0) {
quoteRep--;
}
if (!isalpha(chNext)) {
if (quoteRep <= 0) {
styler.ColourTo(i, state);
state = SCE_PL_DEFAULT;
ch = ' ';
}
}
if (quoteUp == quoteDown) {
quotes++;
}
} else if (ch == quoteUp && chPrev != '\\') {
quotes++;
} else if (!isalpha(chNext)) {
if (quoteRep <= 0) {
styler.ColourTo(i, state);
state = SCE_PL_DEFAULT;
ch = ' ';
}
}
}
} else if (state == SCE_PL_LONGQUOTE) {
if (!quoteDown && !isspace(ch)) {
quoteUp = ch;
quoteDown = opposite(quoteUp);
quotes++;
} else if (ch == quoteDown) {
quotes--;
if (quotes == 0) {
quoteRep--;
if (quoteRep <= 0) {
styler.ColourTo(i, state);
state = SCE_PL_DEFAULT;
ch = ' ';
}
if (quoteUp == quoteDown) {
quotes++;
}
}
} else if (ch == quoteUp) {
quotes++;
}
}
if (state == SCE_PL_DEFAULT) { // One of the above succeeded
if (ch == '#') {
state = SCE_PL_COMMENTLINE;
} else if (ch == '\"') {
state = SCE_PL_STRING;
} else if (ch == '\'') {
state = SCE_PL_CHARACTER;
} else if (iswordstart(ch)) {
state = SCE_PL_WORD;
preferRE = false;
} else if (isoperator(ch)) {
styler.ColourTo(i, SCE_PL_OPERATOR);
}
}
}
chPrev = ch;
}
styler.ColourTo(lengthDoc, state);
}
LexerModule lmPerl(SCLEX_PERL, ColourisePerlDoc);

View File

@@ -1,281 +0,0 @@
// SciTE - Scintilla based Text Editor
// LexPython.cxx - lexer for Python
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include "Platform.h"
#include "PropSet.h"
#include "Accessor.h"
#include "KeyWords.h"
#include "Scintilla.h"
#include "SciLexer.h"
static void ClassifyWordPy(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, char *prevWord) {
char s[100];
bool wordIsNumber = isdigit(styler[start]);
for (unsigned int i = 0; i < end - start + 1 && i < 30; i++) {
s[i] = styler[start + i];
s[i + 1] = '\0';
}
char chAttr = SCE_P_IDENTIFIER;
if (0 == strcmp(prevWord, "class"))
chAttr = SCE_P_CLASSNAME;
else if (0 == strcmp(prevWord, "def"))
chAttr = SCE_P_DEFNAME;
else if (wordIsNumber)
chAttr = SCE_P_NUMBER;
else if (keywords.InList(s))
chAttr = SCE_P_WORD;
// make sure that dot-qualifiers inside the word are lexed correct
else for (unsigned int i = 0; i < end - start + 1; i++) {
if (styler[start + i] == '.') {
styler.ColourTo(start + i - 1, chAttr);
styler.ColourTo(start + i, SCE_P_OPERATOR);
}
}
styler.ColourTo(end, chAttr);
strcpy(prevWord, s);
}
static bool IsPyComment(Accessor &styler, int pos, int len) {
return len>0 && styler[pos]=='#';
}
static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,
WordList *keywordlists[], Accessor &styler) {
int lengthDoc = startPos + length;
// Backtrack to previous line in case need to fix its fold status or tab whinging
int lineCurrent = styler.GetLine(startPos);
if (startPos > 0) {
if (lineCurrent > 0) {
lineCurrent--;
startPos = styler.LineStart(lineCurrent);
if (startPos == 0)
initStyle = SCE_P_DEFAULT;
else
initStyle = styler.StyleAt(startPos-1);
}
}
// Python uses a different mask because bad indentation is marked by oring with 32
styler.StartAt(startPos, 127);
WordList &keywords = *keywordlists[0];
bool fold = styler.GetPropertyInt("fold");
int whingeLevel = styler.GetPropertyInt("tab.timmy.whinge.level");
char prevWord[200];
prevWord[0] = '\0';
if (length == 0)
return ;
int spaceFlags = 0;
int state = initStyle & 31;
int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, IsPyComment);
if ((state == SCE_P_TRIPLE) || (state == SCE_P_TRIPLEDOUBLE))
indentCurrent |= SC_FOLDLEVELWHITEFLAG;
char chPrev = ' ';
char chPrev2 = ' ';
char chNext = styler[startPos];
styler.StartSegment(startPos);
bool atStartLine = true;
for (int i = startPos; i < lengthDoc; i++) {
if (atStartLine) {
char chBad = static_cast<char>(64);
char chGood = static_cast<char>(0);
char chFlags = chGood;
if (whingeLevel == 1) {
chFlags = (spaceFlags & wsInconsistent) ? chBad : chGood;
} else if (whingeLevel == 2) {
chFlags = (spaceFlags & wsSpaceTab) ? chBad : chGood;
} else if (whingeLevel == 3) {
chFlags = (spaceFlags & wsSpace) ? chBad : chGood;
} else if (whingeLevel == 4) {
chFlags = (spaceFlags & wsTab) ? chBad : chGood;
}
styler.SetFlags(chFlags, static_cast<char>(state));
atStartLine = false;
}
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
char chNext2 = styler.SafeGetCharAt(i + 2);
if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == lengthDoc)) {
if ((state == SCE_P_DEFAULT) || (state == SCE_P_TRIPLE) || (state == SCE_P_TRIPLEDOUBLE)) {
// Perform colourisation of white space and triple quoted strings at end of each line to allow
// tab marking to work inside white space and triple quoted strings
styler.ColourTo(i, state);
}
int lev = indentCurrent;
int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags, IsPyComment);
if ((state == SCE_P_TRIPLE) || (state == SCE_P_TRIPLEDOUBLE))
indentNext |= SC_FOLDLEVELWHITEFLAG;
if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) {
// Only non whitespace lines can be headers
if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK)) {
lev |= SC_FOLDLEVELHEADERFLAG;
} else if (indentNext & SC_FOLDLEVELWHITEFLAG) {
// Line after is blank so check the next - maybe should continue further?
int spaceFlags2 = 0;
int indentNext2 = styler.IndentAmount(lineCurrent + 2, &spaceFlags2, IsPyComment);
if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext2 & SC_FOLDLEVELNUMBERMASK)) {
lev |= SC_FOLDLEVELHEADERFLAG;
}
}
}
indentCurrent = indentNext;
if (fold) {
styler.SetLevel(lineCurrent, lev);
}
lineCurrent++;
atStartLine = true;
}
if (styler.IsLeadByte(ch)) {
chNext = styler.SafeGetCharAt(i + 2);
chPrev = ' ';
chPrev2 = ' ';
i += 1;
continue;
}
if (state == SCE_P_STRINGEOL) {
if (ch != '\r' && ch != '\n') {
styler.ColourTo(i - 1, state);
state = SCE_P_DEFAULT;
}
}
if (state == SCE_P_DEFAULT) {
if (iswordstart(ch)) {
styler.ColourTo(i - 1, state);
state = SCE_P_WORD;
} else if (ch == '#') {
styler.ColourTo(i - 1, state);
state = chNext == '#' ? SCE_P_COMMENTBLOCK : SCE_P_COMMENTLINE;
} else if (ch == '\"') {
styler.ColourTo(i - 1, state);
if (chNext == '\"' && chNext2 == '\"') {
i += 2;
state = SCE_P_TRIPLEDOUBLE;
ch = ' ';
chPrev = ' ';
chNext = styler.SafeGetCharAt(i + 1);
} else {
state = SCE_P_STRING;
}
} else if (ch == '\'') {
styler.ColourTo(i - 1, state);
if (chNext == '\'' && chNext2 == '\'') {
i += 2;
state = SCE_P_TRIPLE;
ch = ' ';
chPrev = ' ';
chNext = styler.SafeGetCharAt(i + 1);
} else {
state = SCE_P_CHARACTER;
}
} else if (isoperator(ch)) {
styler.ColourTo(i - 1, state);
styler.ColourTo(i, SCE_P_OPERATOR);
}
} else if (state == SCE_P_WORD) {
if (!iswordchar(ch)) {
ClassifyWordPy(styler.GetStartSegment(), i - 1, keywords, styler, prevWord);
state = SCE_P_DEFAULT;
if (ch == '#') {
state = chNext == '#' ? SCE_P_COMMENTBLOCK : SCE_P_COMMENTLINE;
} else if (ch == '\"') {
if (chNext == '\"' && chNext2 == '\"') {
i += 2;
state = SCE_P_TRIPLEDOUBLE;
ch = ' ';
chPrev = ' ';
chNext = styler.SafeGetCharAt(i + 1);
} else {
state = SCE_P_STRING;
}
} else if (ch == '\'') {
if (chNext == '\'' && chNext2 == '\'') {
i += 2;
state = SCE_P_TRIPLE;
ch = ' ';
chPrev = ' ';
chNext = styler.SafeGetCharAt(i + 1);
} else {
state = SCE_P_CHARACTER;
}
} else if (isoperator(ch)) {
styler.ColourTo(i, SCE_P_OPERATOR);
}
}
} else {
if (state == SCE_P_COMMENTLINE || state == SCE_P_COMMENTBLOCK) {
if (ch == '\r' || ch == '\n') {
styler.ColourTo(i - 1, state);
state = SCE_P_DEFAULT;
}
} else if (state == SCE_P_STRING) {
if ((ch == '\r' || ch == '\n') && (chPrev != '\\')) {
styler.ColourTo(i - 1, state);
state = SCE_P_STRINGEOL;
} else if (ch == '\\') {
if (chNext == '\"' || chNext == '\'' || chNext == '\\') {
i++;
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
}
} else if (ch == '\"') {
styler.ColourTo(i, state);
state = SCE_P_DEFAULT;
}
} else if (state == SCE_P_CHARACTER) {
if ((ch == '\r' || ch == '\n') && (chPrev != '\\')) {
styler.ColourTo(i - 1, state);
state = SCE_P_STRINGEOL;
} else if (ch == '\\') {
if (chNext == '\"' || chNext == '\'' || chNext == '\\') {
i++;
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
}
} else if (ch == '\'') {
styler.ColourTo(i, state);
state = SCE_P_DEFAULT;
}
} else if (state == SCE_P_TRIPLE) {
if (ch == '\'' && chPrev == '\'' && chPrev2 == '\'') {
styler.ColourTo(i, state);
state = SCE_P_DEFAULT;
}
} else if (state == SCE_P_TRIPLEDOUBLE) {
if (ch == '\"' && chPrev == '\"' && chPrev2 == '\"') {
styler.ColourTo(i, state);
state = SCE_P_DEFAULT;
}
}
}
chPrev2 = chPrev;
chPrev = ch;
}
if (state == SCE_P_WORD) {
ClassifyWordPy(styler.GetStartSegment(), lengthDoc, keywords, styler, prevWord);
} else {
styler.ColourTo(lengthDoc, state);
}
}
LexerModule lmPython(SCLEX_PYTHON, ColourisePyDoc);

View File

@@ -1,156 +0,0 @@
// SciTE - Scintilla based Text Editor
// LexSQL.cxx - lexer for SQL
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include "Platform.h"
#include "PropSet.h"
#include "Accessor.h"
#include "KeyWords.h"
#include "Scintilla.h"
#include "SciLexer.h"
static void classifyWordSQL(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) {
char s[100];
bool wordIsNumber = isdigit(styler[start]) || (styler[start] == '.');
for (unsigned int i = 0; i < end - start + 1 && i < 30; i++) {
s[i] = static_cast<char>(toupper(styler[start + i]));
s[i + 1] = '\0';
}
char chAttr = SCE_C_IDENTIFIER;
if (wordIsNumber)
chAttr = SCE_C_NUMBER;
else {
if (keywords.InList(s))
chAttr = SCE_C_WORD;
}
styler.ColourTo(end, chAttr);
}
static void ColouriseSQLDoc(unsigned int startPos, int length,
int initStyle, WordList *keywordlists[], Accessor &styler) {
WordList &keywords = *keywordlists[0];
styler.StartAt(startPos);
bool fold = styler.GetPropertyInt("fold");
int lineCurrent = styler.GetLine(startPos);
int spaceFlags = 0;
int state = initStyle;
char chPrev = ' ';
char chNext = styler[startPos];
styler.StartSegment(startPos);
unsigned int lengthDoc = startPos + length;
for (unsigned int i = startPos; i < lengthDoc; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
if ((ch == '\r' && chNext != '\n') || (ch == '\n')) {
int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags);
int lev = indentCurrent;
if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) {
// Only non whitespace lines can be headers
int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags);
if (indentCurrent < (indentNext & ~SC_FOLDLEVELWHITEFLAG)) {
lev |= SC_FOLDLEVELHEADERFLAG;
}
}
if (fold) {
styler.SetLevel(lineCurrent, lev);
}
}
if (styler.IsLeadByte(ch)) {
chNext = styler.SafeGetCharAt(i + 2);
chPrev = ' ';
i += 1;
continue;
}
if (state == SCE_C_DEFAULT) {
if (iswordstart(ch)) {
styler.ColourTo(i - 1, state);
state = SCE_C_WORD;
} else if (ch == '/' && chNext == '*') {
styler.ColourTo(i - 1, state);
state = SCE_C_COMMENT;
} else if (ch == '-' && chNext == '-') {
styler.ColourTo(i - 1, state);
state = SCE_C_COMMENTLINE;
} else if (ch == '\'') {
styler.ColourTo(i - 1, state);
state = SCE_C_STRING;
} else if (isoperator(ch)) {
styler.ColourTo(i - 1, state);
styler.ColourTo(i, SCE_C_OPERATOR);
}
} else if (state == SCE_C_WORD) {
if (!iswordchar(ch)) {
classifyWordSQL(styler.GetStartSegment(), i - 1, keywords, styler);
state = SCE_C_DEFAULT;
if (ch == '/' && chNext == '*') {
state = SCE_C_COMMENT;
} else if (ch == '-' && chNext == '-') {
state = SCE_C_COMMENTLINE;
} else if (ch == '\'') {
state = SCE_C_STRING;
} else if (isoperator(ch)) {
styler.ColourTo(i, SCE_C_OPERATOR);
}
}
} else {
if (state == SCE_C_COMMENT) {
if (ch == '/' && chPrev == '*') {
if (((i > (styler.GetStartSegment() + 2)) || ((initStyle == SCE_C_COMMENT) &&
(styler.GetStartSegment() == startPos)))) {
styler.ColourTo(i, state);
state = SCE_C_DEFAULT;
}
}
} else if (state == SCE_C_COMMENTLINE) {
if (ch == '\r' || ch == '\n') {
styler.ColourTo(i - 1, state);
state = SCE_C_DEFAULT;
}
} else if (state == SCE_C_STRING) {
if (ch == '\'') {
if ( chNext == '\'' ) {
i++;
} else {
styler.ColourTo(i, state);
state = SCE_C_DEFAULT;
i++;
}
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
}
}
if (state == SCE_C_DEFAULT) { // One of the above succeeded
if (ch == '/' && chNext == '*') {
state = SCE_C_COMMENT;
} else if (ch == '-' && chNext == '-') {
state = SCE_C_COMMENTLINE;
} else if (ch == '\'') {
state = SCE_C_STRING;
} else if (iswordstart(ch)) {
state = SCE_C_WORD;
} else if (isoperator(ch)) {
styler.ColourTo(i, SCE_C_OPERATOR);
}
}
}
chPrev = ch;
}
styler.ColourTo(lengthDoc - 1, state);
}
LexerModule lmSQL(SCLEX_SQL, ColouriseSQLDoc);

View File

@@ -1,139 +0,0 @@
// SciTE - Scintilla based Text Editor
// LexVB.cxx - lexer for Visual Basic and VBScript
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include "Platform.h"
#include "PropSet.h"
#include "Accessor.h"
#include "KeyWords.h"
#include "Scintilla.h"
#include "SciLexer.h"
static int classifyWordVB(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) {
char s[100];
bool wordIsNumber = isdigit(styler[start]) || (styler[start] == '.') ||
(styler[start] == '&' && tolower(styler[start+1]) == 'h');
unsigned int i;
for (i = 0; i < end - start + 1 && i < 30; i++) {
s[i] = static_cast<char>(tolower(styler[start + i]));
}
s[i] = '\0';
char chAttr = SCE_C_DEFAULT;
if (wordIsNumber)
chAttr = SCE_C_NUMBER;
else {
if (strcmp(s, "rem") == 0)
chAttr = SCE_C_COMMENTLINE;
else if (keywords.InList(s))
chAttr = SCE_C_WORD;
}
styler.ColourTo(end, chAttr);
if (chAttr == SCE_C_COMMENTLINE)
return SCE_C_COMMENTLINE;
else
return SCE_C_DEFAULT;
}
static void ColouriseVBDoc(unsigned int startPos, int length, int initStyle,
WordList *keywordlists[], Accessor &styler) {
WordList &keywords = *keywordlists[0];
styler.StartAt(startPos);
int visibleChars = 0;
int state = initStyle;
char chNext = styler[startPos];
styler.StartSegment(startPos);
int lengthDoc = startPos + length;
for (int i = startPos; i < lengthDoc; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
if (styler.IsLeadByte(ch)) {
chNext = styler.SafeGetCharAt(i + 2);
i += 1;
continue;
}
if (ch == '\r' || ch == '\n') {
// End of line
if (state == SCE_C_COMMENTLINE || state == SCE_C_PREPROCESSOR) {
styler.ColourTo(i - 1, state);
state = SCE_C_DEFAULT;
}
visibleChars = 0;
}
if (!isspace(ch))
visibleChars++;
if (state == SCE_C_DEFAULT) {
if (iswordstart(ch)) {
styler.ColourTo(i - 1, state);
state = SCE_C_WORD;
} else if (ch == '\'') {
styler.ColourTo(i - 1, state);
state = SCE_C_COMMENTLINE;
} else if (ch == '\"') {
styler.ColourTo(i - 1, state);
state = SCE_C_STRING;
} else if (ch == '#' && visibleChars == 1) {
// Preprocessor commands are alone on their line
styler.ColourTo(i - 1, state);
state = SCE_C_PREPROCESSOR;
} else if (ch == '&' && tolower(chNext) == 'h') {
styler.ColourTo(i - 1, state);
state = SCE_C_WORD;
} else if (isoperator(ch)) {
styler.ColourTo(i - 1, state);
styler.ColourTo(i, SCE_C_OPERATOR);
}
} else if (state == SCE_C_WORD) {
if (!iswordchar(ch)) {
state = classifyWordVB(styler.GetStartSegment(), i - 1, keywords, styler);
if (state == SCE_C_DEFAULT) {
if (ch == '\'') {
state = SCE_C_COMMENTLINE;
} else if (ch == '\"') {
state = SCE_C_STRING;
} else if (isoperator(ch)) {
styler.ColourTo(i - 1, state);
styler.ColourTo(i, SCE_C_OPERATOR);
}
}
}
} else {
if (state == SCE_C_STRING) {
// VB doubles quotes to preserve them
if (ch == '\"') {
styler.ColourTo(i, state);
state = SCE_C_DEFAULT;
i++;
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
}
}
if (state == SCE_C_DEFAULT) { // One of the above succeeded
if (ch == '\'') {
state = SCE_C_COMMENTLINE;
} else if (ch == '\"') {
state = SCE_C_STRING;
} else if (iswordstart(ch)) {
state = SCE_C_WORD;
}
}
}
}
styler.ColourTo(lengthDoc, state);
}
LexerModule lmVB(SCLEX_VB, ColouriseVBDoc);

View File

@@ -1,105 +0,0 @@
// Scintilla source code edit control
// LineMarker.cxx - defines the look of a line marker in the margin
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include "Platform.h"
#include "Scintilla.h"
#include "LineMarker.h"
void LineMarker::Draw(Surface *surface, PRectangle &rc) {
int minDim = Platform::Minimum(rc.Width(), rc.Height());
minDim--; // Ensure does not go beyond edge
int centreX = (rc.right + rc.left) / 2;
int centreY = (rc.bottom + rc.top) / 2;
int dimOn2 = minDim / 2;
int dimOn4 = minDim / 4;
if (rc.Width() > (rc.Height() * 2)) {
// Wide column is line number so move to left to try to avoid overlapping number
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);
} 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);
} else if (markType == SC_MARK_ARROW) {
Point pts[] = {
Point(centreX - dimOn4, centreY - dimOn2),
Point(centreX - dimOn4, centreY + dimOn2),
Point(centreX + dimOn2 - dimOn4, centreY),
};
surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
fore.allocated, back.allocated);
} else if (markType == SC_MARK_ARROWDOWN) {
Point pts[] = {
Point(centreX - dimOn2, centreY - dimOn4),
Point(centreX + dimOn2, centreY - dimOn4),
Point(centreX, centreY + dimOn2 - dimOn4),
};
surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
fore.allocated, back.allocated);
} else if (markType == SC_MARK_PLUS) {
int armSize = dimOn2-2;
Point pts[] = {
Point(centreX - armSize, centreY - 1),
Point(centreX - 1, centreY - 1),
Point(centreX - 1, centreY - armSize),
Point(centreX + 1, centreY - armSize),
Point(centreX + 1, centreY - 1),
Point(centreX + armSize, centreY -1),
Point(centreX + armSize, centreY +1),
Point(centreX + 1, centreY + 1),
Point(centreX + 1, centreY + armSize),
Point(centreX - 1, centreY + armSize),
Point(centreX - 1, centreY + 1),
Point(centreX - armSize, centreY + 1),
};
surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
fore.allocated, back.allocated);
} else if (markType == SC_MARK_MINUS) {
int armSize = dimOn2-2;
Point pts[] = {
Point(centreX - armSize, centreY - 1),
Point(centreX + armSize, centreY -1),
Point(centreX + armSize, centreY +1),
Point(centreX - armSize, centreY + 1),
};
surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
fore.allocated, back.allocated);
} else if (markType == SC_MARK_SMALLRECT) {
PRectangle rcSmall;
rcSmall.left = rc.left + 1;
rcSmall.top = rc.top + 2;
rcSmall.right = rc.right - 1;
rcSmall.bottom = rc.bottom - 2;
surface->RectangleDraw(rcSmall, fore.allocated, back.allocated);
} else if (markType == SC_MARK_EMPTY) {
// An invisible marker so don't draw anything
} else { // SC_MARK_SHORTARROW
Point pts[] = {
Point(centreX, centreY + dimOn2),
Point(centreX + dimOn2, centreY),
Point(centreX, centreY - dimOn2),
Point(centreX, centreY - dimOn4),
Point(centreX - dimOn4, centreY - dimOn4),
Point(centreX - dimOn4, centreY + dimOn4),
Point(centreX, centreY + dimOn4),
Point(centreX, centreY + dimOn2),
};
surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
fore.allocated, back.allocated);
}
}

View File

@@ -1,22 +0,0 @@
// Scintilla source code edit control
// LineMarker.h - defines the look of a line marker in the margin
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef LINEMARKER_H
#define LINEMARKER_H
class LineMarker {
public:
int markType;
ColourPair fore;
ColourPair back;
LineMarker() {
markType = SC_MARK_CIRCLE;
fore = Colour(0,0,0);
back = Colour(0xff,0xff,0xff);
}
void Draw(Surface *surface, PRectangle &rc);
};
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,742 +0,0 @@
// SciTE - Scintilla based Text Editor
// PropSet.cxx - a java style properties file module
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
// Maintain a dictionary of properties
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include "Platform.h"
#include "PropSet.h"
bool EqualCaseInsensitive(const char *a, const char *b) {
#if PLAT_GTK
return 0 == strcasecmp(a, b);
#elif PLAT_WIN
return 0 == stricmp(a, b);
#elif PLAT_WX
return 0 == wxStricmp(a, b);
#endif
}
SString::size_type SString::npos = -1;
inline unsigned int HashString(const char *s) {
unsigned int ret = 0;
while (*s) {
ret <<= 4;
ret ^= *s;
s++;
}
return ret;
}
// Get a line of input. If end of line escaped with '\\' then continue reading.
static bool GetFullLine(const char *&fpc, int &lenData, char *s, int len) {
bool continuation = true;
s[0] = '\0';
while ((len > 1) && lenData > 0) {
char ch = *fpc;
fpc++;
lenData--;
if ((ch == '\r') || (ch == '\n')) {
if (!continuation) {
if ((lenData > 0) && (ch == '\r') && ((*fpc) == '\n')) {
// munch the second half of a crlf
fpc++;
lenData--;
}
*s = '\0';
return true;
}
} else if ((ch == '\\') && (lenData > 0) && ((*fpc == '\r') || (*fpc == '\n'))) {
continuation = true;
} else {
continuation = false;
*s++ = ch;
*s = '\0';
len--;
}
}
return false;
}
PropSet::PropSet() {
superPS = 0;
for (int root=0; root < hashRoots; root++)
props[root] = 0;
}
PropSet::~PropSet() {
superPS = 0;
Clear();
}
void PropSet::Set(const char *key, const char *val) {
unsigned int hash = HashString(key);
for (Property *p=props[hash % hashRoots]; p; p=p->next) {
if ((hash == p->hash) && (0 == strcmp(p->key, key))) {
// Replace current value
delete [](p->val);
p->val = StringDup(val);
return;
}
}
// Not found
Property *pNew = new Property;
if (pNew) {
pNew->hash = HashString(key);
pNew->key = StringDup(key);
pNew->val = StringDup(val);
pNew->next = props[hash % hashRoots];
props[hash % hashRoots] = pNew;
}
}
void PropSet::Set(char *keyval) {
while (isspace(*keyval))
keyval++;
char *eqat = strchr(keyval, '=');
if (eqat) {
*eqat = '\0';
Set(keyval, eqat + 1);
*eqat = '=';
}
}
SString PropSet::Get(const char *key) {
unsigned int hash = HashString(key);
for (Property *p=props[hash % hashRoots]; p; p=p->next) {
if ((hash == p->hash) && (0 == strcmp(p->key, key))) {
return p->val;
}
}
if (superPS) {
// Failed here, so try in base property set
return superPS->Get(key);
} else {
return "";
}
}
SString PropSet::GetExpanded(const char *key) {
SString val = Get(key);
return Expand(val.c_str());
}
SString PropSet::Expand(const char *withvars) {
char *base = StringDup(withvars);
char *cpvar = strstr(base, "$(");
while (cpvar) {
char *cpendvar = strchr(cpvar, ')');
if (cpendvar) {
int lenvar = cpendvar - cpvar - 2; // Subtract the $()
char *var = StringDup(cpvar+2, lenvar);
SString val = GetExpanded(var);
int newlenbase = strlen(base) + val.length() - lenvar;
char *newbase = new char[newlenbase];
strncpy(newbase, base, cpvar - base);
strcpy(newbase + (cpvar - base), val.c_str());
strcpy(newbase + (cpvar - base) + val.length(), cpendvar + 1);
delete []var;
delete []base;
base = newbase;
}
cpvar = strstr(base, "$(");
}
SString sret = base;
delete []base;
return sret;
}
int PropSet::GetInt(const char *key, int defaultValue) {
SString val = Get(key);
if (val.length())
return val.value();
else
return defaultValue;
}
inline bool isprefix(const char *target, const char *prefix) {
while (*target && *prefix) {
if (*target != *prefix)
return false;
target++;
prefix++;
}
if (*prefix)
return false;
else
return true;
}
bool issuffix(const char *target, const char *suffix) {
int lentarget = strlen(target);
int lensuffix = strlen(suffix);
if (lensuffix > lentarget)
return false;
for (int i = lensuffix - 1; i >= 0; i--) {
if (target[i + lentarget - lensuffix] != suffix[i])
return false;
}
return true;
}
SString PropSet::GetWild(const char *keybase, const char *filename) {
for (int root=0; root < hashRoots; root++) {
for (Property *p=props[root]; p; p=p->next) {
if (isprefix(p->key, keybase)) {
char *orgkeyfile = p->key + strlen(keybase);
char *keyfile = NULL;
if (strstr(orgkeyfile, "$(") == orgkeyfile) {
char *cpendvar = strchr(orgkeyfile, ')');
if (cpendvar) {
*cpendvar = '\0';
SString s = Get(orgkeyfile + 2);
*cpendvar= ')';
keyfile = strdup(s.c_str());
}
}
char *keyptr = keyfile;
if (keyfile == NULL)
keyfile = orgkeyfile;
for (; ; ) {
char *del = strchr(keyfile, ';');
if (del == NULL)
del = keyfile + strlen(keyfile);
char delchr = *del;
*del = '\0';
if (*keyfile == '*') {
if (issuffix(filename, keyfile + 1)) {
*del = delchr;
free(keyptr);
return p->val;
}
} else if (0 == strcmp(keyfile, filename)) {
*del = delchr;
free(keyptr);
return p->val;
}
if (delchr == '\0')
break;
*del = delchr;
keyfile = del + 1;
}
free(keyptr);
if (0 == strcmp(p->key, keybase)) {
return p->val;
}
}
}
}
if (superPS) {
// Failed here, so try in base property set
return superPS->GetWild(keybase, filename);
} else {
return "";
}
}
SString PropSet::GetNewExpand(const char *keybase, const char *filename) {
char *base = StringDup(GetWild(keybase, filename).c_str());
char *cpvar = strstr(base, "$(");
while (cpvar) {
char *cpendvar = strchr(cpvar, ')');
if (cpendvar) {
int lenvar = cpendvar - cpvar - 2; // Subtract the $()
char *var = StringDup(cpvar+2, lenvar);
SString val = GetWild(var, filename);
int newlenbase = strlen(base) + val.length() - lenvar;
char *newbase = new char[newlenbase];
strncpy(newbase, base, cpvar - base);
strcpy(newbase + (cpvar - base), val.c_str());
strcpy(newbase + (cpvar - base) + val.length(), cpendvar + 1);
delete []var;
delete []base;
base = newbase;
}
cpvar = strstr(base, "$(");
}
SString sret = base;
delete []base;
return sret;
}
void PropSet::Clear() {
for (int root=0; root < hashRoots; root++) {
Property *p=props[root];
while (p) {
Property *pNext=p->next;
p->hash = 0;
delete p->key;
p->key = 0;
delete p->val;
p->val = 0;
delete p;
p = pNext;
}
props[root] = 0;
}
}
void PropSet::ReadFromMemory(const char *data, int len, const char *directoryForImports) {
const char *pd = data;
char linebuf[60000];
bool ifIsTrue = true;
while (len > 0) {
GetFullLine(pd, len, linebuf, sizeof(linebuf));
if (isalpha(linebuf[0])) // If clause ends with first non-indented line
ifIsTrue = true;
if (isprefix(linebuf, "if ")) {
const char *expr = linebuf + strlen("if") + 1;
ifIsTrue = GetInt(expr);
} else if (isprefix(linebuf, "import ") && directoryForImports) {
char importPath[1024];
strcpy(importPath, directoryForImports);
strcat(importPath, linebuf + strlen("import") + 1);
strcat(importPath, ".properties");
Read(importPath,directoryForImports);
} else if (isalpha(linebuf[0])) {
Set(linebuf);
} else if (isspace(linebuf[0]) && ifIsTrue) {
Set(linebuf);
}
}
}
void PropSet::Read(const char *filename, const char *directoryForImports) {
char propsData[60000];
FILE *rcfile = fopen(filename, "rb");
if (rcfile) {
int lenFile = fread(propsData, 1, sizeof(propsData), rcfile);
fclose(rcfile);
ReadFromMemory(propsData, lenFile, directoryForImports);
} else {
//printf("Could not open <%s>\n", filename);
}
}
static bool iswordsep(char ch, bool onlyLineEnds) {
if (!isspace(ch))
return false;
if (!onlyLineEnds)
return true;
return ch == '\r' || ch == '\n';
}
// Creates an array that points into each word in the string and puts \0 terminators
// after each word.
static char **ArrayFromWordList(char *wordlist, int *len, bool onlyLineEnds = false) {
#if 1
char prev = '\n';
int words = 0;
for (int j = 0; wordlist[j]; j++) {
if (!iswordsep(wordlist[j], onlyLineEnds) && iswordsep(prev, onlyLineEnds))
words++;
prev = wordlist[j];
}
char **keywords = new char * [words + 1];
if (keywords) {
words = 0;
prev = '\0';
int slen = strlen(wordlist);
for (int k = 0; k < slen; k++) {
if (!iswordsep(wordlist[k], onlyLineEnds)) {
if (!prev) {
keywords[words] = &wordlist[k];
words++;
}
} else {
wordlist[k] = '\0';
}
prev = wordlist[k];
}
keywords[words] = &wordlist[slen];
*len = words;
} else {
*len = 0;
}
#else
int words = 0; // length of the returned buffer of pointers
#undef APICHUNK // how many pointers will be pre-allocated (to avoid buffer reallocation on each new pointer)
#define APICHUNK 256
int size = APICHUNK; // real size of the returned buffer of pointers
char **keywords; // buffer for the pointers returned
int slen = strlen(wordlist); //length of the buffer with api file
keywords = (char**) malloc((size + 1) * sizeof (*keywords));
words = 0;
for (int k = 0;;) {
while (iswordsep(wordlist[k], onlyLineEnds))
wordlist[k++] = '\0';
if (k >= slen)
break;
if (words >= size) {
do
size += APICHUNK;
while (size <= words);
keywords = (char**) realloc(keywords, (size + 1) * sizeof (*keywords));
}
keywords[words++] = wordlist + k;
do
if (k < slen)
k++;
else
goto out;
while (!iswordsep(wordlist[k], onlyLineEnds));
}
out:
keywords[words] = wordlist + slen;
*len = words;
#endif
return keywords;
}
void WordList::Clear() {
if (words) {
delete []list;
#if 1
delete []words;
#else
free(words);
#endif
free(wordsNoCase);
}
words = 0;
wordsNoCase = 0;
list = 0;
len = 0;
sorted = false;
}
void WordList::Set(const char *s) {
list = StringDup(s);
sorted = false;
words = ArrayFromWordList(list, &len, onlyLineEnds);
wordsNoCase = (char**) malloc ((len + 1) * sizeof (*wordsNoCase));
memcpy(wordsNoCase, words, (len + 1) * sizeof (*words));
}
char *WordList::Allocate(int size) {
list = new char[size + 1];
list[size] = '\0';
return list;
}
void WordList::SetFromAllocated() {
sorted = false;
words = ArrayFromWordList(list, &len, onlyLineEnds);
wordsNoCase = (char**) malloc ((len + 1) * sizeof (*wordsNoCase));
memcpy(wordsNoCase, words, (len + 1) * sizeof (*words));
}
int cmpString(const void *a1, const void *a2) {
// Can't work out the correct incantation to use modern casts here
return strcmp(*(char**)(a1), *(char**)(a2));
}
int cmpStringNoCase(const void *a1, const void *a2) {
// Can't work out the correct incantation to use modern casts here
return strcasecmp(*(char**)(a1), *(char**)(a2));
}
static void SortWordList(char **words, char **wordsNoCase, unsigned int len) {
qsort(reinterpret_cast<void*>(words), len, sizeof(*words),
cmpString);
qsort(reinterpret_cast<void*>(wordsNoCase), len, sizeof(*wordsNoCase),
cmpStringNoCase);
}
bool WordList::InList(const char *s) {
if (0 == words)
return false;
if (!sorted) {
sorted = true;
SortWordList(words, wordsNoCase, len);
for (unsigned int k = 0; k < (sizeof(starts) / sizeof(starts[0])); k++)
starts[k] = -1;
for (int l = len - 1; l >= 0; l--) {
unsigned char indexChar = words[l][0];
starts[indexChar] = l;
}
}
unsigned char firstChar = s[0];
int j = starts[firstChar];
if (j >= 0) {
while (words[j][0] == firstChar) {
if (s[1] == words[j][1]) {
const char *a = words[j] + 1;
const char *b = s + 1;
while (*a && *a == *b) {
a++;
b++;
}
if (!*a && !*b)
return true;
}
j++;
}
}
return false;
}
/**
* Returns an element (complete) of the wordlist array which has the beginning
* the same as the passed string. The length of the word to compare is passed
* too. Letter case can be ignored or preserved (default).
*/
const char *WordList::GetNearestWord(const char *wordStart, int searchLen /*= -1*/, bool ignoreCase /*= false*/) {
int start = 0; // lower bound of the api array block to search
int end = len - 1; // upper bound of the api array block to search
int pivot; // index of api array element just being compared
int cond; // comparison result (in the sense of strcmp() result)
const char *word; // api array element just being compared
if (0 == words)
return NULL;
if (!sorted) {
sorted = true;
SortWordList(words, wordsNoCase, len);
}
if (ignoreCase)
while (start <= end) { // binary searching loop
pivot = (start + end) >> 1;
word = wordsNoCase[pivot];
cond = strncasecmp(wordStart, word, searchLen);
if (!cond && nonFuncChar(word[searchLen])) // maybe there should be a "non-word character" test here?
return word; // result must not be freed with free()
else if (cond < 0)
end = pivot - 1;
else if (cond > 0)
start = pivot + 1;
}
else // preserve the letter case
while (start <= end) { // binary searching loop
pivot = (start + end) >> 1;
word = words[pivot];
cond = strncmp(wordStart, word, searchLen);
if (!cond && nonFuncChar(word[searchLen])) // maybe there should be a "non-word character" test here?
return word; // result must not be freed with free()
else if (cond >= 0)
start = pivot + 1;
else if (cond < 0)
end = pivot - 1;
}
return NULL;
}
/**
* Returns elements (first words of them) of the wordlist array which have
* the beginning the same as the passed string. The length of the word to
* compare is passed too. Letter case can be ignored or preserved (default).
* If there are more words meeting the condition they are returned all of
* them in the ascending order separated with spaces.
*
* NOTE: returned buffer has to be freed with a free() call.
*/
char *WordList::GetNearestWords(const char *wordStart, int searchLen /*= -1*/, bool ignoreCase /*= false*/) {
int wordlen; // length of the word part (before the '(' brace) of the api array element
int length = 0; // length of the returned buffer of words (string)
int newlength; // length of the new buffer before the reallocating itself
#undef WORDCHUNK // how many characters will be pre-allocated (to avoid buffer reallocation on each new word)
#define WORDCHUNK 100
int size = WORDCHUNK; // real size of the returned buffer of words
char *buffer; // buffer for the words returned
int start = 0; // lower bound of the api array block to search
int end = len - 1; // upper bound of the api array block to search
int pivot; // index of api array element just being compared
int cond; // comparison result (in the sense of strcmp() result)
int oldpivot; // pivot storage to be able to browse the api array upwards and then downwards
const char *word; // api array element just being compared
const char *brace; // position of the opening brace in the api array element just being compared
if (0 == words)
return NULL;
if (!sorted) {
sorted = true;
SortWordList(words, wordsNoCase, len);
}
buffer = (char*) malloc(size);
*buffer = '\0';
if (ignoreCase)
while (start <= end) { // binary searching loop
pivot = (start + end) >> 1;
word = wordsNoCase[pivot];
cond = strncasecmp(wordStart, word, searchLen);
if (!cond) {
oldpivot = pivot;
do { // browse sequentially the rest after the hit
brace = strchr(word, '(');
if (brace)
do
if (--brace < word)
break;
while (isspace(*brace));
else {
brace = word + strlen(word);
do
if (--brace < word)
break;
while (isspace(*brace));
}
wordlen = brace - word + 1;
newlength = length + wordlen; // stretch the buffer
if (length)
newlength++;
if (newlength >= size) {
do
size += WORDCHUNK;
while (size <= newlength);
buffer = (char*) realloc(buffer, size);
}
if (length) // append a new entry
buffer[length++] = ' ';
memcpy(buffer + length, word, wordlen);
length = newlength;
buffer[length] = '\0';
if (++pivot > end)
break;
word = wordsNoCase[pivot];
} while (!strncasecmp(wordStart, word, searchLen));
pivot = oldpivot;
for (;;) { // browse sequentially the rest before the hit
if (--pivot < start)
break;
word = wordsNoCase[pivot];
if (strncasecmp(wordStart, word, searchLen))
break;
brace = strchr(word, '(');
if (brace)
do
if (--brace < word)
break;
while (isspace(*brace));
else {
brace = word + strlen(word);
do
if (--brace < word)
break;
while (isspace(*brace));
}
wordlen = brace - word + 1;
newlength = length + wordlen; // stretch the buffer
if (length)
newlength++;
if (newlength >= size)
{
do
size += WORDCHUNK;
while (size <= newlength);
buffer = (char*) realloc(buffer, size);
}
if (length) // append a new entry
buffer[length++] = ' ';
memcpy(buffer + length, word, wordlen);
length = newlength;
buffer[length] = '\0';
}
return buffer; // result has to be freed with free()
}
else if (cond < 0)
end = pivot - 1;
else if (cond > 0)
start = pivot + 1;
}
else // preserve the letter case
while (start <= end) { // binary searching loop
pivot = (start + end) >> 1;
word = words[pivot];
cond = strncmp(wordStart, word, searchLen);
if (!cond) {
oldpivot = pivot;
do { // browse sequentially the rest after the hit
brace = strchr(word, '(');
if (brace)
do
if (--brace < word)
break;
while (isspace(*brace));
else {
brace = word + strlen(word);
do
if (--brace < word)
break;
while (isspace(*brace));
}
wordlen = brace - word + 1;
newlength = length + wordlen; // stretch the buffer
if (length)
newlength++;
if (newlength >= size)
{
do
size += WORDCHUNK;
while (size <= newlength);
buffer = (char*) realloc(buffer, size);
}
if (length) // append a new entry
buffer[length++] = ' ';
memcpy(buffer + length, word, wordlen);
length = newlength;
buffer[length] = '\0';
if (++pivot > end)
break;
word = words[pivot];
} while (!strncmp(wordStart, word, searchLen));
pivot = oldpivot;
for (;;) { // browse sequentially the rest before the hit
if (--pivot < start)
break;
word = words[pivot];
if (strncmp(wordStart, word, searchLen))
break;
brace = strchr(word, '(');
if (brace)
do
if (--brace < word)
break;
while (isspace(*brace));
else {
brace = word + strlen(word);
do
if (--brace < word)
break;
while (isspace(*brace));
}
wordlen = brace - word + 1;
newlength = length + wordlen; // stretch the buffer
if (length)
newlength++;
if (newlength >= size)
{
do
size += WORDCHUNK;
while (size <= newlength);
buffer = (char*) realloc(buffer, size);
}
if (length) // append a new entry
buffer[length++] = ' ';
memcpy(buffer + length, word, wordlen);
length = newlength;
buffer[length] = '\0';
}
return buffer; // result has to be freed with free()
}
else if (cond < 0)
end = pivot - 1;
else if (cond > 0)
start = pivot + 1;
}
free(buffer);
return NULL;
}

View File

@@ -1,113 +0,0 @@
// Scintilla source code edit control
// SVector.h - a simple expandable vector
// Copyright 1998-1999 by Neil Hodgson <neilh@hare.net.au>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef SVECTOR_H
#define SVECTOR_H
// A simple expandable integer vector.
// Storage not allocated for elements until an element is used.
// This makes it very lightweight unless used so is a good match for optional features.
class SVector {
int *v;
unsigned int size; // Number of elements allocated
unsigned int len; // Number of elements in vector
bool allocFailure; // A memory allocation call has failed
// Internally allocate more elements than the user wants to avoid
// thrashng the memory allocator
void SizeTo(int newSize) {
if (newSize < 4000)
newSize += 4000;
else
newSize = (newSize * 3) / 2;
int* newv = new int[newSize];
if (!newv) {
allocFailure = true;
return;
}
size = newSize;
unsigned int i=0;
for (; i<len; i++) {
newv[i] = v[i];
}
for (; i<size; i++) {
newv[i] = 0;
}
delete []v;
v = newv;
}
public:
SVector() {
allocFailure = false;
v = 0;
len = 0;
size = 0;
}
~SVector() {
Free();
}
SVector(const SVector &other) {
allocFailure = false;
v = 0;
len = 0;
size = 0;
if (other.Length() > 0) {
SizeTo(other.Length());
if (!allocFailure) {
for (int i=0;i<other.Length();i++)
v[i] = other.v[i];
len = other.Length();
}
}
}
SVector &operator=(const SVector &other) {
if (this != &other) {
delete []v;
allocFailure = false;
v = 0;
len = 0;
size = 0;
if (other.Length() > 0) {
SizeTo(other.Length());
if (!allocFailure) {
for (int i=0;i<other.Length();i++)
v[i] = other.v[i];
}
len = other.Length();
}
}
return *this;
}
int &operator[](unsigned int i) {
if (i >= len) {
if (i >= size) {
SizeTo(i);
}
len = i+1;
}
return v[i];
}
void Free() {
delete []v;
v = 0;
size = 0;
len = 0;
}
void SetLength(unsigned int newLength) {
if (newLength > len) {
if (newLength >= size) {
SizeTo(newLength);
}
}
len = newLength;
}
int Length() const {
return len;
}
};
#endif

View File

@@ -1,499 +0,0 @@
// Scintilla source code edit control
// ScintillaBase.cxx - an enhanced subclass of Editor with calltips, autocomplete and context menu
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include "Platform.h"
#include "Scintilla.h"
#include "PropSet.h"
#ifdef SCI_LEXER
#include "SciLexer.h"
#include "Accessor.h"
#include "WindowAccessor.h"
#include "DocumentAccessor.h"
#include "KeyWords.h"
#endif
#include "ContractionState.h"
#include "SVector.h"
#include "CellBuffer.h"
#include "CallTip.h"
#include "KeyMap.h"
#include "Indicator.h"
#include "LineMarker.h"
#include "Style.h"
#include "ViewStyle.h"
#include "AutoComplete.h"
#include "Document.h"
#include "Editor.h"
#include "ScintillaBase.h"
ScintillaBase::ScintillaBase() {
#ifdef SCI_LEXER
lexLanguage = SCLEX_CONTAINER;
for (int wl=0;wl<numWordLists;wl++)
keyWordLists[wl] = new WordList;
#endif
}
ScintillaBase::~ScintillaBase() {
#ifdef SCI_LEXER
for (int wl=0;wl<numWordLists;wl++)
delete keyWordLists[wl];
#endif
}
void ScintillaBase::Finalise() {
Editor::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 acActiveBeforeCharAdded = ac.Active();
if (!acActiveBeforeCharAdded || !ac.IsFillUpChar(*s))
Editor::AddCharUTF(s, len);
if (acActiveBeforeCharAdded)
AutoCompleteChanged(s[0]);
}
void ScintillaBase::Command(int cmdId) {
switch (cmdId) {
case idAutoComplete: // Nothing to do
break;
case idCallTip: // Nothing to do
break;
case idcmdUndo:
WndProc(SCI_UNDO, 0, 0);
break;
case idcmdRedo:
WndProc(SCI_REDO, 0, 0);
break;
case idcmdCut:
WndProc(SCI_CUT, 0, 0);
break;
case idcmdCopy:
WndProc(SCI_COPY, 0, 0);
break;
case idcmdPaste:
WndProc(SCI_PASTE, 0, 0);
break;
case idcmdDelete:
WndProc(SCI_CLEAR, 0, 0);
break;
case idcmdSelectAll:
WndProc(SCI_SELECTALL, 0, 0);
break;
}
}
int ScintillaBase::KeyCommand(unsigned int iMessage) {
// Most key commands cancel autocompletion mode
if (ac.Active()) {
switch (iMessage) {
// Except for these
case SCI_LINEDOWN:
AutoCompleteMove(1);
return 0;
case SCI_LINEUP:
AutoCompleteMove( -1);
return 0;
case SCI_PAGEDOWN:
AutoCompleteMove(5);
return 0;
case SCI_PAGEUP:
AutoCompleteMove( -5);
return 0;
case SCI_VCHOME:
AutoCompleteMove( -5000);
return 0;
case SCI_LINEEND:
AutoCompleteMove(5000);
return 0;
case SCI_DELETEBACK:
DelCharBack();
AutoCompleteChanged();
EnsureCaretVisible();
return 0;
case SCI_TAB:
AutoCompleteCompleted();
return 0;
case SCI_NEWLINE:
AutoCompleteCompleted();
return 0;
default:
ac.Cancel();
}
}
if (ct.inCallTipMode) {
if (
(iMessage != SCI_CHARLEFT) &&
(iMessage != SCI_CHARLEFTEXTEND) &&
(iMessage != SCI_CHARRIGHT) &&
(iMessage != SCI_CHARLEFTEXTEND) &&
(iMessage != SCI_EDITTOGGLEOVERTYPE) &&
(iMessage != SCI_DELETEBACK)
) {
ct.CallTipCancel();
}
if (iMessage == SCI_DELETEBACK) {
if (currentPos <= ct.posStartCallTip) {
ct.CallTipCancel();
}
}
}
return Editor::KeyCommand(iMessage);
}
void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {
//Platform::DebugPrintf("AutoComplete %s\n", list);
ct.CallTipCancel();
if (ac.chooseSingle) {
if (list && !strchr(list, ac.GetSeparator())) {
if (ac.ignoreCase) {
SetEmptySelection(currentPos - lenEntered);
pdoc->DeleteChars(currentPos, lenEntered);
SetEmptySelection(currentPos);
pdoc->InsertString(currentPos, list);
SetEmptySelection(currentPos + strlen(list));
} else {
SetEmptySelection(currentPos);
pdoc->InsertString(currentPos, list + lenEntered);
SetEmptySelection(currentPos + strlen(list + lenEntered));
}
return;
}
}
ac.Start(wDraw, idAutoComplete, currentPos, lenEntered);
PRectangle rcClient = GetClientRectangle();
Point pt = LocationFromPosition(currentPos-lenEntered);
int heightLB = 100;
int widthLB = 100;
if (pt.x >= rcClient.right - widthLB) {
HorizontalScrollTo(xOffset + pt.x - rcClient.right + widthLB);
Redraw();
pt = LocationFromPosition(currentPos);
}
PRectangle rcac;
rcac.left = pt.x - 5;
if (pt.y >= rcClient.bottom - heightLB && // Wont fit below.
pt.y >= (rcClient.bottom + rcClient.top) / 2) { // and there is more room above.
rcac.top = pt.y - heightLB;
if (rcac.top < 0) {
heightLB += rcac.top;
rcac.top = 0;
}
} else {
rcac.top = pt.y + vs.lineHeight;
}
rcac.right = rcac.left + widthLB;
rcac.bottom = Platform::Minimum(rcac.top + heightLB, rcClient.bottom);
ac.lb.SetPositionRelative(rcac, wMain);
ac.lb.SetFont(vs.styles[STYLE_DEFAULT].font);
ac.lb.SetAverageCharWidth(vs.styles[STYLE_DEFAULT].aveCharWidth);
ac.SetList(list);
// Fiddle the position of the list so it is right next to the target and wide enough for all its strings
PRectangle rcList = ac.lb.GetDesiredRect();
int heightAlloced = rcList.bottom - rcList.top;
widthLB = Platform::Maximum(widthLB, rcList.right - rcList.left);
// Make an allowance for large strings in list
rcList.left = pt.x - 5;
rcList.right = rcList.left + widthLB;
if (pt.y >= rcClient.bottom - heightLB && // Wont fit below.
pt.y >= (rcClient.bottom + rcClient.top) / 2) { // and there is more room above.
rcList.top = pt.y - heightAlloced;
} else {
rcList.top = pt.y + vs.lineHeight;
}
rcList.bottom = rcList.top + heightAlloced;
ac.lb.SetPositionRelative(rcList, wMain);
ac.Show();
if (lenEntered != 0) {
AutoCompleteMoveToCurrentWord();
}
}
void ScintillaBase::AutoCompleteCancel() {
ac.Cancel();
}
void ScintillaBase::AutoCompleteMove(int delta) {
ac.Move(delta);
}
void ScintillaBase::AutoCompleteMoveToCurrentWord() {
char wordCurrent[1000];
int i;
int startWord = ac.posStart - ac.startLen;
for (i = startWord; i < currentPos; i++)
wordCurrent[i - startWord] = pdoc->CharAt(i);
wordCurrent[i - startWord] = '\0';
ac.Select(wordCurrent);
}
void ScintillaBase::AutoCompleteChanged(char ch) {
if (ac.IsFillUpChar(ch)) {
AutoCompleteCompleted(ch);
} else if (currentPos <= ac.posStart - ac.startLen) {
ac.Cancel();
} else if (ac.cancelAtStartPos && currentPos <= ac.posStart) {
ac.Cancel();
} else if (ac.IsStopChar(ch)) {
ac.Cancel();
} else {
AutoCompleteMoveToCurrentWord();
}
}
void ScintillaBase::AutoCompleteCompleted(char fillUp/*='\0'*/) {
int item = ac.lb.GetSelection();
char selected[1000];
if (item != -1) {
ac.lb.GetValue(item, selected, sizeof(selected));
}
ac.Cancel();
if (ac.ignoreCase) {
if (currentPos != ac.posStart) {
pdoc->DeleteChars(ac.posStart, currentPos - ac.posStart);
}
SetEmptySelection(ac.posStart - ac.startLen);
pdoc->DeleteChars(ac.posStart - ac.startLen, ac.startLen);
if (item != -1) {
SString piece = selected;
if (fillUp)
piece += fillUp;
pdoc->InsertString(currentPos, piece.c_str());
SetEmptySelection(currentPos + piece.length());
}
} else {
if (currentPos != ac.posStart) {
pdoc->DeleteChars(ac.posStart, currentPos - ac.posStart);
}
SetEmptySelection(ac.posStart);
if (item != -1) {
SString piece = selected + ac.startLen;
if (fillUp)
piece += fillUp;
pdoc->InsertString(currentPos, piece.c_str());
SetEmptySelection(currentPos + piece.length());
}
}
}
void ScintillaBase::ContextMenu(Point pt) {
popup.CreatePopUp();
AddToPopUp("Undo", idcmdUndo, pdoc->CanUndo());
AddToPopUp("Redo", idcmdRedo, pdoc->CanRedo());
AddToPopUp("");
AddToPopUp("Cut", idcmdCut, currentPos != anchor);
AddToPopUp("Copy", idcmdCopy, currentPos != anchor);
AddToPopUp("Paste", idcmdPaste, WndProc(SCI_CANPASTE, 0, 0));
AddToPopUp("Delete", idcmdDelete, currentPos != anchor);
AddToPopUp("");
AddToPopUp("Select All", idcmdSelectAll);
popup.Show(pt, wMain);
}
void ScintillaBase::CancelModes() {
AutoCompleteCancel();
ct.CallTipCancel();
Editor::CancelModes();
}
void ScintillaBase::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt) {
CancelModes();
Editor::ButtonDown(pt, curTime, shift, ctrl, alt);
}
#ifdef SCI_LEXER
void ScintillaBase::Colourise(int start, int end) {
int lengthDoc = Platform::SendScintilla(wMain.GetID(), SCI_GETLENGTH, 0, 0);
if (end == -1)
end = lengthDoc;
int len = end - start;
//WindowAccessor styler(wMain.GetID(), props);
DocumentAccessor styler(pdoc, props);
int styleStart = 0;
if (start > 0)
styleStart = styler.StyleAt(start - 1);
styler.SetCodePage(pdoc->dbcsCodePage);
LexerModule::Colourise(start, len, styleStart, lexLanguage, keyWordLists, styler);
styler.Flush();
}
#endif
void ScintillaBase::NotifyStyleToNeeded(int endStyleNeeded) {
#ifdef SCI_LEXER
if (lexLanguage != SCLEX_CONTAINER) {
int endStyled = Platform::SendScintilla(wMain.GetID(), SCI_GETENDSTYLED, 0, 0);
int lineEndStyled = Platform::SendScintilla(wMain.GetID(), SCI_LINEFROMPOSITION, endStyled, 0);
endStyled = Platform::SendScintilla(wMain.GetID(), SCI_POSITIONFROMLINE, lineEndStyled, 0);
Colourise(endStyled, endStyleNeeded);
return;
}
#endif
Editor::NotifyStyleToNeeded(endStyleNeeded);
}
long ScintillaBase::WndProc(unsigned int iMessage, unsigned long wParam, long lParam) {
switch (iMessage) {
case SCI_AUTOCSHOW:
AutoCompleteStart(wParam, reinterpret_cast<const char *>(lParam));
break;
case SCI_AUTOCCANCEL:
AutoCompleteCancel();
break;
case SCI_AUTOCACTIVE:
return ac.Active();
case SCI_AUTOCPOSSTART:
return ac.posStart;
case SCI_AUTOCCOMPLETE:
AutoCompleteCompleted();
break;
case SCI_AUTOCSETSEPARATOR:
ac.SetSeparator(static_cast<char>(wParam));
break;
case SCI_AUTOCGETSEPARATOR:
return ac.GetSeparator();
case SCI_AUTOCSTOPS:
ac.SetStopChars(reinterpret_cast<char *>(lParam));
break;
case SCI_AUTOCSELECT:
ac.Select(reinterpret_cast<char *>(lParam));
break;
case SCI_AUTOCSETCANCELATSTART:
ac.cancelAtStartPos = wParam;
break;
case SCI_AUTOCGETCANCELATSTART:
return ac.cancelAtStartPos;
case SCI_AUTOCSETFILLUPS:
ac.SetFillUpChars(reinterpret_cast<char *>(lParam));
break;
case SCI_AUTOCSETCHOOSESINGLE:
ac.chooseSingle = wParam;
break;
case SCI_AUTOCGETCHOOSESINGLE:
return ac.chooseSingle;
case SCI_AUTOCSETIGNORECASE:
ac.ignoreCase = wParam;
break;
case SCI_AUTOCGETIGNORECASE:
return ac.ignoreCase;
case SCI_CALLTIPSHOW: {
AutoCompleteCancel();
if (!ct.wCallTip.Created()) {
PRectangle rc = ct.CallTipStart(currentPos, LocationFromPosition(wParam),
reinterpret_cast<char *>(lParam),
vs.styles[STYLE_DEFAULT].fontName, vs.styles[STYLE_DEFAULT].size);
// If the call-tip window would be out of the client
// space, adjust so it displays above the text.
PRectangle rcClient = GetClientRectangle();
if (rc.bottom > rcClient.bottom) {
int offset = vs.lineHeight + rc.Height();
rc.top -= offset;
rc.bottom -= offset;
}
// Now display the window.
CreateCallTipWindow(rc);
ct.wCallTip.SetPositionRelative(rc, wDraw);
ct.wCallTip.Show();
}
}
break;
case SCI_CALLTIPCANCEL:
ct.CallTipCancel();
break;
case SCI_CALLTIPACTIVE:
return ct.inCallTipMode;
case SCI_CALLTIPPOSSTART:
return ct.posStartCallTip;
case SCI_CALLTIPSETHLT:
ct.SetHighlight(wParam, lParam);
break;
case SCI_CALLTIPSETBACK:
ct.colourBG = Colour(wParam);
InvalidateStyleRedraw();
break;
#ifdef SCI_LEXER
case SCI_SETLEXER:
lexLanguage = wParam;
break;
case SCI_GETLEXER:
return lexLanguage;
case SCI_COLOURISE:
Colourise(wParam, lParam);
Redraw();
break;
case SCI_SETPROPERTY:
props.Set(reinterpret_cast<const char *>(wParam),
reinterpret_cast<const char *>(lParam));
break;
case SCI_SETKEYWORDS:
if (wParam < numWordLists) {
keyWordLists[wParam]->Clear();
keyWordLists[wParam]->Set(reinterpret_cast<const char *>(lParam));
}
break;
#endif
default:
return Editor::WndProc(iMessage, wParam, lParam);
}
return 0l;
}

View File

@@ -1,73 +0,0 @@
// Scintilla source code edit control
// ScintillaBase.h - defines an enhanced subclass of Editor with calltips, autocomplete and context menu
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef SCINTILLABASE_H
#define SCINTILLABASE_H
class ScintillaBase : public Editor {
// Private so ScintillaBase objects can not be copied
ScintillaBase(const ScintillaBase &) : Editor() {}
ScintillaBase &operator=(const ScintillaBase &) { return *this; }
protected:
// Enumeration of commands and child windows
enum {
idCallTip=1,
idAutoComplete=2,
idcmdUndo=10,
idcmdRedo=11,
idcmdCut=12,
idcmdCopy=13,
idcmdPaste=14,
idcmdDelete=15,
idcmdSelectAll=16
};
Menu popup;
AutoComplete ac;
CallTip ct;
#ifdef SCI_LEXER
int lexLanguage;
PropSet props;
enum {numWordLists=5};
WordList *keyWordLists[numWordLists];
void Colourise(int start, int end);
#endif
ScintillaBase();
virtual ~ScintillaBase();
virtual void Initialise() = 0;
virtual void Finalise() = 0;
virtual void RefreshColourPalette(Palette &pal, bool want);
virtual void AddCharUTF(char *s, unsigned int len);
void Command(int cmdId);
virtual void CancelModes();
virtual int KeyCommand(unsigned int iMessage);
void AutoCompleteStart(int lenEntered, const char *list);
void AutoCompleteCancel();
void AutoCompleteMove(int delta);
void AutoCompleteChanged(char ch=0);
void AutoCompleteCompleted(char fillUp='\0');
void AutoCompleteMoveToCurrentWord();
virtual void CreateCallTipWindow(PRectangle rc) = 0;
virtual void AddToPopUp(const char *label, int cmd=0, bool enabled=true) = 0;
void ContextMenu(Point pt);
virtual void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt);
virtual void NotifyStyleToNeeded(int endStyleNeeded);
public:
// Public so scintilla_send_message can use it
virtual long WndProc(unsigned int iMessage, unsigned long wParam, long lParam);
};
#endif

View File

@@ -1,125 +0,0 @@
// Scintilla source code edit control
// Style.cxx - defines the font and colour style for a class of text
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <string.h>
#include "Platform.h"
#include "Scintilla.h"
#include "Style.h"
Style::Style() {
aliasOfDefaultFont = true;
Clear(Colour(0,0,0), Colour(0xff,0xff,0xff),
Platform::DefaultFontSize(), 0, SC_CHARSET_DEFAULT,
false, false, false, false, true);
}
Style::Style(const Style &source) {
Clear(Colour(0,0,0), Colour(0xff,0xff,0xff),
0, 0, 0,
false, false, false, false, true);
fore.desired = source.fore.desired;
back.desired = source.back.desired;
characterSet = source.characterSet;
bold = source.bold;
italic = source.italic;
size = source.size;
eolFilled = source.eolFilled;
underline = source.underline;
visible = source.visible;
}
Style::~Style() {
if (aliasOfDefaultFont)
font.SetID(0);
else
font.Release();
aliasOfDefaultFont = false;
}
Style &Style::operator=(const Style &source) {
if (this == &source)
return *this;
Clear(Colour(0,0,0), Colour(0xff,0xff,0xff),
0, 0, SC_CHARSET_DEFAULT,
false, false, false, false, true);
fore.desired = source.fore.desired;
back.desired = source.back.desired;
characterSet = source.characterSet;
bold = source.bold;
italic = source.italic;
size = source.size;
eolFilled = source.eolFilled;
underline = source.underline;
visible = source.visible;
return *this;
}
void Style::Clear(Colour fore_, Colour back_, int size_,
const char *fontName_, int characterSet_,
bool bold_, bool italic_, bool eolFilled_, bool underline_, bool visible_) {
fore.desired = fore_;
back.desired = back_;
characterSet = characterSet_;
bold = bold_;
italic = italic_;
size = size_;
fontName = fontName_;
eolFilled = eolFilled_;
underline = underline_;
visible = visible_;
if (aliasOfDefaultFont)
font.SetID(0);
else
font.Release();
aliasOfDefaultFont = false;
}
bool Style::EquivalentFontTo(const Style *other) const {
if (bold != other->bold ||
italic != other->italic ||
size != other->size ||
characterSet != other->characterSet)
return false;
if (fontName == other->fontName)
return true;
if (!fontName)
return false;
if (!other->fontName)
return false;
return strcmp(fontName, other->fontName) == 0;
}
void Style::Realise(Surface &surface, int zoomLevel, Style *defaultStyle) {
int sizeZoomed = size + zoomLevel;
if (sizeZoomed <= 2) // Hangs if sizeZoomed <= 1
sizeZoomed = 2;
if (aliasOfDefaultFont)
font.SetID(0);
else
font.Release();
int deviceHeight = surface.DeviceHeightFont(sizeZoomed);
aliasOfDefaultFont = defaultStyle &&
(EquivalentFontTo(defaultStyle) || !fontName);
if (aliasOfDefaultFont) {
font.SetID(defaultStyle->font.GetID());
} else if (fontName) {
font.Create(fontName, characterSet, deviceHeight, bold, italic);
} else {
font.SetID(0);
}
ascent = surface.Ascent(font);
descent = surface.Descent(font);
// Probably more typographically correct to include leading
// but that means more complex drawing as leading must be erased
//lineHeight = surface.ExternalLeading() + surface.Height();
externalLeading = surface.ExternalLeading(font);
lineHeight = surface.Height(font);
aveCharWidth = surface.AverageCharWidth(font);
spaceWidth = surface.WidthChar(font, ' ');
}

View File

@@ -1,43 +0,0 @@
// Scintilla source code edit control
// Style.h - defines the font and colour style for a class of text
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef STYLE_H
#define STYLE_H
class Style {
public:
ColourPair fore;
ColourPair back;
bool aliasOfDefaultFont;
bool bold;
bool italic;
int size;
const char *fontName;
int characterSet;
bool eolFilled;
bool underline;
bool visible;
Font font;
unsigned int lineHeight;
unsigned int ascent;
unsigned int descent;
unsigned int externalLeading;
unsigned int aveCharWidth;
unsigned int spaceWidth;
Style();
Style(const Style &source);
~Style();
Style &operator=(const Style &source);
void Clear(Colour fore_, Colour back_,
int size_,
const char *fontName_, int characterSet_,
bool bold_, bool italic_, bool eolFilled_, bool underline_, bool visible_);
bool EquivalentFontTo(const Style *other) const;
void Realise(Surface &surface, int zoomLevel, Style *defaultStyle=0);
};
#endif

View File

@@ -1,77 +0,0 @@
// UniConversion.h - functions to handle UFT-8 and UCS-2 strings
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include "UniConversion.h"
unsigned int UTF8Length(const wchar_t *uptr, unsigned int tlen) {
unsigned int len = 0;
for (unsigned int i = 0; i < tlen && uptr[i]; i++) {
unsigned int uch = uptr[i];
if (uch < 0x80)
len++;
else if (uch < 0x800)
len+=2;
else
len +=3;
}
return len;
}
void UTF8FromUCS2(const wchar_t *uptr, unsigned int tlen, char *putf, unsigned int len) {
int k = 0;
for (unsigned int i = 0; i < tlen && uptr[i]; i++) {
unsigned int uch = uptr[i];
if (uch < 0x80) {
putf[k++] = static_cast<char>(uch);
} else if (uch < 0x800) {
putf[k++] = static_cast<char>(0xC0 | (uch >> 6));
putf[k++] = static_cast<char>(0x80 | (uch & 0x3f));
} else {
putf[k++] = static_cast<char>(0xE0 | (uch >> 12));
putf[k++] = static_cast<char>(0x80 | ((uch >> 6) & 0x3f));
putf[k++] = static_cast<char>(0x80 | (uch & 0x3f));
}
}
putf[len] = '\0';
}
unsigned int UCS2Length(const char *s, unsigned int len) {
unsigned int ulen = 0;
for (unsigned int i=0;i<len;i++) {
unsigned char ch = static_cast<unsigned char>(s[i]);
if ((ch < 0x80) || (ch > (0x80 + 0x40)))
ulen++;
}
return ulen;
}
unsigned int UCS2FromUTF8(const char *s, unsigned int len, wchar_t *tbuf, unsigned int tlen) {
#ifdef USE_API
return ::MultiByteToWideChar(CP_UTF8, 0, s, len, tbuf, tlen);
#else
unsigned int ui=0;
const unsigned char *us = reinterpret_cast<const unsigned char *>(s);
unsigned int i=0;
while ((i<len) && (ui<tlen)) {
unsigned char ch = us[i++];
if (ch < 0x80) {
tbuf[ui] = ch;
} else if (ch < 0x80 + 0x40 + 0x20) {
tbuf[ui] = static_cast<wchar_t>((ch & 0x1F) << 6);
ch = us[i++];
tbuf[ui] = static_cast<wchar_t>(tbuf[ui] + (ch & 0x7F));
} else {
tbuf[ui] = static_cast<wchar_t>((ch & 0xF) << 12);
ch = us[i++];
tbuf[ui] = static_cast<wchar_t>(tbuf[ui] + ((ch & 0x7F) << 6));
ch = us[i++];
tbuf[ui] = static_cast<wchar_t>(tbuf[ui] + (ch & 0x7F));
}
ui++;
}
return ui;
#endif
}

View File

@@ -1,9 +0,0 @@
// UniConversion.h - functions to handle UFT-8 and UCS-2 strings
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
unsigned int UTF8Length(const wchar_t *uptr, unsigned int tlen);
void UTF8FromUCS2(const wchar_t *uptr, unsigned int tlen, char *putf, unsigned int len);
unsigned int UCS2Length(const char *s, unsigned int len);
unsigned int UCS2FromUTF8(const char *s, unsigned int len, wchar_t *tbuf, unsigned int tlen);

View File

@@ -1,238 +0,0 @@
// Scintilla source code edit control
// ViewStyle.cxx - store information on how the document is to be viewed
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <string.h>
#include "Platform.h"
#include "Scintilla.h"
#include "Indicator.h"
#include "LineMarker.h"
#include "Style.h"
#include "ViewStyle.h"
MarginStyle::MarginStyle() :
symbol(false), width(16), mask(0xffffffff), sensitive(false) {
}
// A list of the fontnames - avoids wasting space in each style
FontNames::FontNames() {
max = 0;
}
FontNames::~FontNames() {
Clear();
}
void FontNames::Clear() {
for (int i=0;i<max;i++) {
delete []names[i];
}
max = 0;
}
const char *FontNames::Save(const char *name) {
if (!name)
return 0;
for (int i=0;i<max;i++) {
if (strcmp(names[i], name) == 0) {
return names[i];
}
}
names[max] = new char[strlen(name) + 1];
strcpy(names[max], name);
max++;
return names[max-1];
}
ViewStyle::ViewStyle() {
Init();
}
ViewStyle::ViewStyle(const ViewStyle &source) {
Init();
for (unsigned int sty=0;sty<(sizeof(styles)/sizeof(styles[0]));sty++) {
styles[sty] = source.styles[sty];
// Can't just copy fontname as its lifetime is relative to its owning ViewStyle
styles[sty].fontName = fontNames.Save(source.styles[sty].fontName);
}
for (int mrk=0;mrk<=MARKER_MAX;mrk++) {
markers[mrk] = source.markers[mrk];
}
for (int ind=0;ind<=INDIC_MAX;ind++) {
indicators[ind] = source.indicators[ind];
}
selforeset = source.selforeset;
selforeground.desired = source.selforeground.desired;
selbackset = source.selbackset;
selbackground.desired = source.selbackground.desired;
selbackground2.desired = source.selbackground2.desired;
selbar.desired = source.selbar.desired;
selbarlight.desired = source.selbarlight.desired;
caretcolour.desired = source.caretcolour.desired;
edgecolour.desired = source.edgecolour.desired;
edgeState = source.edgeState;
leftMarginWidth = source.leftMarginWidth;
rightMarginWidth = source.rightMarginWidth;
for (int i=0;i < margins; i++) {
ms[i] = source.ms[i];
}
symbolMargin = source.symbolMargin;
maskInLine = source.maskInLine;
fixedColumnWidth = source.fixedColumnWidth;
zoomLevel = source.zoomLevel;
viewWhitespace = source.viewWhitespace;
viewIndentationGuides = source.viewIndentationGuides;
viewEOL = source.viewEOL;
showMarkedLines = source.showMarkedLines;
}
ViewStyle::~ViewStyle() {
}
void ViewStyle::Init() {
fontNames.Clear();
ResetDefaultStyle();
indicators[0].style = INDIC_SQUIGGLE;
indicators[0].fore = Colour(0, 0x7f, 0);
indicators[1].style = INDIC_TT;
indicators[1].fore = Colour(0, 0, 0xff);
indicators[2].style = INDIC_PLAIN;
indicators[2].fore = Colour(0xff, 0, 0);
lineHeight = 1;
maxAscent = 1;
maxDescent = 1;
aveCharWidth = 8;
spaceWidth = 8;
selforeset = false;
selforeground.desired = Colour(0xff, 0, 0);
selbackset = true;
selbackground.desired = Colour(0xc0, 0xc0, 0xc0);
selbackground2.desired = Colour(0xb0, 0xb0, 0xb0);
selbar.desired = Platform::Chrome();
selbarlight.desired = Platform::ChromeHighlight();
styles[STYLE_LINENUMBER].fore.desired = Colour(0, 0, 0);
styles[STYLE_LINENUMBER].back.desired = Platform::Chrome();
//caretcolour.desired = Colour(0xff, 0, 0);
caretcolour.desired = Colour(0, 0, 0);
edgecolour.desired = Colour(0xc0, 0xc0, 0xc0);
edgeState = EDGE_NONE;
leftMarginWidth = 1;
rightMarginWidth = 1;
ms[0].symbol = false;
ms[0].width = 0;
ms[0].mask = 0;
ms[1].symbol = true;
ms[1].width = 16;
ms[1].mask = ~SC_MASK_FOLDERS;
ms[2].symbol = true;
ms[2].width = 14; // Nice width for arrows
ms[2].mask = SC_MASK_FOLDERS;
ms[2].width = 0; // Nice width for arrows
ms[2].mask = 0;
fixedColumnWidth = leftMarginWidth;
symbolMargin = false;
maskInLine = 0xffffffff;
for (int margin=0; margin < margins; margin++) {
fixedColumnWidth += ms[margin].width;
symbolMargin = symbolMargin || ms[margin].symbol;
if (ms[margin].width > 0)
maskInLine &= ~ms[margin].mask;
}
zoomLevel = 0;
viewWhitespace = wsInvisible;
viewIndentationGuides = false;
viewEOL = false;
showMarkedLines = true;
}
void ViewStyle::RefreshColourPalette(Palette &pal, bool want) {
unsigned int i;
for (i=0;i<(sizeof(styles)/sizeof(styles[0]));i++) {
pal.WantFind(styles[i].fore, want);
pal.WantFind(styles[i].back, want);
}
for (i=0;i<(sizeof(indicators)/sizeof(indicators[0]));i++) {
pal.WantFind(indicators[i].fore, want);
}
for (i=0;i<(sizeof(markers)/sizeof(markers[0]));i++) {
pal.WantFind(markers[i].fore, want);
pal.WantFind(markers[i].back, want);
}
pal.WantFind(selforeground, want);
pal.WantFind(selbackground, want);
pal.WantFind(selbackground2, want);
pal.WantFind(selbar, want);
pal.WantFind(selbarlight, want);
pal.WantFind(caretcolour, want);
pal.WantFind(edgecolour, want);
}
void ViewStyle::Refresh(Surface &surface) {
selbar.desired = Platform::Chrome();
selbarlight.desired = Platform::ChromeHighlight();
styles[STYLE_DEFAULT].Realise(surface, zoomLevel);
maxAscent = styles[STYLE_DEFAULT].ascent;
maxDescent = styles[STYLE_DEFAULT].descent;
for (unsigned int i=0;i<(sizeof(styles)/sizeof(styles[0]));i++) {
if (i != STYLE_DEFAULT) {
styles[i].Realise(surface, zoomLevel, &styles[STYLE_DEFAULT]);
if (maxAscent < styles[i].ascent)
maxAscent = styles[i].ascent;
if (maxDescent < styles[i].descent)
maxDescent = styles[i].descent;
}
}
lineHeight = maxAscent + maxDescent;
aveCharWidth = styles[STYLE_DEFAULT].aveCharWidth;
spaceWidth = styles[STYLE_DEFAULT].spaceWidth;
fixedColumnWidth = leftMarginWidth;
symbolMargin = false;
maskInLine = 0xffffffff;
for (int margin=0; margin < margins; margin++) {
fixedColumnWidth += ms[margin].width;
symbolMargin = symbolMargin || ms[margin].symbol;
if (ms[margin].width > 0)
maskInLine &= ~ms[margin].mask;
}
}
void ViewStyle::ResetDefaultStyle() {
styles[STYLE_DEFAULT].Clear(Colour(0,0,0), Colour(0xff,0xff,0xff),
Platform::DefaultFontSize(), fontNames.Save(Platform::DefaultFont()),
SC_CHARSET_DEFAULT,
false, false, false, false, true);
}
void ViewStyle::ClearStyles() {
// Reset all styles to be like the default style
for (unsigned int i=0;i<(sizeof(styles)/sizeof(styles[0]));i++) {
if (i != STYLE_DEFAULT) {
styles[i].Clear(
styles[STYLE_DEFAULT].fore.desired,
styles[STYLE_DEFAULT].back.desired,
styles[STYLE_DEFAULT].size,
styles[STYLE_DEFAULT].fontName,
styles[STYLE_DEFAULT].characterSet,
styles[STYLE_DEFAULT].bold,
styles[STYLE_DEFAULT].italic,
styles[STYLE_DEFAULT].eolFilled,
styles[STYLE_DEFAULT].underline,
styles[STYLE_DEFAULT].visible);
}
}
styles[STYLE_LINENUMBER].back.desired = Platform::Chrome();
}
void ViewStyle::SetStyleFontName(int styleIndex, const char *name) {
styles[styleIndex].fontName = fontNames.Save(name);
}

View File

@@ -1,76 +0,0 @@
// Scintilla source code edit control
// ViewStyle.h - store information on how the document is to be viewed
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef VIEWSTYLE_H
#define VIEWSTYLE_H
class MarginStyle {
public:
bool symbol;
int width;
int mask;
bool sensitive;
MarginStyle();
};
class FontNames {
private:
char *names[STYLE_MAX + 1];
int max;
public:
FontNames();
~FontNames();
void Clear();
const char *Save(const char *name);
};
enum WhiteSpaceVisibility {wsInvisible=0, wsVisibleAlways=1, wsVisibleAfterIndent=2};
class ViewStyle {
public:
FontNames fontNames;
Style styles[STYLE_MAX + 1];
LineMarker markers[MARKER_MAX + 1];
Indicator indicators[INDIC_MAX + 1];
int lineHeight;
unsigned int maxAscent;
unsigned int maxDescent;
unsigned int aveCharWidth;
unsigned int spaceWidth;
bool selforeset;
ColourPair selforeground;
bool selbackset;
ColourPair selbackground;
ColourPair selbackground2;
ColourPair selbar;
ColourPair selbarlight;
// Margins are ordered: Line Numbers, Selection Margin, Spacing Margin
int leftMarginWidth; // Spacing margin on left of text
int rightMarginWidth; // Spacing margin on left of text
enum { margins=3 };
bool symbolMargin;
int maskInLine; // Mask for markers to be put into text because there is nowhere for them to go in margin
MarginStyle ms[margins];
int fixedColumnWidth;
int zoomLevel;
WhiteSpaceVisibility viewWhitespace;
bool viewIndentationGuides;
bool viewEOL;
bool showMarkedLines;
ColourPair caretcolour;
ColourPair edgecolour;
int edgeState;
ViewStyle();
ViewStyle(const ViewStyle &source);
~ViewStyle();
void Init();
void RefreshColourPalette(Palette &pal, bool want);
void Refresh(Surface &surface);
void ResetDefaultStyle();
void ClearStyles();
void SetStyleFontName(int styleIndex, const char *name);
};
#endif

View File

@@ -1,175 +0,0 @@
// SciTE - Scintilla based Text Editor
// Accessor.cxx - rapid easy access to contents of a Scintilla
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include "Platform.h"
#include "PropSet.h"
#include "Accessor.h"
#include "WindowAccessor.h"
#include "Scintilla.h"
WindowAccessor::~WindowAccessor() {
}
#if PLAT_WIN
bool WindowAccessor::InternalIsLeadByte(char ch) {
if (SC_CP_UTF8 == codePage)
// For lexing, all characters >= 0x80 are treated the
// same so none is considered a lead byte.
return false;
else
return IsDBCSLeadByteEx(codePage, ch);
}
#else
// PLAT_GTK or PLAT_WX
// TODO: support DBCS under GTK+ and WX
bool WindowAccessor::InternalIsLeadByte(char) {
return false;
}
#endif
void WindowAccessor::Fill(int position) {
if (lenDoc == -1)
lenDoc = Platform::SendScintilla(id, SCI_GETTEXTLENGTH, 0, 0);
startPos = position - slopSize;
if (startPos + bufferSize > lenDoc)
startPos = lenDoc - bufferSize;
if (startPos < 0)
startPos = 0;
endPos = startPos + bufferSize;
if (endPos > lenDoc)
endPos = lenDoc;
TextRange tr = {{startPos, endPos}, buf};
Platform::SendScintilla(id, SCI_GETTEXTRANGE, 0, reinterpret_cast<long>(&tr));
}
char WindowAccessor::StyleAt(int position) {
return static_cast<char>(Platform::SendScintilla(
id, SCI_GETSTYLEAT, position, 0));
}
int WindowAccessor::GetLine(int position) {
return Platform::SendScintilla(id, SCI_LINEFROMPOSITION, position, 0);
}
int WindowAccessor::LineStart(int line) {
return Platform::SendScintilla(id, SCI_POSITIONFROMLINE, line, 0);
}
int WindowAccessor::LevelAt(int line) {
return Platform::SendScintilla(id, SCI_GETFOLDLEVEL, line, 0);
}
int WindowAccessor::Length() {
if (lenDoc == -1)
lenDoc = Platform::SendScintilla(id, SCI_GETTEXTLENGTH, 0, 0);
return lenDoc;
}
int WindowAccessor::GetLineState(int line) {
return Platform::SendScintilla(id, SCI_GETLINESTATE, line);
}
int WindowAccessor::SetLineState(int line, int state) {
return Platform::SendScintilla(id, SCI_SETLINESTATE, line, state);
}
void WindowAccessor::StartAt(unsigned int start, char chMask) {
Platform::SendScintilla(id, SCI_STARTSTYLING, start, chMask);
}
void WindowAccessor::StartSegment(unsigned int pos) {
startSeg = pos;
}
void WindowAccessor::ColourTo(unsigned int pos, int chAttr) {
// Only perform styling if non empty range
if (pos != startSeg - 1) {
if (pos < startSeg) {
Platform::DebugPrintf("Bad colour positions %d - %d\n", startSeg, pos);
}
if (validLen + (pos - startSeg + 1) >= bufferSize)
Flush();
if (validLen + (pos - startSeg + 1) >= bufferSize) {
// Too big for buffer so send directly
Platform::SendScintilla(id, SCI_SETSTYLING, pos - startSeg + 1, chAttr);
} else {
if (chAttr != chWhile)
chFlags = 0;
chAttr |= chFlags;
for (unsigned int i = startSeg; i <= pos; i++) {
styleBuf[validLen++] = static_cast<char>(chAttr);
}
}
}
startSeg = pos+1;
}
void WindowAccessor::SetLevel(int line, int level) {
Platform::SendScintilla(id, SCI_SETFOLDLEVEL, line, level);
}
void WindowAccessor::Flush() {
startPos = extremePosition;
lenDoc = -1;
if (validLen > 0) {
Platform::SendScintilla(id, SCI_SETSTYLINGEX, validLen,
reinterpret_cast<long>(styleBuf));
validLen = 0;
}
}
int WindowAccessor::IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader) {
int end = Length();
int spaceFlags = 0;
// Determines the indentation level of the current line and also checks for consistent
// indentation compared to the previous line.
// Indentation is judged consistent when the indentation whitespace of each line lines
// the same or the indentation of one line is a prefix of the other.
int pos = LineStart(line);
char ch = (*this)[pos];
int indent = 0;
bool inPrevPrefix = line > 0;
int posPrev = inPrevPrefix ? LineStart(line-1) : 0;
while ((ch == ' ' || ch == '\t') && (pos < end)) {
if (inPrevPrefix) {
char chPrev = (*this)[posPrev++];
if (chPrev == ' ' || chPrev == '\t') {
if (chPrev != ch)
spaceFlags |= wsInconsistent;
} else {
inPrevPrefix = false;
}
}
if (ch == ' ') {
spaceFlags |= wsSpace;
indent++;
} else { // Tab
spaceFlags |= wsTab;
if (spaceFlags & wsSpace)
spaceFlags |= wsSpaceTab;
indent = (indent / 8 + 1) * 8;
}
ch = (*this)[++pos];
}
*flags = spaceFlags;
indent += SC_FOLDLEVELBASE;
// if completely empty line or the start of a comment...
if (isspace(ch) || (pfnIsCommentLeader && (*pfnIsCommentLeader)(*this, pos, end-pos)) )
return indent | SC_FOLDLEVELWHITEFLAG;
else
return indent;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,523 +0,0 @@
////////////////////////////////////////////////////////////////////////////
// Name: stc.cpp
// Purpose: A wxWindows implementation of Scintilla. This class is the
// one meant to be used directly by wx applications. It does not
// derive directly from the Scintilla classes, but instead
// delegates most things to the real Scintilla class.
// This allows the use of Scintilla without polluting the
// namespace with all the classes and identifiers from Scintilla.
//
// Author: Robin Dunn
//
// Created: 13-Jan-2000
// RCS-ID: $Id$
// Copyright: (c) 2000 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#include <ctype.h>
#include "wx/stc/stc.h"
#include "ScintillaWX.h"
#include <wx/tokenzr.h>
// The following code forces a reference to all of the Scintilla lexers.
// If we don't do something like this, then the linker tends to "optimize"
// them away. (eric@sourcegear.com)
int wxForceScintillaLexers(void)
{
extern LexerModule lmCPP;
extern LexerModule lmHTML;
extern LexerModule lmXML;
extern LexerModule lmProps;
extern LexerModule lmErrorList;
extern LexerModule lmMake;
extern LexerModule lmBatch;
extern LexerModule lmPerl;
extern LexerModule lmPython;
extern LexerModule lmSQL;
extern LexerModule lmVB;
if (
&lmCPP
&& &lmHTML
&& &lmXML
&& &lmProps
&& &lmErrorList
&& &lmMake
&& &lmBatch
&& &lmPerl
&& &lmPython
&& &lmSQL
&& &lmVB
)
{
return 1;
}
else
{
return 0;
}
}
//----------------------------------------------------------------------
const wxChar* wxSTCNameStr = "stcwindow";
BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
EVT_PAINT (wxStyledTextCtrl::OnPaint)
EVT_SCROLLWIN (wxStyledTextCtrl::OnScrollWin)
EVT_SIZE (wxStyledTextCtrl::OnSize)
EVT_LEFT_DOWN (wxStyledTextCtrl::OnMouseLeftDown)
EVT_MOTION (wxStyledTextCtrl::OnMouseMove)
EVT_LEFT_UP (wxStyledTextCtrl::OnMouseLeftUp)
EVT_RIGHT_UP (wxStyledTextCtrl::OnMouseRightUp)
EVT_CHAR (wxStyledTextCtrl::OnChar)
EVT_KEY_DOWN (wxStyledTextCtrl::OnKeyDown)
EVT_KILL_FOCUS (wxStyledTextCtrl::OnLoseFocus)
EVT_SET_FOCUS (wxStyledTextCtrl::OnGainFocus)
EVT_SYS_COLOUR_CHANGED (wxStyledTextCtrl::OnSysColourChanged)
EVT_ERASE_BACKGROUND (wxStyledTextCtrl::OnEraseBackground)
EVT_MENU_RANGE (-1, -1, wxStyledTextCtrl::OnMenu)
EVT_LISTBOX_DCLICK (-1, wxStyledTextCtrl::OnListBox)
END_EVENT_TABLE()
IMPLEMENT_CLASS(wxStyledTextCtrl, wxControl)
IMPLEMENT_DYNAMIC_CLASS(wxStyledTextEvent, wxCommandEvent)
//----------------------------------------------------------------------
// Constructor and Destructor
wxStyledTextCtrl::wxStyledTextCtrl(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name) :
wxControl(parent, id, pos, size,
style | wxVSCROLL | wxHSCROLL | wxWANTS_CHARS | wxCLIP_CHILDREN,
wxDefaultValidator, name)
{
m_swx = new ScintillaWX(this);
m_stopWatch.Start();
}
wxStyledTextCtrl::~wxStyledTextCtrl() {
delete m_swx;
}
//----------------------------------------------------------------------
long wxStyledTextCtrl::SendMsg(int msg, long wp, long lp) {
return m_swx->WndProc(msg, wp, lp);
}
#ifdef MAKELONG
#undef MAKELONG
#endif
#define MAKELONG(a, b) ((a) | ((b) << 16))
static long wxColourAsLong(const wxColour& co) {
return (((long)co.Blue() << 16) |
((long)co.Green() << 8) |
((long)co.Red()));
}
static wxColour wxColourFromLong(long c) {
wxColour clr;
clr.Set(c & 0xff, (c >> 8) & 0xff, (c >> 16) & 0xff);
return clr;
}
static wxColour wxColourFromSpec(const wxString& spec) {
// spec should be #RRGGBB
char* junk;
int red = strtol(spec.Mid(1,2), &junk, 16);
int green = strtol(spec.Mid(3,2), &junk, 16);
int blue = strtol(spec.Mid(5,2), &junk, 16);
return wxColour(red, green, blue);
}
//----------------------------------------------------------------------
// BEGIN generated section. The following code is automatically generated
// by gen_iface.py from the contents of Scintilla.iface. Do not edit
// this file. Edit stc.cpp.in or gen_iface.py instead and regenerate.
%(METHOD_IMPS)s
// END of generated section
//----------------------------------------------------------------------
// Returns the line number of the line with the caret.
int wxStyledTextCtrl::GetCurrentLine() {
int line = LineFromPosition(GetCurrentPos());
return line;
}
// Extract style settings from a spec-string which is composed of one or
// more of the following comma separated elements:
//
// bold turns on bold
// italic turns on italics
// fore:#RRGGBB sets the foreground colour
// back:#RRGGBB sets the background colour
// face:[facename] sets the font face name to use
// size:[num] sets the font size in points
// eol turns on eol filling
// underline turns on underlining
//
void wxStyledTextCtrl::StyleSetSpec(int styleNum, const wxString& spec) {
wxStringTokenizer tkz(spec, ",");
while (tkz.HasMoreTokens()) {
wxString token = tkz.GetNextToken();
wxString option = token.BeforeFirst(':');
wxString val = token.AfterFirst(':');
if (option == "bold")
StyleSetBold(styleNum, true);
else if (option == "italic")
StyleSetItalic(styleNum, true);
else if (option == "underline")
StyleSetUnderline(styleNum, true);
else if (option == "eol")
StyleSetEOLFilled(styleNum, true);
else if (option == "size") {
long points;
if (val.ToLong(&points))
StyleSetSize(styleNum, points);
}
else if (option == "face")
StyleSetFaceName(styleNum, val);
else if (option == "fore")
StyleSetForeground(styleNum, wxColourFromSpec(val));
else if (option == "back")
StyleSetBackground(styleNum, wxColourFromSpec(val));
}
}
// Set style size, face, bold, italic, and underline attributes from
// a wxFont's attributes.
void wxStyledTextCtrl::StyleSetFont(int styleNum, wxFont& font) {
int size = font.GetPointSize();
wxString faceName = font.GetFaceName();
bool bold = font.GetWeight() == wxBOLD;
bool italic = font.GetStyle() != wxNORMAL;
bool under = font.GetUnderlined();
// TODO: add encoding/charset mapping
StyleSetFontAttr(styleNum, size, faceName, bold, italic, under);
}
// Set all font style attributes at once.
void wxStyledTextCtrl::StyleSetFontAttr(int styleNum, int size,
const wxString& faceName,
bool bold, bool italic,
bool underline) {
StyleSetSize(styleNum, size);
StyleSetFaceName(styleNum, faceName);
StyleSetBold(styleNum, bold);
StyleSetItalic(styleNum, italic);
StyleSetUnderline(styleNum, underline);
// TODO: add encoding/charset mapping
}
// Perform one of the operations defined by the wxSTC_CMD_* constants.
void wxStyledTextCtrl::CmdKeyExecute(int cmd) {
SendMsg(cmd);
}
// Set the left and right margin in the edit area, measured in pixels.
void wxStyledTextCtrl::SetMargins(int left, int right) {
SetMarginLeft(left);
SetMarginRight(right);
}
// Retrieve the start and end positions of the current selection.
void wxStyledTextCtrl::GetSelection(int* startPos, int* endPos) {
if (startPos != NULL)
*startPos = SendMsg(SCI_GETSELECTIONSTART);
if (endPos != NULL)
*endPos = SendMsg(SCI_GETSELECTIONEND);
}
// Retrieve the point in the window where a position is displayed.
wxPoint wxStyledTextCtrl::PointFromPosition(int pos) {
int x = SendMsg(SCI_POINTXFROMPOSITION, 0, pos);
int y = SendMsg(SCI_POINTYFROMPOSITION, 0, pos);
return wxPoint(x, y);
}
// Scroll enough to make the given line visible
void wxStyledTextCtrl::ScrollToLine(int line) {
m_swx->DoScrollToLine(line);
}
// Scroll enough to make the given column visible
void wxStyledTextCtrl::ScrollToColumn(int column) {
m_swx->DoScrollToColumn(column);
}
//----------------------------------------------------------------------
// Event handlers
void wxStyledTextCtrl::OnPaint(wxPaintEvent& evt) {
wxPaintDC dc(this);
wxRegion region = GetUpdateRegion();
m_swx->DoPaint(&dc, region.GetBox());
}
void wxStyledTextCtrl::OnScrollWin(wxScrollWinEvent& evt) {
if (evt.GetOrientation() == wxHORIZONTAL)
m_swx->DoHScroll(evt.GetEventType(), evt.GetPosition());
else
m_swx->DoVScroll(evt.GetEventType(), evt.GetPosition());
}
void wxStyledTextCtrl::OnSize(wxSizeEvent& evt) {
wxSize sz = GetClientSize();
m_swx->DoSize(sz.x, sz.y);
}
void wxStyledTextCtrl::OnMouseLeftDown(wxMouseEvent& evt) {
wxPoint pt = evt.GetPosition();
m_swx->DoButtonDown(Point(pt.x, pt.y), m_stopWatch.Time(),
evt.ShiftDown(), evt.ControlDown(), evt.AltDown());
}
void wxStyledTextCtrl::OnMouseMove(wxMouseEvent& evt) {
wxPoint pt = evt.GetPosition();
m_swx->DoButtonMove(Point(pt.x, pt.y));
}
void wxStyledTextCtrl::OnMouseLeftUp(wxMouseEvent& evt) {
wxPoint pt = evt.GetPosition();
m_swx->DoButtonUp(Point(pt.x, pt.y), m_stopWatch.Time(),
evt.ControlDown());
}
void wxStyledTextCtrl::OnMouseRightUp(wxMouseEvent& evt) {
wxPoint pt = evt.GetPosition();
m_swx->DoContextMenu(Point(pt.x, pt.y));
}
void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) {
long key = evt.KeyCode();
if ((key > WXK_ESCAPE) &&
(key != WXK_DELETE) && (key < 255) &&
!evt.ControlDown() && !evt.AltDown()) {
m_swx->DoAddChar(key);
}
else {
evt.Skip();
}
}
void wxStyledTextCtrl::OnKeyDown(wxKeyEvent& evt) {
long key = evt.KeyCode();
key = toupper(key);
int processed = m_swx->DoKeyDown(key, evt.ShiftDown(),
evt.ControlDown(), evt.AltDown());
if (! processed)
evt.Skip();
}
void wxStyledTextCtrl::OnLoseFocus(wxFocusEvent& evt) {
m_swx->DoLoseFocus();
}
void wxStyledTextCtrl::OnGainFocus(wxFocusEvent& evt) {
m_swx->DoGainFocus();
}
void wxStyledTextCtrl::OnSysColourChanged(wxSysColourChangedEvent& evt) {
m_swx->DoSysColourChange();
}
void wxStyledTextCtrl::OnEraseBackground(wxEraseEvent& evt) {
// do nothing to help avoid flashing
}
void wxStyledTextCtrl::OnMenu(wxCommandEvent& evt) {
m_swx->DoCommand(evt.GetId());
}
void wxStyledTextCtrl::OnListBox(wxCommandEvent& evt) {
m_swx->DoOnListBox();
}
//----------------------------------------------------------------------
// Turn notifications from Scintilla into events
void wxStyledTextCtrl::NotifyChange() {
wxStyledTextEvent evt(wxEVT_STC_CHANGE, GetId());
GetEventHandler()->ProcessEvent(evt);
}
void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) {
SCNotification& scn = *_scn;
int eventType = 0;
switch (scn.nmhdr.code) {
case SCN_STYLENEEDED:
eventType = wxEVT_STC_STYLENEEDED;
break;
case SCN_CHARADDED:
eventType = wxEVT_STC_CHARADDED;
break;
case SCN_UPDATEUI:
eventType = wxEVT_STC_UPDATEUI;
break;
case SCN_SAVEPOINTREACHED:
eventType = wxEVT_STC_SAVEPOINTREACHED;
break;
case SCN_SAVEPOINTLEFT:
eventType = wxEVT_STC_SAVEPOINTLEFT;
break;
case SCN_MODIFYATTEMPTRO:
eventType = wxEVT_STC_ROMODIFYATTEMPT;
break;
case SCN_DOUBLECLICK:
eventType = wxEVT_STC_DOUBLECLICK;
break;
case SCN_MODIFIED:
eventType = wxEVT_STC_MODIFIED;
break;
case SCN_KEY:
eventType = wxEVT_STC_KEY;
break;
case SCN_MACRORECORD:
eventType = wxEVT_STC_MACRORECORD;
break;
case SCN_MARGINCLICK:
eventType = wxEVT_STC_MARGINCLICK;
break;
case SCN_NEEDSHOWN:
eventType = wxEVT_STC_NEEDSHOWN;
break;
case SCN_POSCHANGED:
eventType = wxEVT_STC_POSCHANGED;
break;
}
if (eventType) {
wxStyledTextEvent evt(eventType, GetId());
evt.SetPosition(scn.position);
evt.SetKey(scn.ch);
evt.SetModifiers(scn.modifiers);
if (eventType == wxEVT_STC_MODIFIED) {
evt.SetModificationType(scn.modificationType);
if (scn.text)
evt.SetText(wxString(scn.text, scn.length));
evt.SetLength(scn.length);
evt.SetLinesAdded(scn.linesAdded);
evt.SetLine(scn.line);
evt.SetFoldLevelNow(scn.foldLevelNow);
evt.SetFoldLevelPrev(scn.foldLevelPrev);
}
if (eventType == wxEVT_STC_MARGINCLICK)
evt.SetMargin(scn.margin);
if (eventType == wxEVT_STC_MACRORECORD) {
evt.SetMessage(scn.message);
evt.SetWParam(scn.wParam);
evt.SetLParam(scn.lParam);
}
GetEventHandler()->ProcessEvent(evt);
}
}
//----------------------------------------------------------------------
//----------------------------------------------------------------------
//----------------------------------------------------------------------
wxStyledTextEvent::wxStyledTextEvent(wxEventType commandType, int id)
: wxCommandEvent(commandType, id)
{
m_position = 0;
m_key = 0;
m_modifiers = 0;
m_modificationType = 0;
m_length = 0;
m_linesAdded = 0;
m_line = 0;
m_foldLevelNow = 0;
m_foldLevelPrev = 0;
m_margin = 0;
m_message = 0;
m_wParam = 0;
m_lParam = 0;
}
bool wxStyledTextEvent::GetShift() const { return (m_modifiers & SCI_SHIFT) != 0; }
bool wxStyledTextEvent::GetControl() const { return (m_modifiers & SCI_CTRL) != 0; }
bool wxStyledTextEvent::GetAlt() const { return (m_modifiers & SCI_ALT) != 0; }
void wxStyledTextEvent::CopyObject(wxObject& obj) const {
wxCommandEvent::CopyObject(obj);
wxStyledTextEvent* o = (wxStyledTextEvent*)&obj;
o->m_position = m_position;
o->m_key = m_key;
o->m_modifiers = m_modifiers;
o->m_modificationType = m_modificationType;
o->m_text = m_text;
o->m_length = m_length;
o->m_linesAdded = m_linesAdded;
o->m_line = m_line;
o->m_foldLevelNow = m_foldLevelNow;
o->m_foldLevelPrev = m_foldLevelPrev;
o->m_margin = m_margin;
o->m_message = m_message;
o->m_wParam = m_wParam;
o->m_lParam = m_lParam;
}
//----------------------------------------------------------------------
//----------------------------------------------------------------------

View File

@@ -1,297 +0,0 @@
////////////////////////////////////////////////////////////////////////////
// Name: stc.h
// Purpose: A wxWindows implementation of Scintilla. This class is the
// one meant to be used directly by wx applications. It does not
// derive directly from the Scintilla classes, and in fact there
// is no mention of Scintilla classes at all in this header.
// This class delegates all method calls and events to the
// Scintilla objects and so forth. This allows the use of
// Scintilla without polluting the namespace with all the
// classes and itentifiers from Scintilla.
//
// Author: Robin Dunn
//
// Created: 13-Jan-2000
// RCS-ID: $Id$
// Copyright: (c) 2000 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef __stc_h__
#define __stc_h__
#include <wx/wx.h>
//----------------------------------------------------------------------
// BEGIN generated section. The following code is automatically generated
// by gen_iface.py. Do not edit this file. Edit stc.h.in instead
// and regenerate
%(VALUES)s
// END of generated section
//----------------------------------------------------------------------
// Others
#define wxSTC_MASK_FOLDERS ((1 << wxSTC_MARKNUM_FOLDER) | (1 << wxSTC_MARKNUM_FOLDEROPEN))
//----------------------------------------------------------------------
class ScintillaWX; // forward declare
class WordList;
struct SCNotification;
extern const wxChar* wxSTCNameStr;
//----------------------------------------------------------------------
class wxStyledTextCtrl : public wxControl {
public:
#ifdef SWIG
wxStyledTextCtrl(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const char* name = "styledtext");
#else
wxStyledTextCtrl(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = wxSTCNameStr);
#endif
#ifndef SWIG
~wxStyledTextCtrl();
#endif
//----------------------------------------------------------------------
// BEGIN generated section. The following code is automatically generated
// by gen_iface.py. Do not edit this file. Edit stc.h.in instead
// and regenerate
%(METHOD_DEFS)s
// END of generated section
//----------------------------------------------------------------------
// Others...
// Returns the line number of the line with the caret.
int GetCurrentLine();
// Extract style settings from a spec-string which is composed of one or
// more of the following comma separated elements:
//
// bold turns on bold
// italic turns on italics
// fore:#RRGGBB sets the foreground colour
// back:#RRGGBB sets the background colour
// face:[facename] sets the font face name to use
// size:[num] sets the font size in points
// eol turns on eol filling
// underline turns on underlining
//
void StyleSetSpec(int styleNum, const wxString& spec);
// Set style size, face, bold, italic, and underline attributes from
// a wxFont's attributes.
void StyleSetFont(int styleNum, wxFont& font);
// Set all font style attributes at once.
void StyleSetFontAttr(int styleNum, int size,
const wxString& faceName,
bool bold, bool italic,
bool underline);
// Perform one of the operations defined by the wxSTC_CMD_* constants.
void CmdKeyExecute(int cmd);
// Set the left and right margin in the edit area, measured in pixels.
void SetMargins(int left, int right);
// Retrieve the start and end positions of the current selection.
#ifdef SWIG
void GetSelection(int* OUTPUT, int* OUTPUT);
#else
void GetSelection(int* startPos, int* endPos);
#endif
// Retrieve the point in the window where a position is displayed.
wxPoint PointFromPosition(int pos);
// Scroll enough to make the given line visible
void ScrollToLine(int line);
// Scroll enough to make the given column visible
void ScrollToColumn(int column);
//----------------------------------------------------------------------
#ifndef SWIG
private:
// Event handlers
void OnPaint(wxPaintEvent& evt);
void OnScrollWin(wxScrollWinEvent& evt);
void OnSize(wxSizeEvent& evt);
void OnMouseLeftDown(wxMouseEvent& evt);
void OnMouseMove(wxMouseEvent& evt);
void OnMouseLeftUp(wxMouseEvent& evt);
void OnMouseRightUp(wxMouseEvent& evt);
void OnChar(wxKeyEvent& evt);
void OnKeyDown(wxKeyEvent& evt);
void OnLoseFocus(wxFocusEvent& evt);
void OnGainFocus(wxFocusEvent& evt);
void OnSysColourChanged(wxSysColourChangedEvent& evt);
void OnEraseBackground(wxEraseEvent& evt);
void OnMenu(wxCommandEvent& evt);
void OnListBox(wxCommandEvent& evt);
// Turn notifications from Scintilla into events
void NotifyChange();
void NotifyParent(SCNotification* scn);
long SendMsg(int msg, long wp=0, long lp=0);
private:
DECLARE_EVENT_TABLE()
DECLARE_CLASS(wxStyledTextCtrl)
ScintillaWX* m_swx;
wxStopWatch m_stopWatch;
friend class ScintillaWX;
friend class Platform;
#endif
};
//----------------------------------------------------------------------
class wxStyledTextEvent : public wxCommandEvent {
public:
wxStyledTextEvent(wxEventType commandType=0, int id=0);
~wxStyledTextEvent() {}
void SetPosition(int pos) { m_position = pos; }
void SetKey(int k) { m_key = k; }
void SetModifiers(int m) { m_modifiers = m; }
void SetModificationType(int t) { m_modificationType = t; }
void SetText(const char* t) { m_text = t; }
void SetLength(int len) { m_length = len; }
void SetLinesAdded(int num) { m_linesAdded = num; }
void SetLine(int val) { m_line = val; }
void SetFoldLevelNow(int val) { m_foldLevelNow = val; }
void SetFoldLevelPrev(int val) { m_foldLevelPrev = val; }
void SetMargin(int val) { m_margin = val; }
void SetMessage(int val) { m_message = val; }
void SetWParam(int val) { m_wParam = val; }
void SetLParam(int val) { m_lParam = val; }
int GetPosition() const { return m_position; }
int GetKey() const { return m_key; }
int GetModifiers() const { return m_modifiers; }
int GetModificationType() const { return m_modificationType; }
wxString GetText() const { return m_text; }
int GetLength() const { return m_length; }
int GetLinesAdded() const { return m_linesAdded; }
int GetLine() const { return m_line; }
int GetFoldLevelNow() const { return m_foldLevelNow; }
int GetFoldLevelPrev() const { return m_foldLevelPrev; }
int GetMargin() const { return m_margin; }
int GetMessage() const { return m_message; }
int GetWParam() const { return m_wParam; }
int GetLParam() const { return m_lParam; }
bool GetShift() const;
bool GetControl() const;
bool GetAlt() const;
void CopyObject(wxObject& obj) const;
#ifndef SWIG
private:
DECLARE_DYNAMIC_CLASS(wxStyledTextEvent)
int m_position;
int m_key;
int m_modifiers;
int m_modificationType; // wxEVT_STC_MODIFIED
wxString m_text;
int m_length;
int m_linesAdded;
int m_line;
int m_foldLevelNow;
int m_foldLevelPrev;
int m_margin; // wxEVT_STC_MARGINCLICK
int m_message; // wxEVT_STC_MACRORECORD
int m_wParam;
int m_lParam;
#endif
};
// Event types
enum {
wxEVT_STC_CHANGE = 1650,
wxEVT_STC_STYLENEEDED,
wxEVT_STC_CHARADDED,
wxEVT_STC_UPDATEUI,
wxEVT_STC_SAVEPOINTREACHED,
wxEVT_STC_SAVEPOINTLEFT,
wxEVT_STC_ROMODIFYATTEMPT,
wxEVT_STC_DOUBLECLICK,
wxEVT_STC_MODIFIED,
wxEVT_STC_KEY,
wxEVT_STC_MACRORECORD,
wxEVT_STC_MARGINCLICK,
wxEVT_STC_NEEDSHOWN,
wxEVT_STC_POSCHANGED
};
#ifndef SWIG
typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
#define EVT_STC_CHANGE(id, fn) { wxEVT_STC_CHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
#define EVT_STC_STYLENEEDED(id, fn) { wxEVT_STC_STYLENEEDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
#define EVT_STC_CHARADDED(id, fn) { wxEVT_STC_CHARADDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
#define EVT_STC_UPDATEUI(id, fn) { wxEVT_STC_UPDATEUI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
#define EVT_STC_SAVEPOINTREACHED(id, fn) { wxEVT_STC_SAVEPOINTREACHED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
#define EVT_STC_SAVEPOINTLEFT(id, fn) { wxEVT_STC_SAVEPOINTLEFT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
#define EVT_STC_ROMODIFYATTEMPT(id, fn) { wxEVT_STC_ROMODIFYATTEMPT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
#define EVT_STC_DOUBLECLICK(id, fn) { wxEVT_STC_DOUBLECLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
#define EVT_STC_MODIFIED(id, fn) { wxEVT_STC_MODIFIED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
#define EVT_STC_KEY(id, fn) { wxEVT_STC_KEY, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
#define EVT_STC_MACRORECORD(id, fn) { wxEVT_STC_MACRORECORD, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
#define EVT_STC_MARGINCLICK(id, fn) { wxEVT_STC_MARGINCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
#define EVT_STC_NEEDSHOWN(id, fn) { wxEVT_STC_NEEDSHOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
#define EVT_STC_POSCHANGED(id, fn) { wxEVT_STC_POSCHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
#endif
//----------------------------------------------------------------------
//----------------------------------------------------------------------
#endif

376
distrib/gtk/README.txt Normal file
View File

@@ -0,0 +1,376 @@
wxPython README
---------------
Welcome to the wonderful world of wxPython!
Once you have installed the wxPython extension module, you can try it
out by going to the [install dir]\wxPython\demo directory and typing:
python demo.py
There are also some other sample files there for you to play with and
learn from.
If you selected to install the documentation then point your browser
to [install dir]\wxPython\docs\index.htm and you will then be looking
at the docs for wxWindows. For the most part you can use the C++ docs
as most classes and methods are used identically. Where there are
differences they are documented with a "wxPython Note."
On Win32 systems the binary self-installer creates a program group on
the Start Menu that contains a link to running the demo and a link to
the help file. To help you save disk space I'm now using Microsoft's
HTML Help format. If your system doesn't know what to do with the help
file, you can install the HTML Help Viewer as part of IE 4+, NT
Service Pack 4+, or the HTML Workshop at
http://msdn.microsoft.com/workshop/author/htmlhelp/download.asp.
Getting Help
------------
Since wxPython is a blending of multiple technologies, help comes from
multiple sources. See the http://alldunn.com/wxPython for details on
various sources of help, but probably the best source is the
wxPython-users mail list. You can view the archive or subscribe by
going to
http://starship.python.net/mailman/listinfo/wxpython-users
Or you can send mail directly to the list using this address:
wxpython-users@starship.python.net
----------------------------------------------------------------------
What's new in 2.1b2
--------------------
Added the missing wxWindow.GetUpdateRegion() method.
Made a new change in SWIG (update your patches everybody) that
provides a fix for global shadow objects that get an exception in
their __del__ when their extension module has already been deleted.
It was only a 1 line change in .../SWIG/Modules/pycpp.cxx at about
line 496 if you want to do it by hand.
It is now possible to run through MainLoop more than once in any one
process. The cleanup that used to happen as MainLoop completed (and
prevented it from running again) has been delayed until the wxc module
is being unloaded by Python.
I fixed a bunch of stuff in the C++ version of wxGrid so it wouldn't
make wxPython look bad.
wxWindow.PopupMenu() now takes a wxPoint instead of x,y. Added
wxWindow.PopupMenuXY to be consistent with some other methods.
Added wxGrid.SetEditInPlace and wxGrid.GetEditInPlace.
You can now provide your own app.MainLoop method. See
wxPython/demo/demoMainLoop.py for an example and some explaination.
Got the in-place-edit for the wxTreeCtrl fixed and added some demo
code to show how to use it.
Put the wxIcon constructor back in for GTK as it now has one that
matches MSW's.
Added wxGrid.GetCells
Added wxSystemSettings static methods as functions with names like
wxSystemSettings_GetSystemColour.
Removed wxPyMenu since using menu callbacks have been depreciated in
wxWindows. Use wxMenu and events instead.
Added alternate wxBitmap constructor (for MSW only) as
wxBitmapFromData(data, type, width, height, depth = 1)
Added a helper function named wxPyTypeCast that can convert shadow
objects of one type into shadow objects of another type. (Like doing
a down-cast.) See the implementation in wx.py for some docs.
What's new in 2.1b1
--------------------
Fixed wxComboBox.SetSelection so that it actually sets the selected
item. (Actually just removed it from wxPython and let it default to
wxChoice.SetSelection which was already doing the right thing.)
Added the Printing Framework.
Switched back to using the wxWindows DLL for the pre-built Win32
version. The problem was needing to reinitialize static class info
data after loading each extension module.
Lots of little tweaks and additions to reflect changes to various
wxWindows classes.
Fixed a bug with attaching objects to tree items. Actually was a
symptom of a larger problem with not obtaining the interpreter lock
when doing any Py_DECREFs.
wxSizer and friends. Sizers are layout tools that manage a colection
of windows and sizers. Different types of sizers apply different
types of layout algorithms. You saw it here first! These classes are
not even in the wxWindows C++ library yet!
What's new in 2.0b9
-------------------
Bug fix for ListCtrl in test4.py (Was a missing file... DSM!)
Bug fix for occassional GPF on Win32 systems upon termination of a
wxPython application.
Added wxListBox.GetSelections returning selections as a Tuple.
Added a wxTreeItemData that is able to hold any Python object and be
associated with items in a wxTreeCtrl. Added test pytree.py to show
this feature off.
Added wxSafeYield function.
OpenGL Canvas can be optionally compiled in to wxPython.
Awesome new Demo Framework for showing off wxPython and for learning
how it all works.
The pre-built Win32 version is no longer distributing the wxWindows
DLL. It is statically linked with the wxWindows library instead.
Added a couple missing items from the docs.
Added wxImage, wxImageHandler, wxPNGHandler, wxJPEGHandler,
wxGIFHandler and wxBMPHandler.
Added new methods to wxTextCtrl.
Fixed some problems with how SWIG was wrapping some wxTreeCtrl
methods.
What's new in 2.0b8
-------------------
Support for using Python threads in wxPython apps.
Several missing methods from various classes.
Various bug fixes.
What's new in 2.0b7
-------------------
Added DLG_PNT and DLG_SZE convienience methods to wxWindow class.
Added missing constructor and other methods for wxMenuItem.
What's new in 2.0b6
-------------------
Just a quickie update to fix the self-installer to be compatible with
Python 1.5.2b2's Registry settings.
What's new in 2.0b5
-------------------
Well obviously the numbering scheme has changed. I did this to
reflect the fact that this truly is the second major revision of
wxPython, (well the third actually if you count the one I did for
wxWindows 1.68 and then threw away...) and also that it is associated
with the 2.0 version of wxWindows.
I have finally started documenting wxPython. There are several pages
in the wxWindows documentation tree specifically about wxPython, and I
have added notes within the class references about where and how wxPython
diverges from wxWindows.
Added wxWindow_FromHWND(hWnd) for wxMSW to construct a wxWindow from a
window handle. If you can get the window handle into the python code,
it should just work... More news on this later.
Added wxImageList, wxToolTip.
Re-enabled wxConfig.DeleteAll() since it is reportedly fixed for the
wxRegConfig class.
As usual, some bug fixes, tweaks, etc.
What's new in 0.5.3
-------------------
Added wxSashWindow, wxSashEvent, wxLayoutAlgorithm, etc.
Various cleanup, tweaks, minor additions, etc. to maintain
compatibility with the current wxWindows.
What's new in 0.5.0
-------------------
Changed the import semantics from "from wxPython import *" to "from
wxPython.wx import *" This is for people who are worried about
namespace pollution, they can use "from wxPython import wx" and then
prefix all the wxPython identifiers with "wx."
Added wxTaskbarIcon for wxMSW.
Made the events work for wxGrid.
Added wxConfig.
Added wxMiniFrame for wxGTK.
Changed many of the args and return values that were pointers to gdi
objects to references to reflect changes in the wxWindows API.
Other assorted fixes and additions.
What's new in 0.4.2
-------------------
wxPython on wxGTK works!!! Both dynamic and static on Linux and
static on Solaris have been tested. Many thanks go to Harm
<H.v.d.Heijden@phys.tue.nl> for his astute detective work on tracking
down a nasty DECREF bug. Okay so I have to confess that it was just a
DSM (Dumb Stupid Mistake) on my part but it was nasty none the less
because the behavior was so different on different platforms.
The dynamicly loaded module on Solaris is still segfaulting, so it
must have been a different issue all along...
What's New in 0.4
-----------------
1. Worked on wxGTK compatibility. It is partially working. On a
Solaris/Sparc box wxPython is working but only when it is statically
linked with the Python interpreter. When built as a dyamically loaded
extension module, things start acting weirdly and it soon seg-faults.
And on Linux both the statically linked and the dynamically linked
version segfault shortly after starting up.
2. Added Toolbar, StatusBar and SplitterWindow classes.
3. Varioius bug fixes, enhancements, etc.
----------------------------------------------------------------------
Build Instructions
------------------
I used SWIG (http://www.swig.org) to create the source code for the
extension module. This enabled me to only have to deal with a small
amount of code and only have to bother with the exceptional issues.
SWIG takes care of the rest and generates all the repetative code for
me. You don't need SWIG to build the extension module as all the
generated C++ code is included under the src directory.
I added a few minor features to SWIG to control some of the code
generation. If you want to playaround with this the patches are in
wxPython/SWIG.patches and they should be applied to the 1.1p5 version
of SWIG. These new patches are documented at
http://starship.skyport.net/crew/robind/#swig, and they should also
end up in the 1.2 version of SWIG.
wxPython is organized as a Python package. This means that the
directory containing the results of the build process should be a
subdirectory of a directory on the PYTHONPATH. (And preferably should
be named wxPython.) You can control where the build process will dump
wxPython by setting the TARGETDIR makefile variable. The default is
$(WXWIN)/utils/wxPython, where this README.txt is located. If you
leave it here then you should add $(WXWIN)/utils to your PYTHONPATH.
However, you may prefer to use something that is already on your
PYTHONPATH, such as the site-packages directory on Unix systems.
Win32
-----
1. Build wxWindows with wxUSE_RESOURCE_LOADING_IN_MSW set to 1 in
include/wx/msw/setup.h so icons can be loaded dynamically. While
there, make sure wxUSE_OWNER_DRAWN is also set to 1.
2. Change into the $(WXWIN)/utils/wxPython/src directory.
3. Edit makefile.vc and specify where your python installation is at.
You may also want to fiddle with the TARGETDIR variable as described
above.
4. Run nmake -f makefile.vc
5. If it builds successfully, congratulations! Move on to the next
step. If not then you can try mailing me for help. Also, I will
always have a pre-built win32 version of this extension module at
http://alldunn.com/wxPython/.
6. Change to the $(WXWIN)/utils/wxPython/demo directory.
7. Try executing the demo program. For example:
python demo.py
To run it without requiring a console, you can use the pythonw.exe
version of Python either from the command line or from a shortcut.
Unix
----
0. I configure wxWindows like this, YMMV:
./configure --with-gtk --disable-shared --enable-threads --disable-unicode
1. Change into the $(WXWIN)/utils/wxPython/src directory.
2. Edit Setup.in and ensure that the flags, directories, and toolkit
options are correct. See the above commentary about TARGETDIR. There
are a few sample Setup.in.[platform] files provided.
[I've written a Setup which should work in almost all Unix systems,
so that the steps 1 and 2 don't have to be done. Robert Roebling. ]
3. Run this command to generate a makefile:
make -f Makefile.pre.in boot
4. Run these commands to build and then install the wxPython extension
module:
make
4b. Log in as root. [Robert Roebling]
make install
4c. Log out from root. [Robert Roebling]
5. Change to the $(WXWIN)/utils/wxPython/tests directory.
6. Try executing the demo program. For example:
python demo.py
----------------
Robin Dunn
robin@alldunn.com

47
distrib/gtk/Setup Normal file
View File

@@ -0,0 +1,47 @@
# This file gives the details of what is needed to build this extension
# module so the Makefile can be created.
###
### This file should be created by configure. Currently it is tweaked by hand.
###
*shared*
CCC=g++
WXWIN=~/wxWindows
GENCODEDIR=gtk
srcdir=$(GENCODEDIR)
WX_CONFIG_CFLAGS=`wx-config --cflags` `gtk-config --cflags`
WX_CONFIG_LIBS=`wx-config --libs`
# Depending on how your Python was built, you may have to set this
# value to use the C++ driver to link with instead of the default
# C driver. For example:
MY_LDSHARED=$(CCC) -shared $(WX_CONFIG_LIBS)
# Same as above, but for statically linking Python and wxPython together,
# in other words, if you comment out the *shared* above. If this is the
# case then you should ensure that the main() function is Python's, not
# wxWindows'. You can rebuild $(WXWIN)/src/gtk/app.cpp with NOMAIN defined
# to force this...
MY_LINKCC=$(CCC)
## Pick one of these, or set your own. This is where the
## wxPython module should be installed. It should be a
## subdirectory named wxPython.
#TARGETDIR=..
#TARGETDIR=$(BINLIBDEST)/site-packages/wxPython
TARGETDIR=$(BINLIBDEST)/wxPython
wxc wx.cpp helpers.cpp windows.cpp events.cpp misc.cpp gdi.cpp \
mdi.cpp controls.cpp controls2.cpp windows2.cpp cmndlgs.cpp \
frames.cpp stattool.cpp windows3.cpp image.cpp misc2.cpp \
utils.cpp printfw.cpp libpy.c libptr.c \
## comment out the next line to disable wxGLCanvas
##_glcanvas.cpp glcanvas.cpp -DWITH_GLCANVAS -lGL -lGLU \
-I. $(WX_CONFIG_CFLAGS) -I/usr/local/lib/glib/include \
-DSWIG_GLOBAL -DWXP_WITH_THREAD $(SEPARATE) -Xlinker $(WX_CONFIG_LIBS)

804
distrib/gtk/copy_src Executable file
View File

@@ -0,0 +1,804 @@
#! /bin/sh
#
# This script is creates a dir tree in ~/wxgtk_dist which
# can then be packed into an archive
echo --------
echo This script will copy the wxGTK release files into ~/wxgtk_dist
echo --------
echo
mkdir ~/wxgtk_dist
mkdir ~/wxgtk_dist/wxGTK
echo Base dir..
cd ../..
cp wxGTK.spec ~/wxgtk_dist/wxGTK
cp configure ~/wxgtk_dist/wxGTK
cp config.sub ~/wxgtk_dist/wxGTK
cp config.guess ~/wxgtk_dist/wxGTK
cp install-sh ~/wxgtk_dist/wxGTK
cp mkinstalldirs ~/wxgtk_dist/wxGTK
cp wx-config.in ~/wxgtk_dist/wxGTK
cp setup.h.in ~/wxgtk_dist/wxGTK
cp Makefile.in ~/wxgtk_dist/wxGTK
echo Docs..
cd docs/gtk
cp COPYING.LIB ~/wxgtk_dist/wxGTK
cp install.txt ~/wxgtk_dist/wxGTK/INSTALL.txt
cp changes.txt ~/wxgtk_dist/wxGTK/CHANGES.txt
cp licence.txt ~/wxgtk_dist/wxGTK/LICENCE.txt
cp readme.txt ~/wxgtk_dist/wxGTK/README.txt
cp todo.txt ~/wxgtk_dist/wxGTK/TODO.txt
cd ..
cp symbols.txt ~/wxgtk_dist/wxGTK/SYMBOLS.txt
cd ..
echo Include dir..
mkdir ~/wxgtk_dist/wxGTK/include
cd include
cp Makefile.am ~/wxgtk_dist/wxGTK/include
cp Makefile.in ~/wxgtk_dist/wxGTK/include
mkdir ~/wxgtk_dist/wxGTK/include/wx
cd wx
cp *.h ~/wxgtk_dist/wxGTK/include/wx
cp *.cpp ~/wxgtk_dist/wxGTK/include/wx
cp Makefile.am ~/wxgtk_dist/wxGTK/include/wx
cp Makefile.in ~/wxgtk_dist/wxGTK/include/wx
mkdir ~/wxgtk_dist/wxGTK/include/wx/generic
cd generic
cp *.h ~/wxgtk_dist/wxGTK/include/wx/generic
cp *.xpm ~/wxgtk_dist/wxGTK/include/wx/generic
cp Makefile.am ~/wxgtk_dist/wxGTK/include/wx/generic
cp Makefile.in ~/wxgtk_dist/wxGTK/include/wx/generic
cd ..
mkdir ~/wxgtk_dist/wxGTK/include/wx/html
cd html
cp *.h ~/wxgtk_dist/wxGTK/include/wx/html
cp Makefile.am ~/wxgtk_dist/wxGTK/include/wx/html
cp Makefile.in ~/wxgtk_dist/wxGTK/include/wx/html
cd ..
mkdir ~/wxgtk_dist/wxGTK/include/wx/unix
cd unix
cp *.h ~/wxgtk_dist/wxGTK/include/wx/unix
cp Makefile.am ~/wxgtk_dist/wxGTK/include/wx/unix
cp Makefile.in ~/wxgtk_dist/wxGTK/include/wx/unix
cd ..
mkdir ~/wxgtk_dist/wxGTK/include/wx/gtk
cd gtk
cp *.h ~/wxgtk_dist/wxGTK/include/wx/gtk
cp *.xpm ~/wxgtk_dist/wxGTK/include/wx/gtk
rm ~/wxgtk_dist/wxGTK/include/wx/gtk/setup.h
cp Makefile.am ~/wxgtk_dist/wxGTK/include/wx/gtk
cp Makefile.in ~/wxgtk_dist/wxGTK/include/wx/gtk
cd ..
mkdir ~/wxgtk_dist/wxGTK/include/wx/motif
cd motif
cp Makefile.am ~/wxgtk_dist/wxGTK/include/wx/motif
cp Makefile.in ~/wxgtk_dist/wxGTK/include/wx/motif
cd ..
mkdir ~/wxgtk_dist/wxGTK/include/wx/msw
cd msw
cp Makefile.am ~/wxgtk_dist/wxGTK/include/wx/msw
cp Makefile.in ~/wxgtk_dist/wxGTK/include/wx/msw
cd ..
mkdir ~/wxgtk_dist/wxGTK/include/wx/protocol
cd protocol
cp *.h ~/wxgtk_dist/wxGTK/include/wx/protocol
cp Makefile.am ~/wxgtk_dist/wxGTK/include/wx/protocol
cp Makefile.in ~/wxgtk_dist/wxGTK/include/wx/protocol
cd ..
cd ../..
echo Misc dir..
mkdir ~/wxgtk_dist/wxGTK/misc
cd misc
cp Makefile.am ~/wxgtk_dist/wxGTK/misc
cp Makefile.in ~/wxgtk_dist/wxGTK/misc
mkdir ~/wxgtk_dist/wxGTK/misc/afm
cd afm
cp *.afm ~/wxgtk_dist/wxGTK/misc/afm
cp Makefile.am ~/wxgtk_dist/wxGTK/misc/afm
cp Makefile.in ~/wxgtk_dist/wxGTK/misc/afm
cd ..
mkdir ~/wxgtk_dist/wxGTK/misc/gs_afm
cd gs_afm
cp *.afm ~/wxgtk_dist/wxGTK/misc/gs_afm
cp Makefile.am ~/wxgtk_dist/wxGTK/misc/gs_afm
cp Makefile.in ~/wxgtk_dist/wxGTK/misc/gs_afm
cd ../..
echo Src dir..
cd src
mkdir ~/wxgtk_dist/wxGTK/src
cp Makefile.am ~/wxgtk_dist/wxGTK/src
cp Makefile.in ~/wxgtk_dist/wxGTK/src
cd gtk
mkdir ~/wxgtk_dist/wxGTK/src/gtk
cp Makefile.am ~/wxgtk_dist/wxGTK/src/gtk
cp Makefile.in ~/wxgtk_dist/wxGTK/src/gtk
cp *.xbm ~/wxgtk_dist/wxGTK/src/gtk
cp *.c ~/wxgtk_dist/wxGTK/src/gtk
cp *.cpp ~/wxgtk_dist/wxGTK/src/gtk
cd ..
cd msw
mkdir ~/wxgtk_dist/wxGTK/src/msw
cp Makefile.am ~/wxgtk_dist/wxGTK/src/msw
cp Makefile.in ~/wxgtk_dist/wxGTK/src/msw
cd ..
cd motif
mkdir ~/wxgtk_dist/wxGTK/src/motif
cp Makefile.am ~/wxgtk_dist/wxGTK/src/motif
cp Makefile.in ~/wxgtk_dist/wxGTK/src/motif
cd ..
cd common
mkdir ~/wxgtk_dist/wxGTK/src/common
cp glob.inc ~/wxgtk_dist/wxGTK/src/common
cp lexer.l ~/wxgtk_dist/wxGTK/src/common
cp parser.y ~/wxgtk_dist/wxGTK/src/common
cp extended.c ~/wxgtk_dist/wxGTK/src/common
cp unzip.* ~/wxgtk_dist/wxGTK/src/common
cp *.cpp ~/wxgtk_dist/wxGTK/src/common
cd ..
cd unix
mkdir ~/wxgtk_dist/wxGTK/src/unix
cp *.cpp ~/wxgtk_dist/wxGTK/src/unix
cp *.h ~/wxgtk_dist/wxGTK/src/unix
cp *.c ~/wxgtk_dist/wxGTK/src/unix
cd ..
cd html
mkdir ~/wxgtk_dist/wxGTK/src/html
cp *.cpp ~/wxgtk_dist/wxGTK/src/html
cp *.h ~/wxgtk_dist/wxGTK/src/html
cd bitmaps
mkdir ~/wxgtk_dist/wxGTK/src/html/bitmaps
cp *.xpm ~/wxgtk_dist/wxGTK/src/html/bitmaps
cd ../..
cd generic
mkdir ~/wxgtk_dist/wxGTK/src/generic
cp *.cpp ~/wxgtk_dist/wxGTK/src/generic
cd ..
cd iodbc
mkdir ~/wxgtk_dist/wxGTK/src/iodbc
cp * ~/wxgtk_dist/wxGTK/src/iodbc
cd ..
cd zlib
mkdir ~/wxgtk_dist/wxGTK/src/zlib
cp * ~/wxgtk_dist/wxGTK/src/zlib
cd ..
cd png
mkdir ~/wxgtk_dist/wxGTK/src/png
cp * ~/wxgtk_dist/wxGTK/src/png
cd ..
cd jpeg
mkdir ~/wxgtk_dist/wxGTK/src/jpeg
cp * ~/wxgtk_dist/wxGTK/src/jpeg
cd ../..
echo Utils dir..
cd utils
mkdir ~/wxgtk_dist/wxGTK/utils
cp Makefile.am ~/wxgtk_dist/wxGTK/utils
cp Makefile.in ~/wxgtk_dist/wxGTK/utils
echo wxGLCanvas..
cd glcanvas
mkdir ~/wxgtk_dist/wxGTK/utils/glcanvas
cp ./docs/notes.txt ~/wxgtk_dist/wxGTK/utils/glcanvas/NOTES.txt
mkdir ~/wxgtk_dist/wxGTK/utils/glcanvas/gtk
cp ./gtk/glcanvas.cpp ~/wxgtk_dist/wxGTK/utils/glcanvas/gtk
cp ./gtk/glcanvas.h ~/wxgtk_dist/wxGTK/utils/glcanvas/gtk
mkdir ~/wxgtk_dist/wxGTK/utils/glcanvas/samples
mkdir ~/wxgtk_dist/wxGTK/utils/glcanvas/samples/cube
mkdir ~/wxgtk_dist/wxGTK/utils/glcanvas/samples/isosurf
mkdir ~/wxgtk_dist/wxGTK/utils/glcanvas/samples/penguin
cd samples/cube
cp Makefile ~/wxgtk_dist/wxGTK/utils/glcanvas/samples/cube
cp cube.h ~/wxgtk_dist/wxGTK/utils/glcanvas/samples/cube
cp cube.cpp ~/wxgtk_dist/wxGTK/utils/glcanvas/samples/cube
cd ..
cd isosurf
cp Makefile ~/wxgtk_dist/wxGTK/utils/glcanvas/samples/isosurf
cp isosurf.h ~/wxgtk_dist/wxGTK/utils/glcanvas/samples/isosurf
cp isosurf.cpp ~/wxgtk_dist/wxGTK/utils/glcanvas/samples/isosurf
cp isosurf.dat.gz ~/wxgtk_dist/wxGTK/utils/glcanvas/samples/isosurf
cd ..
cd penguin
cp Makefile ~/wxgtk_dist/wxGTK/utils/glcanvas/samples/penguin
cp penguin.h ~/wxgtk_dist/wxGTK/utils/glcanvas/samples/penguin
cp penguin.cpp ~/wxgtk_dist/wxGTK/utils/glcanvas/samples/penguin
cp trackball.h ~/wxgtk_dist/wxGTK/utils/glcanvas/samples/penguin
cp trackball.c ~/wxgtk_dist/wxGTK/utils/glcanvas/samples/penguin
cp lw.h ~/wxgtk_dist/wxGTK/utils/glcanvas/samples/penguin
cp lw.cpp ~/wxgtk_dist/wxGTK/utils/glcanvas/samples/penguin
cp penguin.lwo ~/wxgtk_dist/wxGTK/utils/glcanvas/samples/penguin
cd ../../..
echo DialogEd..
cd dialoged/src
mkdir ~/wxgtk_dist/wxGTK/utils/dialoged
cp Makefile ~/wxgtk_dist/wxGTK/utils/dialoged
cp dialoged.cpp ~/wxgtk_dist/wxGTK/utils/dialoged
cp dlghndlr.cpp ~/wxgtk_dist/wxGTK/utils/dialoged
cp edlist.cpp ~/wxgtk_dist/wxGTK/utils/dialoged
cp edtree.cpp ~/wxgtk_dist/wxGTK/utils/dialoged
cp reseditr.cpp ~/wxgtk_dist/wxGTK/utils/dialoged
cp reswrite.cpp ~/wxgtk_dist/wxGTK/utils/dialoged
cp symbtabl.cpp ~/wxgtk_dist/wxGTK/utils/dialoged
cp winprop.cpp ~/wxgtk_dist/wxGTK/utils/dialoged
cp winstyle.cpp ~/wxgtk_dist/wxGTK/utils/dialoged
cp dialoged.h ~/wxgtk_dist/wxGTK/utils/dialoged
cp dlghndlr.h ~/wxgtk_dist/wxGTK/utils/dialoged
cp edlist.h ~/wxgtk_dist/wxGTK/utils/dialoged
cp edtree.h ~/wxgtk_dist/wxGTK/utils/dialoged
cp reseditr.h ~/wxgtk_dist/wxGTK/utils/dialoged
cp symbtabl.h ~/wxgtk_dist/wxGTK/utils/dialoged
cp winprop.h ~/wxgtk_dist/wxGTK/utils/dialoged
cp winstyle.h ~/wxgtk_dist/wxGTK/utils/dialoged
cd bitmaps
mkdir ~/wxgtk_dist/wxGTK/utils/dialoged/bitmaps
cp *.xpm ~/wxgtk_dist/wxGTK/utils/dialoged/bitmaps
cd ../../..
echo wxPython..
cd wxPython
mkdir ~/wxgtk_dist/wxGTK/utils/wxPython
cp README.txt ~/wxgtk_dist/wxGTK/utils/wxPython
mkdir ~/wxgtk_dist/wxGTK/utils/wxPython/src
cp ./src/* ~/wxgtk_dist/wxGTK/utils/wxPython/src
mkdir ~/wxgtk_dist/wxGTK/utils/wxPython/src/gtk
cp ./src/gtk/* ~/wxgtk_dist/wxGTK/utils/wxPython/src/gtk
mkdir ~/wxgtk_dist/wxGTK/utils/wxPython/lib
cp ./lib/*.py ~/wxgtk_dist/wxGTK/utils/wxPython/lib
mkdir ~/wxgtk_dist/wxGTK/utils/wxPython/lib/sizers
cp ./lib/sizers/*.py ~/wxgtk_dist/wxGTK/utils/wxPython/lib/sizers
mkdir ~/wxgtk_dist/wxGTK/utils/wxPython/demo
cp ./demo/README.txt ~/wxgtk_dist/wxGTK/utils/wxPython/demo
cp ./demo/*.py ~/wxgtk_dist/wxGTK/utils/wxPython/demo
cp ./demo/*.pyc ~/wxgtk_dist/wxGTK/utils/wxPython/demo
mkdir ~/wxgtk_dist/wxGTK/utils/wxPython/demo/bitmaps
cp ./demo/bitmaps/* ~/wxgtk_dist/wxGTK/utils/wxPython/demo/bitmaps
cd ../..
echo Samples dir..
cd samples
mkdir ~/wxgtk_dist/wxGTK/samples
cp Makefile.am ~/wxgtk_dist/wxGTK/samples
cp Makefile.in ~/wxgtk_dist/wxGTK/samples
echo Minimal sample..
cd minimal
mkdir ~/wxgtk_dist/wxGTK/samples/minimal
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/minimal
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/minimal
cp minimal.cpp ~/wxgtk_dist/wxGTK/samples/minimal
cp mondrian.xpm ~/wxgtk_dist/wxGTK/samples/minimal
cd ..
echo Bombs sample..
cd bombs
mkdir ~/wxgtk_dist/wxGTK/samples/bombs
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/bombs
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/bombs
cp *.cpp ~/wxgtk_dist/wxGTK/samples/bombs
cp *.h ~/wxgtk_dist/wxGTK/samples/bombs
cp *.xpm ~/wxgtk_dist/wxGTK/samples/bombs
cd ..
echo Caret sample..
cd caret
mkdir ~/wxgtk_dist/wxGTK/samples/caret
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/caret
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/caret
cp *.cpp ~/wxgtk_dist/wxGTK/samples/caret
cp *.xpm ~/wxgtk_dist/wxGTK/samples/caret
cd ..
echo Checklst sample..
cd checklst
mkdir ~/wxgtk_dist/wxGTK/samples/checklst
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/checklst
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/checklst
cp *.cpp ~/wxgtk_dist/wxGTK/samples/checklst
cp *.xpm ~/wxgtk_dist/wxGTK/samples/checklst
cd ..
echo Config sample..
cd config
mkdir ~/wxgtk_dist/wxGTK/samples/config
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/config
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/config
cp *.cpp ~/wxgtk_dist/wxGTK/samples/config
cd ..
echo Controls sample..
cd controls
mkdir ~/wxgtk_dist/wxGTK/samples/controls
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/controls
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/controls
cp *.cpp ~/wxgtk_dist/wxGTK/samples/controls
cp *.xpm ~/wxgtk_dist/wxGTK/samples/controls
cd icons
mkdir ~/wxgtk_dist/wxGTK/samples/controls/icons
cp *.xpm ~/wxgtk_dist/wxGTK/samples/controls/icons
cd ../..
echo Db sample..
cd db
mkdir ~/wxgtk_dist/wxGTK/samples/db
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/db
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/db
cp *.cpp ~/wxgtk_dist/wxGTK/samples/db
cp *.h ~/wxgtk_dist/wxGTK/samples/db
cp *.xpm ~/wxgtk_dist/wxGTK/samples/db
cd ..
#echo DDE sample..
#
#cd dde
#mkdir ~/wxgtk_dist/wxGTK/samples/dde
#cp Makefile.am ~/wxgtk_dist/wxGTK/samples/dde
#cp Makefile.in ~/wxgtk_dist/wxGTK/samples/dde
#cp *.cpp ~/wxgtk_dist/wxGTK/samples/dde
#cp *.h ~/wxgtk_dist/wxGTK/samples/dde
#cp *.xpm ~/wxgtk_dist/wxGTK/samples/dde
#cd ..
#
echo Dialogs sample..
cd dialogs
mkdir ~/wxgtk_dist/wxGTK/samples/dialogs
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/dialogs
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/dialogs
cp *.cpp ~/wxgtk_dist/wxGTK/samples/dialogs
cp *.h ~/wxgtk_dist/wxGTK/samples/dialogs
cd ..
echo DnD sample..
cd dnd
mkdir ~/wxgtk_dist/wxGTK/samples/dnd
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/dnd
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/dnd
cp *.cpp ~/wxgtk_dist/wxGTK/samples/dnd
cp *.xpm ~/wxgtk_dist/wxGTK/samples/dnd
cd ..
echo Docview sample..
cd docview
mkdir ~/wxgtk_dist/wxGTK/samples/docview
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/docview
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/docview
cp *.cpp ~/wxgtk_dist/wxGTK/samples/docview
cp *.h ~/wxgtk_dist/wxGTK/samples/docview
cp *.xpm ~/wxgtk_dist/wxGTK/samples/docview
cd ..
echo DocvwMDI sample..
cd docvwmdi
mkdir ~/wxgtk_dist/wxGTK/samples/docvwmdi
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/docvwmdi
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/docvwmdi
cp *.cpp ~/wxgtk_dist/wxGTK/samples/docvwmdi
cp *.h ~/wxgtk_dist/wxGTK/samples/docvwmdi
cd ..
echo Dynamic sample..
cd dynamic
mkdir ~/wxgtk_dist/wxGTK/samples/dynamic
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/dynamic
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/dynamic
cp *.cpp ~/wxgtk_dist/wxGTK/samples/dynamic
cp *.xpm ~/wxgtk_dist/wxGTK/samples/dynamic
cd ..
echo Drawing sample..
cd drawing
mkdir ~/wxgtk_dist/wxGTK/samples/drawing
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/drawing
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/drawing
cp *.cpp ~/wxgtk_dist/wxGTK/samples/drawing
cp *.xpm ~/wxgtk_dist/wxGTK/samples/drawing
cd ..
echo Forty sample..
cd forty
mkdir ~/wxgtk_dist/wxGTK/samples/forty
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/forty
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/forty
cp *.cpp ~/wxgtk_dist/wxGTK/samples/forty
cp *.h ~/wxgtk_dist/wxGTK/samples/forty
cp *.xpm ~/wxgtk_dist/wxGTK/samples/forty
cp *.xbm ~/wxgtk_dist/wxGTK/samples/forty
cd ..
echo Fractal sample..
cd fractal
mkdir ~/wxgtk_dist/wxGTK/samples/fractal
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/fractal
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/fractal
cp *.cpp ~/wxgtk_dist/wxGTK/samples/fractal
cd ..
echo Grid sample..
cd grid
mkdir ~/wxgtk_dist/wxGTK/samples/grid
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/grid
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/grid
cp *.cpp ~/wxgtk_dist/wxGTK/samples/grid
cd ..
echo Help sample..
cd help
mkdir ~/wxgtk_dist/wxGTK/samples/help
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/help
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/help
cp *.cpp ~/wxgtk_dist/wxGTK/samples/help
cp *.xpm ~/wxgtk_dist/wxGTK/samples/help
cd doc
mkdir ~/wxgtk_dist/wxGTK/samples/help/doc
cp * ~/wxgtk_dist/wxGTK/samples/help/doc
cd ../..
echo HTML samples..
cd html
mkdir ~/wxgtk_dist/wxGTK/samples/html
cp Makefile.* ~/wxgtk_dist/wxGTK/samples/html
mkdir ~/wxgtk_dist/wxGTK/samples/html/about
cp about/Makefile.* ~/wxgtk_dist/wxGTK/samples/html/about
cp about/about.* ~/wxgtk_dist/wxGTK/samples/html/about
mkdir ~/wxgtk_dist/wxGTK/samples/html/about/data
cp about/data/*.* ~/wxgtk_dist/wxGTK/samples/html/about/data
mkdir ~/wxgtk_dist/wxGTK/samples/html/help
cp help/Makefile.* ~/wxgtk_dist/wxGTK/samples/html/help
cp help/help.* ~/wxgtk_dist/wxGTK/samples/html/help
mkdir ~/wxgtk_dist/wxGTK/samples/html/help/helpfiles
cp help/helpfiles/*.* ~/wxgtk_dist/wxGTK/samples/html/help/helpfiles
mkdir ~/wxgtk_dist/wxGTK/samples/html/printing
cp printing/*.* ~/wxgtk_dist/wxGTK/samples/html/printing
mkdir ~/wxgtk_dist/wxGTK/samples/html/test
cp test/*.* ~/wxgtk_dist/wxGTK/samples/html/test
mkdir ~/wxgtk_dist/wxGTK/samples/html/virtual
cp virtual/*.* ~/wxgtk_dist/wxGTK/samples/html/virtual
mkdir ~/wxgtk_dist/wxGTK/samples/html/widget
cp widget/*.* ~/wxgtk_dist/wxGTK/samples/html/widget
mkdir ~/wxgtk_dist/wxGTK/samples/html/zip
cp zip/*.* ~/wxgtk_dist/wxGTK/samples/html/zip
cd ..
echo Image sample..
cd image
mkdir ~/wxgtk_dist/wxGTK/samples/image
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/image
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/image
cp *.cpp ~/wxgtk_dist/wxGTK/samples/image
cp horse.png ~/wxgtk_dist/wxGTK/samples/image
cp horse.gif ~/wxgtk_dist/wxGTK/samples/image
cp horse.jpg ~/wxgtk_dist/wxGTK/samples/image
cd ..
echo Internat sample..
cd internat
mkdir ~/wxgtk_dist/wxGTK/samples/internat
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/internat
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/internat
cp *.cpp ~/wxgtk_dist/wxGTK/samples/internat
cp *.xpm ~/wxgtk_dist/wxGTK/samples/internat
cp readme.txt ~/wxgtk_dist/wxGTK/samples/internat
cp wxstd.po ~/wxgtk_dist/wxGTK/samples/internat
cd fr
mkdir ~/wxgtk_dist/wxGTK/samples/internat/fr
cp *.?o ~/wxgtk_dist/wxGTK/samples/internat/fr
cd ../..
echo Layout sample..
cd layout
mkdir ~/wxgtk_dist/wxGTK/samples/layout
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/layout
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/layout
cp *.cpp ~/wxgtk_dist/wxGTK/samples/layout
cp *.h ~/wxgtk_dist/wxGTK/samples/layout
cd ..
echo Listctrl sample..
cd listctrl
mkdir ~/wxgtk_dist/wxGTK/samples/listctrl
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/listctrl
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/listctrl
cp *.cpp ~/wxgtk_dist/wxGTK/samples/listctrl
cp *.h ~/wxgtk_dist/wxGTK/samples/listctrl
cp *.xpm ~/wxgtk_dist/wxGTK/samples/listctrl
cd bitmaps
mkdir ~/wxgtk_dist/wxGTK/samples/listctrl/bitmaps
cp *.xpm ~/wxgtk_dist/wxGTK/samples/listctrl/bitmaps
cd ../..
echo MDI sample..
cd mdi
mkdir ~/wxgtk_dist/wxGTK/samples/mdi
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/mdi
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/mdi
cp *.cpp ~/wxgtk_dist/wxGTK/samples/mdi
cp *.h ~/wxgtk_dist/wxGTK/samples/mdi
cp *.xpm ~/wxgtk_dist/wxGTK/samples/mdi
cd bitmaps
mkdir ~/wxgtk_dist/wxGTK/samples/mdi/bitmaps
cp *.xpm ~/wxgtk_dist/wxGTK/samples/mdi/bitmaps
cd ../..
echo Memcheck sample..
cd memcheck
mkdir ~/wxgtk_dist/wxGTK/samples/memcheck
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/memcheck
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/memcheck
cp *.cpp ~/wxgtk_dist/wxGTK/samples/memcheck
cp *.xpm ~/wxgtk_dist/wxGTK/samples/memcheck
cd ..
echo Minifram sample..
cd minifram
mkdir ~/wxgtk_dist/wxGTK/samples/minifram
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/minifram
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/minifram
cp *.cpp ~/wxgtk_dist/wxGTK/samples/minifram
cp *.h ~/wxgtk_dist/wxGTK/samples/minifram
cp *.xpm ~/wxgtk_dist/wxGTK/samples/minifram
cd bitmaps
mkdir ~/wxgtk_dist/wxGTK/samples/minifram/bitmaps
cp *.xpm ~/wxgtk_dist/wxGTK/samples/minifram/bitmaps
cd ../..
echo Notebook sample..
cd notebook
mkdir ~/wxgtk_dist/wxGTK/samples/notebook
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/notebook
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/notebook
cp *.cpp ~/wxgtk_dist/wxGTK/samples/notebook
cp *.h ~/wxgtk_dist/wxGTK/samples/notebook
cd ..
echo PNG sample..
cd png
mkdir ~/wxgtk_dist/wxGTK/samples/png
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/png
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/png
cp *.cpp ~/wxgtk_dist/wxGTK/samples/png
cp *.h ~/wxgtk_dist/wxGTK/samples/png
cp *.png ~/wxgtk_dist/wxGTK/samples/png
cd ..
echo Printing sample..
cd printing
mkdir ~/wxgtk_dist/wxGTK/samples/printing
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/printing
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/printing
cp *.cpp ~/wxgtk_dist/wxGTK/samples/printing
cp *.h ~/wxgtk_dist/wxGTK/samples/printing
cp *.xpm ~/wxgtk_dist/wxGTK/samples/printing
cd ..
echo Proplist sample..
cd proplist
mkdir ~/wxgtk_dist/wxGTK/samples/proplist
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/proplist
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/proplist
cp *.cpp ~/wxgtk_dist/wxGTK/samples/proplist
cp *.h ~/wxgtk_dist/wxGTK/samples/proplist
cd ..
echo Resource sample..
cd resource
mkdir ~/wxgtk_dist/wxGTK/samples/resource
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/resource
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/resource
cp *.cpp ~/wxgtk_dist/wxGTK/samples/resource
cp *.h ~/wxgtk_dist/wxGTK/samples/resource
cp *.wxr ~/wxgtk_dist/wxGTK/samples/resource
cd ..
echo Sashtest sample..
cd sashtest
mkdir ~/wxgtk_dist/wxGTK/samples/sashtest
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/sashtest
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/sashtest
cp *.cpp ~/wxgtk_dist/wxGTK/samples/sashtest
cp *.h ~/wxgtk_dist/wxGTK/samples/sashtest
cd ..
echo Scroll sample..
cd sashtest
mkdir ~/wxgtk_dist/wxGTK/samples/scroll
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/scroll
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/scroll
cp *.cpp ~/wxgtk_dist/wxGTK/samples/scroll
cp *.h ~/wxgtk_dist/wxGTK/samples/scroll
cd ..
echo Splitter sample..
cd splitter
mkdir ~/wxgtk_dist/wxGTK/samples/splitter
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/splitter
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/splitter
cp *.cpp ~/wxgtk_dist/wxGTK/samples/splitter
cd ..
echo Text sample..
cd text
mkdir ~/wxgtk_dist/wxGTK/samples/text
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/text
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/text
cp *.cpp ~/wxgtk_dist/wxGTK/samples/text
cd ..
echo Thread sample..
cd thread
mkdir ~/wxgtk_dist/wxGTK/samples/thread
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/thread
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/thread
cp *.cpp ~/wxgtk_dist/wxGTK/samples/thread
cd ..
echo Toolbar sample..
cd toolbar
mkdir ~/wxgtk_dist/wxGTK/samples/toolbar
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/toolbar
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/toolbar
cp *.cpp ~/wxgtk_dist/wxGTK/samples/toolbar
cp *.h ~/wxgtk_dist/wxGTK/samples/toolbar
cp *.xpm ~/wxgtk_dist/wxGTK/samples/toolbar
cd bitmaps
mkdir ~/wxgtk_dist/wxGTK/samples/toolbar/bitmaps
cp *.xpm ~/wxgtk_dist/wxGTK/samples/toolbar/bitmaps
cd ../..
echo TreeCtrl sample..
cd treectrl
mkdir ~/wxgtk_dist/wxGTK/samples/treectrl
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/treectrl
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/treectrl
cp *.cpp ~/wxgtk_dist/wxGTK/samples/treectrl
cp *.h ~/wxgtk_dist/wxGTK/samples/treectrl
cp *.xpm ~/wxgtk_dist/wxGTK/samples/treectrl
cd ..
echo typetest sample..
cd typetest
mkdir ~/wxgtk_dist/wxGTK/samples/typetest
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/typetest
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/typetest
cp *.cpp ~/wxgtk_dist/wxGTK/samples/typetest
cp *.h ~/wxgtk_dist/wxGTK/samples/typetest
cp *.xpm ~/wxgtk_dist/wxGTK/samples/typetest
cd ..
echo Validate sample..
cd validate
mkdir ~/wxgtk_dist/wxGTK/samples/validate
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/validate
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/validate
cp *.cpp ~/wxgtk_dist/wxGTK/samples/validate
cp *.h ~/wxgtk_dist/wxGTK/samples/validate
cp *.xpm ~/wxgtk_dist/wxGTK/samples/validate
cd ..
echo wxPoem sample..
cd wxpoem
mkdir ~/wxgtk_dist/wxGTK/samples/wxpoem
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/wxpoem
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/wxpoem
cp *.cpp ~/wxgtk_dist/wxGTK/samples/wxpoem
cp *.h ~/wxgtk_dist/wxGTK/samples/wxpoem
cp *.xpm ~/wxgtk_dist/wxGTK/samples/wxpoem
cp wxpoem.dat ~/wxgtk_dist/wxGTK/samples/wxpoem
cp wxpoem.txt ~/wxgtk_dist/wxGTK/samples/wxpoem
cp wxpoem.idx ~/wxgtk_dist/wxGTK/samples/wxpoem
cd ..
echo wxSocket sample..
cd wxsocket
mkdir ~/wxgtk_dist/wxGTK/samples/wxsocket
cp Makefile.am ~/wxgtk_dist/wxGTK/samples/wxsocket
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/wxsocket
cp *.cpp ~/wxgtk_dist/wxGTK/samples/wxsocket
cp *.xpm ~/wxgtk_dist/wxGTK/samples/wxsocket
cd ../..
echo LOCAL CORRECTCIONS
cd distrib/gtk
cp README.txt ~/wxgtk_dist/wxGTK/utils/wxPython
cp Setup ~/wxgtk_dist/wxGTK/utils/wxPython/src
cd ~/wxgtk_dist
tar ch wxGTK | gzip -f9 > wxGTK-2.1.0-b8.tgz

690
distrib/motif/copy_src Executable file
View File

@@ -0,0 +1,690 @@
#! /bin/sh
#
# This script is creates a dir tree in ~/wxmotif_dist which
# can then be packed into an archive
echo --------
echo This script will copy the wxMotif release files into ~/wxmotif_dist
echo --------
echo
mkdir ~/wxmotif_dist
mkdir ~/wxmotif_dist/wxMotif
echo Base dir..
cd ../..
cp wxMotif.spec ~/wxmotif_dist/wxMotif
cp configure ~/wxmotif_dist/wxMotif
cp config.sub ~/wxmotif_dist/wxMotif
cp config.guess ~/wxmotif_dist/wxMotif
cp install-sh ~/wxmotif_dist/wxMotif
cp mkinstalldirs ~/wxmotif_dist/wxMotif
cp wx-config.in ~/wxmotif_dist/wxMotif
cp Makefile.in ~/wxmotif_dist/wxMotif
echo Docs..
cd docs/motif2
cp COPYING.LIB ~/wxmotif_dist/wxMotif
cp install.txt ~/wxmotif_dist/wxMotif/INSTALL.txt
cp changes.txt ~/wxmotif_dist/wxMotif/CHANGES.txt
cp licence.txt ~/wxmotif_dist/wxMotif/LICENCE.txt
cp readme.txt ~/wxmotif_dist/wxMotif/README.txt
cp todo.txt ~/wxmotif_dist/wxMotif/TODO.txt
cd ..
cp symbols.txt ~/wxmotif_dist/wxMotif/SYMBOLS.txt
cd ..
echo Include dir..
mkdir ~/wxmotif_dist/wxMotif/include
cd include
cp Makefile.am ~/wxmotif_dist/wxMotif/include
cp Makefile.in ~/wxmotif_dist/wxMotif/include
mkdir ~/wxmotif_dist/wxMotif/include/wx
cd wx
cp *.h ~/wxmotif_dist/wxMotif/include/wx
cp *.cpp ~/wxmotif_dist/wxMotif/include/wx
cp Makefile.am ~/wxmotif_dist/wxMotif/include/wx
cp Makefile.in ~/wxmotif_dist/wxMotif/include/wx
mkdir ~/wxmotif_dist/wxMotif/include/wx/generic
cd generic
cp *.h ~/wxmotif_dist/wxMotif/include/wx/generic
cp *.xpm ~/wxmotif_dist/wxMotif/include/wx/generic
cp Makefile.am ~/wxmotif_dist/wxMotif/include/wx/generic
cp Makefile.in ~/wxmotif_dist/wxMotif/include/wx/generic
cd ..
mkdir ~/wxmotif_dist/wxMotif/include/wx/html
cd html
cp *.h ~/wxmotif_dist/wxMotif/include/wx/html
cp Makefile.am ~/wxmotif_dist/wxMotif/include/wx/html
cp Makefile.in ~/wxmotif_dist/wxMotif/include/wx/html
cd ..
mkdir ~/wxmotif_dist/wxMotif/include/wx/unix
cd unix
cp *.h ~/wxmotif_dist/wxMotif/include/wx/unix
cp Makefile.am ~/wxmotif_dist/wxMotif/include/wx/unix
cp Makefile.in ~/wxmotif_dist/wxMotif/include/wx/unix
cd ..
mkdir ~/wxmotif_dist/wxMotif/include/wx/msw
cd msw
cp Makefile.am ~/wxmotif_dist/wxMotif/include/wx/msw
cp Makefile.in ~/wxmotif_dist/wxMotif/include/wx/msw
cd ..
mkdir ~/wxmotif_dist/wxMotif/include/wx/motif
cd motif
cp *.h ~/wxmotif_dist/wxMotif/include/wx/motif
rm ~/wxmotif_dist/wxMotif/include/wx/motif/setup.h
cp Makefile.am ~/wxmotif_dist/wxMotif/include/wx/motif
cp Makefile.in ~/wxmotif_dist/wxMotif/include/wx/motif
cd ..
mkdir ~/wxmotif_dist/wxMotif/include/wx/gtk
cd gtk
cp Makefile.am ~/wxmotif_dist/wxMotif/include/wx/gtk
cp Makefile.in ~/wxmotif_dist/wxMotif/include/wx/gtk
cd ..
mkdir ~/wxmotif_dist/wxMotif/include/wx/protocol
cd protocol
cp *.h ~/wxmotif_dist/wxMotif/include/wx/protocol
cp Makefile.am ~/wxmotif_dist/wxMotif/include/wx/protocol
cp Makefile.in ~/wxmotif_dist/wxMotif/include/wx/protocol
cd ..
cd ../..
echo Misc dir..
mkdir ~/wxmotif_dist/wxMotif/misc
cd misc
cp Makefile.am ~/wxmotif_dist/wxMotif/misc
cp Makefile.in ~/wxmotif_dist/wxMotif/misc
mkdir ~/wxmotif_dist/wxMotif/misc/afm
cd afm
cp *.afm ~/wxmotif_dist/wxMotif/misc/afm
cp Makefile.am ~/wxmotif_dist/wxMotif/misc/afm
cp Makefile.in ~/wxmotif_dist/wxMotif/misc/afm
cd ..
mkdir ~/wxmotif_dist/wxMotif/misc/gs_afm
cd gs_afm
cp *.afm ~/wxmotif_dist/wxMotif/misc/gs_afm
cp Makefile.am ~/wxmotif_dist/wxMotif/misc/gs_afm
cp Makefile.in ~/wxmotif_dist/wxMotif/misc/gs_afm
cd ../..
echo Src dir..
cd src
mkdir ~/wxmotif_dist/wxMotif/src
cp Makefile.am ~/wxmotif_dist/wxMotif/src
cp Makefile.in ~/wxmotif_dist/wxMotif/src
cd motif
mkdir ~/wxmotif_dist/wxMotif/src/motif
cp Makefile.am ~/wxmotif_dist/wxMotif/src/motif
cp Makefile.in ~/wxmotif_dist/wxMotif/src/motif
cp *.xbm ~/wxmotif_dist/wxMotif/src/motif
cp *.c ~/wxmotif_dist/wxMotif/src/motif
cp *.cpp ~/wxmotif_dist/wxMotif/src/motif
cd ..
cd common
mkdir ~/wxmotif_dist/wxMotif/src/common
cp glob.inc ~/wxmotif_dist/wxMotif/src/common
cp lexer.l ~/wxmotif_dist/wxMotif/src/common
cp parser.y ~/wxmotif_dist/wxMotif/src/common
cp extended.c ~/wxmotif_dist/wxMotif/src/common
cp unzip.* ~/wxmotif_dist/wxMotif/src/common
cp *.cpp ~/wxmotif_dist/wxMotif/src/common
cd ..
cd html
mkdir ~/wxmotif_dist/wxMotif/src/html
cp *.cpp ~/wxmotif_dist/wxMotif/src/html
cp *.h ~/wxmotif_dist/wxMotif/src/html
cd bitmaps
mkdir ~/wxmotif_dist/wxMotif/src/html/bitmaps
cp *.xpm ~/wxmotif_dist/wxMotif/src/html/bitmaps
cd ../..
cd unix
mkdir ~/wxmotif_dist/wxMotif/src/unix
cp *.cpp ~/wxmotif_dist/wxMotif/src/unix
cp *.h ~/wxmotif_dist/wxMotif/src/unix
cp *.c ~/wxmotif_dist/wxMotif/src/unix
cd ..
cd generic
mkdir ~/wxmotif_dist/wxMotif/src/generic
cp *.cpp ~/wxmotif_dist/wxMotif/src/generic
cd ..
cd iodbc
mkdir ~/wxmotif_dist/wxMotif/src/iodbc
cp * ~/wxmotif_dist/wxMotif/src/iodbc
cd ..
cd zlib
mkdir ~/wxmotif_dist/wxMotif/src/zlib
cp * ~/wxmotif_dist/wxMotif/src/zlib
cd ..
cd png
mkdir ~/wxmotif_dist/wxMotif/src/png
cp * ~/wxmotif_dist/wxMotif/src/png
cd ..
cd jpeg
mkdir ~/wxmotif_dist/wxMotif/src/jpeg
cp * ~/wxmotif_dist/wxMotif/src/jpeg
cd ..
cd ..
echo Utils dir..
cd utils
mkdir ~/wxmotif_dist/wxMotif/utils
cp Makefile.am ~/wxmotif_dist/wxMotif/utils
cp Makefile.in ~/wxmotif_dist/wxMotif/utils
cd ..
echo Samples dir..
cd samples
mkdir ~/wxmotif_dist/wxMotif/samples
cp Makefile.am ~/wxmotif_dist/wxMotif/samples
cp Makefile.in ~/wxmotif_dist/wxMotif/samples
echo Minimal sample..
cd minimal
mkdir ~/wxmotif_dist/wxMotif/samples/minimal
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/minimal
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/minimal
cp minimal.cpp ~/wxmotif_dist/wxMotif/samples/minimal
cp mondrian.xpm ~/wxmotif_dist/wxMotif/samples/minimal
cd ..
echo Bombs sample..
cd bombs
mkdir ~/wxmotif_dist/wxMotif/samples/bombs
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/bombs
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/bombs
cp *.cpp ~/wxmotif_dist/wxMotif/samples/bombs
cp *.h ~/wxmotif_dist/wxMotif/samples/bombs
cp *.xpm ~/wxmotif_dist/wxMotif/samples/bombs
cd ..
echo Caret sample..
cd caret
mkdir ~/wxmotif_dist/wxMotif/samples/caret
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/caret
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/caret
cp *.cpp ~/wxmotif_dist/wxMotif/samples/caret
cp *.xpm ~/wxmotif_dist/wxMotif/samples/caret
cd ..
echo Checklst sample..
cd checklst
mkdir ~/wxmotif_dist/wxMotif/samples/checklst
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/checklst
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/checklst
cp *.cpp ~/wxmotif_dist/wxMotif/samples/checklst
cp *.xpm ~/wxmotif_dist/wxMotif/samples/checklst
cd ..
echo Config sample..
cd config
mkdir ~/wxmotif_dist/wxMotif/samples/config
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/config
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/config
cp *.cpp ~/wxmotif_dist/wxMotif/samples/config
cd ..
echo Controls sample..
cd controls
mkdir ~/wxmotif_dist/wxMotif/samples/controls
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/controls
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/controls
cp *.cpp ~/wxmotif_dist/wxMotif/samples/controls
cp *.xpm ~/wxmotif_dist/wxMotif/samples/controls
cd icons
mkdir ~/wxmotif_dist/wxMotif/samples/controls/icons
cp *.xpm ~/wxmotif_dist/wxMotif/samples/controls/icons
cd ../..
echo Db sample..
cd db
mkdir ~/wxmotif_dist/wxMotif/samples/db
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/db
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/db
cp *.cpp ~/wxmotif_dist/wxMotif/samples/db
cp *.h ~/wxmotif_dist/wxMotif/samples/db
cp *.xpm ~/wxmotif_dist/wxMotif/samples/db
cd ..
echo Dialogs sample..
cd dialogs
mkdir ~/wxmotif_dist/wxMotif/samples/dialogs
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/dialogs
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/dialogs
cp *.cpp ~/wxmotif_dist/wxMotif/samples/dialogs
cp *.h ~/wxmotif_dist/wxMotif/samples/dialogs
cd ..
echo DnD sample..
cd dnd
mkdir ~/wxmotif_dist/wxMotif/samples/dnd
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/dnd
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/dnd
cp *.cpp ~/wxmotif_dist/wxMotif/samples/dnd
cp *.xpm ~/wxmotif_dist/wxMotif/samples/dnd
cd ..
echo Docview sample..
cd docview
mkdir ~/wxmotif_dist/wxMotif/samples/docview
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/docview
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/docview
cp *.cpp ~/wxmotif_dist/wxMotif/samples/docview
cp *.h ~/wxmotif_dist/wxMotif/samples/docview
cp *.xpm ~/wxmotif_dist/wxMotif/samples/docview
cd ..
echo DocvwMDI sample..
cd docvwmdi
mkdir ~/wxmotif_dist/wxMotif/samples/docvwmdi
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/docvwmdi
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/docvwmdi
cp *.cpp ~/wxmotif_dist/wxMotif/samples/docvwmdi
cp *.h ~/wxmotif_dist/wxMotif/samples/docvwmdi
cd ..
echo Dynamic sample..
cd dynamic
mkdir ~/wxmotif_dist/wxMotif/samples/dynamic
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/dynamic
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/dynamic
cp *.cpp ~/wxmotif_dist/wxMotif/samples/dynamic
cp *.xpm ~/wxmotif_dist/wxMotif/samples/dynamic
cd ..
echo Drawing sample..
cd drawing
mkdir ~/wxmotif_dist/wxMotif/samples/drawing
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/drawing
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/drawing
cp *.cpp ~/wxmotif_dist/wxMotif/samples/drawing
cp *.xpm ~/wxmotif_dist/wxMotif/samples/drawing
cd ..
echo Forty sample..
cd forty
mkdir ~/wxmotif_dist/wxMotif/samples/forty
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/forty
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/forty
cp *.cpp ~/wxmotif_dist/wxMotif/samples/forty
cp *.h ~/wxmotif_dist/wxMotif/samples/forty
cp *.xpm ~/wxmotif_dist/wxMotif/samples/forty
cp *.xbm ~/wxmotif_dist/wxMotif/samples/forty
cd ..
echo Fractal sample..
cd fractal
mkdir ~/wxmotif_dist/wxMotif/samples/fractal
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/fractal
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/fractal
cp *.cpp ~/wxmotif_dist/wxMotif/samples/fractal
cd ..
echo Grid sample..
cd grid
mkdir ~/wxmotif_dist/wxMotif/samples/grid
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/grid
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/grid
cp *.cpp ~/wxmotif_dist/wxMotif/samples/grid
cd ..
echo Help sample..
cd help
mkdir ~/wxmotif_dist/wxMotif/samples/help
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/help
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/help
cp *.cpp ~/wxmotif_dist/wxMotif/samples/help
cp *.xpm ~/wxmotif_dist/wxMotif/samples/help
cd doc
mkdir ~/wxmotif_dist/wxMotif/samples/help/doc
cp * ~/wxmotif_dist/wxMotif/samples/help/doc
cd ../..
echo HTML samples..
cd html
mkdir ~/wxmotif_dist/wxMotif/samples/html
cp Makefile.* ~/wxmotif_dist/wxMotif/samples/html
mkdir ~/wxmotif_dist/wxMotif/samples/html/about
cp about/Makefile.* ~/wxmotif_dist/wxMotif/samples/html/about
cp about/about.* ~/wxmotif_dist/wxMotif/samples/html/about
mkdir ~/wxmotif_dist/wxMotif/samples/html/about/data
cp about/data/*.* ~/wxmotif_dist/wxMotif/samples/html/about/data
mkdir ~/wxmotif_dist/wxMotif/samples/html/help
cp help/Makefile.* ~/wxmotif_dist/wxMotif/samples/html/help
cp help/help.* ~/wxmotif_dist/wxMotif/samples/html/help
mkdir ~/wxmotif_dist/wxMotif/samples/html/help/helpfiles
cp help/helpfiles/*.* ~/wxmotif_dist/wxMotif/samples/html/help/helpfiles
mkdir ~/wxmotif_dist/wxMotif/samples/html/printing
cp printing/*.* ~/wxmotif_dist/wxMotif/samples/html/printing
mkdir ~/wxmotif_dist/wxMotif/samples/html/test
cp test/*.* ~/wxmotif_dist/wxMotif/samples/html/test
mkdir ~/wxmotif_dist/wxMotif/samples/html/virtual
cp virtual/*.* ~/wxgtk_dist/wxGTK/samples/html/virtual
mkdir ~/wxmotif_dist/wxMotif/samples/html/widget
cp widget/*.* ~/wxmotif_dist/wxMotif/samples/html/widget
mkdir ~/wxmotif_dist/wxMotif/samples/html/zip
cp zip/*.* ~/wxmotif_dist/wxMotif/samples/html/zip
cd ..
echo Image sample..
cd image
mkdir ~/wxmotif_dist/wxMotif/samples/image
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/image
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/image
cp *.cpp ~/wxmotif_dist/wxMotif/samples/image
cp horse.png ~/wxmotif_dist/wxMotif/samples/image
cp horse.gif ~/wxmotif_dist/wxMotif/samples/image
cp horse.jpg ~/wxmotif_dist/wxMotif/samples/image
cd ..
echo Internat sample..
cd internat
mkdir ~/wxmotif_dist/wxMotif/samples/internat
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/internat
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/internat
cp *.cpp ~/wxmotif_dist/wxMotif/samples/internat
cp *.xpm ~/wxmotif_dist/wxMotif/samples/internat
cp readme.txt ~/wxmotif_dist/wxMotif/samples/internat
cp wxstd.po ~/wxmotif_dist/wxMotif/samples/internat
cd fr
mkdir ~/wxmotif_dist/wxMotif/samples/internat/fr
cp *.?o ~/wxmotif_dist/wxMotif/samples/internat/fr
cd ../..
echo Layout sample..
cd layout
mkdir ~/wxmotif_dist/wxMotif/samples/layout
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/layout
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/layout
cp *.cpp ~/wxmotif_dist/wxMotif/samples/layout
cp *.h ~/wxmotif_dist/wxMotif/samples/layout
cd ..
echo Listctrl sample..
cd listctrl
mkdir ~/wxmotif_dist/wxMotif/samples/listctrl
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/listctrl
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/listctrl
cp *.cpp ~/wxmotif_dist/wxMotif/samples/listctrl
cp *.h ~/wxmotif_dist/wxMotif/samples/listctrl
cp *.xpm ~/wxmotif_dist/wxMotif/samples/listctrl
cd bitmaps
mkdir ~/wxmotif_dist/wxMotif/samples/listctrl/bitmaps
cp *.xpm ~/wxmotif_dist/wxMotif/samples/listctrl/bitmaps
cd ../..
echo MDI sample..
cd mdi
mkdir ~/wxmotif_dist/wxMotif/samples/mdi
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/mdi
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/mdi
cp *.cpp ~/wxmotif_dist/wxMotif/samples/mdi
cp *.h ~/wxmotif_dist/wxMotif/samples/mdi
cp *.xpm ~/wxmotif_dist/wxMotif/samples/mdi
cd bitmaps
mkdir ~/wxmotif_dist/wxMotif/samples/mdi/bitmaps
cp *.xpm ~/wxmotif_dist/wxMotif/samples/mdi/bitmaps
cd ../..
echo Memcheck sample..
cd memcheck
mkdir ~/wxmotif_dist/wxMotif/samples/memcheck
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/memcheck
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/memcheck
cp *.cpp ~/wxmotif_dist/wxMotif/samples/memcheck
cp *.xpm ~/wxmotif_dist/wxMotif/samples/memcheck
cd ..
echo Minifram sample..
cd minifram
mkdir ~/wxmotif_dist/wxMotif/samples/minifram
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/minifram
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/minifram
cp *.cpp ~/wxmotif_dist/wxMotif/samples/minifram
cp *.h ~/wxmotif_dist/wxMotif/samples/minifram
cp *.xpm ~/wxmotif_dist/wxMotif/samples/minifram
cd bitmaps
mkdir ~/wxmotif_dist/wxMotif/samples/minifram/bitmaps
cp *.xpm ~/wxmotif_dist/wxMotif/samples/minifram/bitmaps
cd ../..
echo Notebook sample..
cd notebook
mkdir ~/wxmotif_dist/wxMotif/samples/notebook
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/notebook
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/notebook
cp *.cpp ~/wxmotif_dist/wxMotif/samples/notebook
cp *.h ~/wxmotif_dist/wxMotif/samples/notebook
cd ..
echo PNG sample..
cd png
mkdir ~/wxmotif_dist/wxMotif/samples/png
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/png
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/png
cp *.cpp ~/wxmotif_dist/wxMotif/samples/png
cp *.h ~/wxmotif_dist/wxMotif/samples/png
cp *.png ~/wxmotif_dist/wxMotif/samples/png
cd ..
echo Printing sample..
cd printing
mkdir ~/wxmotif_dist/wxMotif/samples/printing
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/printing
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/printing
cp *.cpp ~/wxmotif_dist/wxMotif/samples/printing
cp *.h ~/wxmotif_dist/wxMotif/samples/printing
cp *.xpm ~/wxmotif_dist/wxMotif/samples/printing
cd ..
echo Proplist sample..
cd proplist
mkdir ~/wxmotif_dist/wxMotif/samples/proplist
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/proplist
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/proplist
cp *.cpp ~/wxmotif_dist/wxMotif/samples/proplist
cp *.h ~/wxmotif_dist/wxMotif/samples/proplist
cd ..
echo Resource sample..
cd resource
mkdir ~/wxmotif_dist/wxMotif/samples/resource
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/resource
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/resource
cp *.cpp ~/wxmotif_dist/wxMotif/samples/resource
cp *.h ~/wxmotif_dist/wxMotif/samples/resource
cp *.wxr ~/wxmotif_dist/wxMotif/samples/resource
cd ..
echo Sashtest sample..
cd sashtest
mkdir ~/wxmotif_dist/wxMotif/samples/sashtest
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/sashtest
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/sashtest
cp *.cpp ~/wxmotif_dist/wxMotif/samples/sashtest
cp *.h ~/wxmotif_dist/wxMotif/samples/sashtest
cd ..
echo Scroll sample..
cd sashtest
mkdir ~/wxmotif_dist/wxMotif/samples/scroll
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/scroll
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/scroll
cp *.cpp ~/wxmotif_dist/wxMotif/samples/scroll
cp *.h ~/wxmotif_dist/wxMotif/samples/scroll
cd ..
echo Splitter sample..
cd splitter
mkdir ~/wxmotif_dist/wxMotif/samples/splitter
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/splitter
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/splitter
cp *.cpp ~/wxmotif_dist/wxMotif/samples/splitter
cd ..
cd tab
mkdir ~/wxmotif_dist/wxMotif/samples/tab
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/tab
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/tab
cp *.cpp ~/wxmotif_dist/wxMotif/samples/tab
cp *.h ~/wxmotif_dist/wxMotif/samples/tab
cd ..
echo Text sample..
cd text
mkdir ~/wxmotif_dist/wxMotif/samples/text
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/text
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/text
cp *.cpp ~/wxmotif_dist/wxMotif/samples/text
cd ..
echo Thread sample..
cd thread
mkdir ~/wxmotif_dist/wxMotif/samples/thread
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/thread
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/thread
cp *.cpp ~/wxmotif_dist/wxMotif/samples/thread
cd ..
echo Toolbar sample..
cd toolbar
mkdir ~/wxmotif_dist/wxMotif/samples/toolbar
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/toolbar
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/toolbar
cp *.cpp ~/wxmotif_dist/wxMotif/samples/toolbar
cp *.h ~/wxmotif_dist/wxMotif/samples/toolbar
cp *.xpm ~/wxmotif_dist/wxMotif/samples/toolbar
cd bitmaps
mkdir ~/wxmotif_dist/wxMotif/samples/toolbar/bitmaps
cp *.xpm ~/wxmotif_dist/wxMotif/samples/toolbar/bitmaps
cd ../..
echo TreeCtrl sample..
cd treectrl
mkdir ~/wxmotif_dist/wxMotif/samples/treectrl
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/treectrl
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/treectrl
cp *.cpp ~/wxmotif_dist/wxMotif/samples/treectrl
cp *.h ~/wxmotif_dist/wxMotif/samples/treectrl
cp *.xpm ~/wxmotif_dist/wxMotif/samples/treectrl
cd ..
echo typetest sample..
cd typetest
mkdir ~/wxmotif_dist/wxMotif/samples/typetest
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/typetest
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/typetest
cp *.cpp ~/wxmotif_dist/wxMotif/samples/typetest
cp *.h ~/wxmotif_dist/wxMotif/samples/typetest
cp *.xpm ~/wxmotif_dist/wxMotif/samples/typetest
cd ..
echo Validate sample..
cd validate
mkdir ~/wxmotif_dist/wxMotif/samples/validate
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/validate
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/validate
cp *.cpp ~/wxmotif_dist/wxMotif/samples/validate
cp *.h ~/wxmotif_dist/wxMotif/samples/validate
cp *.xpm ~/wxmotif_dist/wxMotif/samples/validate
cd ..
echo wxPoem sample..
cd wxpoem
mkdir ~/wxmotif_dist/wxMotif/samples/wxpoem
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/wxpoem
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/wxpoem
cp *.cpp ~/wxmotif_dist/wxMotif/samples/wxpoem
cp *.h ~/wxmotif_dist/wxMotif/samples/wxpoem
cp *.xpm ~/wxmotif_dist/wxMotif/samples/wxpoem
cp wxpoem.dat ~/wxmotif_dist/wxMotif/samples/wxpoem
cp wxpoem.txt ~/wxmotif_dist/wxMotif/samples/wxpoem
cp wxpoem.idx ~/wxmotif_dist/wxMotif/samples/wxpoem
cd ..
echo wxSocket sample..
cd wxsocket
mkdir ~/wxmotif_dist/wxMotif/samples/wxsocket
cp Makefile.am ~/wxmotif_dist/wxMotif/samples/wxsocket
cp Makefile.in ~/wxmotif_dist/wxMotif/samples/wxsocket
cp *.cpp ~/wxmotif_dist/wxMotif/samples/wxsocket
cp *.xpm ~/wxmotif_dist/wxMotif/samples/wxsocket
cd ../..
cd ~/wxmotif_dist
tar ch wxMotif | gzip -f9 > wxMotif-2.1.0-b8.tgz

2
distrib/msw/bc.rsp Normal file
View File

@@ -0,0 +1,2 @@
src/bc32.ide
samples/bc32.ide

736
distrib/msw/copy_src.bat Executable file
View File

@@ -0,0 +1,736 @@
echo --------
echo This script will copy the wxMSW release files into \wxmsw_dist
echo --------
echo
md \wxmsw_dist
md \wxmsw_dist\wxMSW
echo Base dir..
cd ..\..
echo Lib..
cd lib
md \wxmsw_dist\wxMSW\lib
copy dummy \wxmsw_dist\wxMSW\lib
cd ..
echo Locale..
cd locale
md \wxmsw_dist\wxMSW\locale
copy *.?? \wxmsw_dist\wxMSW\locale
cd ..
echo Docs..
cd docs\wine
copy COPYING.LIB \wxmsw_dist\wxMSW
copy licence.txt \wxmsw_dist\wxMSW\LICENCE.txt
cd ..\msw
copy install.txt \wxmsw_dist\wxMSW\INSTALL.txt
copy readme.txt \wxmsw_dist\wxMSW\README.txt
copy todo.txt \wxmsw_dist\wxMSW\TODO.txt
cd ..
copy symbols.txt \wxmsw_dist\wxMSW\SYMBOLS.txt
cd ..
echo Include dir..
md \wxmsw_dist\wxMSW\include
cd include
copy wx_*.* \wxmsw_dist\wxMSW\include
md \wxmsw_dist\wxMSW\include\wx
cd wx
copy *.h \wxmsw_dist\wxMSW\include\wx
copy *.cpp \wxmsw_dist\wxMSW\include\wx
md \wxmsw_dist\wxMSW\include\wx\generic
cd generic
copy *.h \wxmsw_dist\wxMSW\include\wx\generic
cd ..
md \wxmsw_dist\wxMSW\include\wx\html
cd html
copy *.h \wxmsw_dist\wxMSW\include\wx\html
md \wxmsw_dist\wxMSW\include\wx\html\msw
cd msw
copy *.* \wxmsw_dist\wxMSW\include\wx\html\msw
cd ..\..
md \wxmsw_dist\wxMSW\include\wx\msw
cd msw
copy *.* \wxmsw_dist\wxMSW\include\wx\msw
rem del \wxmsw_dist\wxMSW\include\wx\msw\setup.h
del \wxmsw_dist\wxMSW\include\wx\msw\Makefile.am
del \wxmsw_dist\wxMSW\include\wx\msw\Makefile.in
md \wxmsw_dist\wxMSW\include\wx\msw\gnuwin32
cd gnuwin32
copy *.h \wxmsw_dist\wxMSW\include\wx\msw\gnuwin32
cd ..
md \wxmsw_dist\wxMSW\include\wx\msw\ole
cd ole
copy *.h \wxmsw_dist\wxMSW\include\wx\msw\ole
cd ..
cd ctl3d
copy *.h \wxmsw_dist\wxMSW\include\wx\msw\ctl3d
cd ..
cd ..
md \wxmsw_dist\wxMSW\include\wx\protocol
cd protocol
copy *.h \wxmsw_dist\wxMSW\include\wx\protocol
cd ..
cd ..\..
echo Src dir..
cd src
md \wxmsw_dist\wxMSW\src
copy *.* \wxmsw_dist\wxMSW\src
del Makefile.am \wxmsw_dist\wxMSW\src\Makefile.am
del Makefile.in \wxmsw_dist\wxMSW\src\Makefile.in
cd msw
md \wxmsw_dist\wxMSW\src\msw
md \wxmsw_dist\wxMSW\src\msw\ole
copy ole\*.cpp \wxmsw_dist\wxMSW\src\msw\ole
copy *.cpp \wxmsw_dist\wxMSW\src\msw
copy *.c \wxmsw_dist\wxMSW\src\msw
copy *.def \wxmsw_dist\wxMSW\src\msw
copy makefile.* \wxmsw_dist\wxMSW\src\msw
del Makefile.am \wxmsw_dist\wxMSW\src\msw\Makefile.am
del Makefile.in \wxmsw_dist\wxMSW\src\msw\Makefile.in
cd ..
cd common
md \wxmsw_dist\wxMSW\src\common
copy glob.inc \wxmsw_dist\wxMSW\src\common
copy lexer.l \wxmsw_dist\wxMSW\src\common
copy parser.y \wxmsw_dist\wxMSW\src\common
copy *.c \wxmsw_dist\wxMSW\src\common
copy *.h \wxmsw_dist\wxMSW\src\common
copy *.cpp \wxmsw_dist\wxMSW\src\common
cd ..
cd html
md \wxmsw_dist\wxMSW\src\html
copy *.cpp \wxmsw_dist\wxMSW\src\html
copy *.h \wxmsw_dist\wxMSW\src\html
cd ..
cd generic
md \wxmsw_dist\wxMSW\src\generic
copy *.cpp \wxmsw_dist\wxMSW\src\generic
cd ..
cd zlib
md \wxmsw_dist\wxMSW\src\zlib
copy *.* \wxmsw_dist\wxMSW\src\zlib
cd ..
cd png
md \wxmsw_dist\wxMSW\src\png
copy *.* \wxmsw_dist\wxMSW\src\png
cd ..
cd jpeg
md \wxmsw_dist\wxMSW\src\jpeg
copy *.* \wxmsw_dist\wxMSW\src\jpeg
cd ..
cd xpm
md \wxmsw_dist\wxMSW\src\xpm
copy *.* \wxmsw_dist\wxMSW\src\xpm
cd ..
cd ..
echo Utils dir..
cd utils
md \wxmsw_dist\wxMSW\utils
echo wxGLCanvas..
cd glcanvas
md \wxmsw_dist\wxMSW\utils\glcanvas
copy .\docs\notes.txt \wxmsw_dist\wxMSW\utils\glcanvas\NOTES.txt
md \wxmsw_dist\wxMSW\utils\glcanvas\win
copy .\win\glcanvas.cpp \wxmsw_dist\wxMSW\utils\glcanvas\win
copy .\win\glcanvas.h \wxmsw_dist\wxMSW\utils\glcanvas\win
copy .\win\makefile.* \wxmsw_dist\wxMSW\utils\glcanvas\win
md \wxmsw_dist\wxMSW\utils\glcanvas\samples
md \wxmsw_dist\wxMSW\utils\glcanvas\samples\cube
md \wxmsw_dist\wxMSW\utils\glcanvas\samples\isosurf
md \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin
cd samples\cube
copy Makefile.* \wxmsw_dist\wxMSW\utils\glcanvas\samples\cube
copy cube.rc \wxmsw_dist\wxMSW\utils\glcanvas\samples\cube
copy cube.h \wxmsw_dist\wxMSW\utils\glcanvas\samples\cube
copy cube.cpp \wxmsw_dist\wxMSW\utils\glcanvas\samples\cube
copy mondrian.ico \wxmsw_dist\wxMSW\utils\glcanvas\samples\cube
cd ..
cd isosurf
copy Makefile.* \wxmsw_dist\wxMSW\utils\glcanvas\samples\isosurf
copy isosurf.h \wxmsw_dist\wxMSW\utils\glcanvas\samples\isosurf
copy isosurf.rc \wxmsw_dist\wxMSW\utils\glcanvas\samples\isosurf
copy isosurf.cpp \wxmsw_dist\wxMSW\utils\glcanvas\samples\isosurf
copy isosurf.dat.gz \wxmsw_dist\wxMSW\utils\glcanvas\samples\isosurf
copy mondrian.ico \wxmsw_dist\wxMSW\utils\glcanvas\samples\isosurf
cd ..
cd penguin
copy Makefile.* \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin
copy penguin.rc \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin
copy penguin.h \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin
copy penguin.cpp \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin
copy trackball.h \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin
copy trackball.c \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin
copy lw.h \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin
copy lw.cpp \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin
copy penguin.lwo \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin
copy mondrian.ico \wxmsw_dist\wxMSW\utils\glcanvas\samples\penguin
cd ..\..\..
echo DialogEd..
cd dialoged\src
md \wxmsw_dist\wxMSW\utils\dialoged
md \wxmsw_dist\wxMSW\utils\dialoged\src
copy Makefile.* \wxmsw_dist\wxMSW\utils\dialoged\src
copy dialoged.def \wxmsw_dist\wxMSW\utils\dialoged\src
copy dialoged.rc \wxmsw_dist\wxMSW\utils\dialoged\src
copy dialoged.ico \wxmsw_dist\wxMSW\utils\dialoged\src
copy dialoged.cpp \wxmsw_dist\wxMSW\utils\dialoged\src
copy dlghndlr.cpp \wxmsw_dist\wxMSW\utils\dialoged\src
copy edlist.cpp \wxmsw_dist\wxMSW\utils\dialoged\src
copy edtree.cpp \wxmsw_dist\wxMSW\utils\dialoged\src
copy reseditr.cpp \wxmsw_dist\wxMSW\utils\dialoged\src
copy reswrite.cpp \wxmsw_dist\wxMSW\utils\dialoged\src
copy symbtabl.cpp \wxmsw_dist\wxMSW\utils\dialoged\src
copy winprop.cpp \wxmsw_dist\wxMSW\utils\dialoged\src
copy winstyle.cpp \wxmsw_dist\wxMSW\utils\dialoged\src
copy dialoged.h \wxmsw_dist\wxMSW\utils\dialoged\src
copy dlghndlr.h \wxmsw_dist\wxMSW\utils\dialoged\src
copy edlist.h \wxmsw_dist\wxMSW\utils\dialoged\src
copy edtree.h \wxmsw_dist\wxMSW\utils\dialoged\src
copy reseditr.h \wxmsw_dist\wxMSW\utils\dialoged\src
copy symbtabl.h \wxmsw_dist\wxMSW\utils\dialoged\src
copy winprop.h \wxmsw_dist\wxMSW\utils\dialoged\src
copy winstyle.h \wxmsw_dist\wxMSW\utils\dialoged\src
cd bitmaps
md \wxmsw_dist\wxMSW\utils\dialoged\src\bitmaps
copy *.bmp \wxmsw_dist\wxMSW\utils\dialoged\src\bitmaps
copy *.ico \wxmsw_dist\wxMSW\utils\dialoged\src\bitmaps
cd ..\..\..
cd ..
echo Samples dir..
cd samples
md \wxmsw_dist\wxMSW\samples
copy makefile.* \wxmsw_dist\wxMSW\samples
echo Minimal sample..
cd minimal
md \wxmsw_dist\wxMSW\samples\minimal
copy Makefile.* \wxmsw_dist\wxMSW\samples\minimal
copy *.def \wxmsw_dist\wxMSW\samples\minimal
copy *.rc \wxmsw_dist\wxMSW\samples\minimal
copy minimal.cpp \wxmsw_dist\wxMSW\samples\minimal
copy mondrian.ico \wxmsw_dist\wxMSW\samples\minimal
cd ..
echo Bombs sample..
cd bombs
md \wxmsw_dist\wxMSW\samples\bombs
copy Makefile.* \wxmsw_dist\wxMSW\samples\bombs
copy *.cpp \wxmsw_dist\wxMSW\samples\bombs
copy *.h \wxmsw_dist\wxMSW\samples\bombs
copy *.ico \wxmsw_dist\wxMSW\samples\bombs
copy *.def \wxmsw_dist\wxMSW\samples\bombs
copy *.rc \wxmsw_dist\wxMSW\samples\bombs
cd ..
echo Caret sample..
cd caret
md \wxmsw_dist\wxMSW\samples\caret
copy Makefile.* \wxmsw_dist\wxMSW\samples\caret
copy *.cpp \wxmsw_dist\wxMSW\samples\caret
copy *.h \wxmsw_dist\wxMSW\samples\caret
copy *.ico \wxmsw_dist\wxMSW\samples\caret
copy *.def \wxmsw_dist\wxMSW\samples\caret
copy *.rc \wxmsw_dist\wxMSW\samples\caret
cd ..
echo Checklst sample..
cd checklst
md \wxmsw_dist\wxMSW\samples\checklst
copy Makefile.* \wxmsw_dist\wxMSW\samples\checklst
copy *.h \wxmsw_dist\wxMSW\samples\checklst
copy *.cpp \wxmsw_dist\wxMSW\samples\checklst
copy *.ico \wxmsw_dist\wxMSW\samples\checklst
copy *.def \wxmsw_dist\wxMSW\samples\checklst
copy *.rc \wxmsw_dist\wxMSW\samples\checklst
cd ..
echo Config sample..
cd config
md \wxmsw_dist\wxMSW\samples\config
copy Makefile.* \wxmsw_dist\wxMSW\samples\config
copy *.h \wxmsw_dist\wxMSW\samples\config
copy *.cpp \wxmsw_dist\wxMSW\samples\config
copy *.ico \wxmsw_dist\wxMSW\samples\config
copy *.def \wxmsw_dist\wxMSW\samples\config
copy *.rc \wxmsw_dist\wxMSW\samples\config
cd ..
echo Controls sample..
cd controls
md \wxmsw_dist\wxMSW\samples\controls
copy Makefile.* \wxmsw_dist\wxMSW\samples\controls
copy *.cpp \wxmsw_dist\wxMSW\samples\controls
copy *.h \wxmsw_dist\wxMSW\samples\controls
copy *.rc \wxmsw_dist\wxMSW\samples\controls
copy *.def \wxmsw_dist\wxMSW\samples\controls
copy *.ico \wxmsw_dist\wxMSW\samples\controls
cd icons
md \wxmsw_dist\wxMSW\samples\controls\icons
copy *.* \wxmsw_dist\wxMSW\samples\controls\icons
cd ..\..
echo Dialogs sample..
cd dialogs
md \wxmsw_dist\wxMSW\samples\dialogs
copy Makefile.* \wxmsw_dist\wxMSW\samples\dialogs
copy *.cpp \wxmsw_dist\wxMSW\samples\dialogs
copy *.h \wxmsw_dist\wxMSW\samples\dialogs
copy *.def \wxmsw_dist\wxMSW\samples\dialogs
copy *.rc \wxmsw_dist\wxMSW\samples\dialogs
copy *.ico \wxmsw_dist\wxMSW\samples\dialogs
cd ..
echo DnD sample..
cd dnd
md \wxmsw_dist\wxMSW\samples\dnd
copy Makefile.* \wxmsw_dist\wxMSW\samples\dnd
copy *.cpp \wxmsw_dist\wxMSW\samples\dnd
copy *.h \wxmsw_dist\wxMSW\samples\dnd
copy *.def \wxmsw_dist\wxMSW\samples\dnd
copy *.rc \wxmsw_dist\wxMSW\samples\dnd
copy *.ico \wxmsw_dist\wxMSW\samples\dnd
cd ..
echo Docview sample..
cd docview
md \wxmsw_dist\wxMSW\samples\docview
copy Makefile.* \wxmsw_dist\wxMSW\samples\docview
copy *.cpp \wxmsw_dist\wxMSW\samples\docview
copy *.h \wxmsw_dist\wxMSW\samples\docview
copy *.def \wxmsw_dist\wxMSW\samples\docview
copy *.rc \wxmsw_dist\wxMSW\samples\docview
copy *.ico \wxmsw_dist\wxMSW\samples\docview
cd ..
echo DocvwMDI sample..
cd docvwmdi
md \wxmsw_dist\wxMSW\samples\docvwmdi
copy Makefile.* \wxmsw_dist\wxMSW\samples\docvwmdi
copy *.cpp \wxmsw_dist\wxMSW\samples\docvwmdi
copy *.h \wxmsw_dist\wxMSW\samples\docvwmdi
copy *.def \wxmsw_dist\wxMSW\samples\docvwmdi
copy *.rc \wxmsw_dist\wxMSW\samples\docvwmdi
copy *.ico \wxmsw_dist\wxMSW\samples\docvwmdi
cd ..
echo Dynamic sample..
cd dynamic
md \wxmsw_dist\wxMSW\samples\dynamic
copy Makefile.* \wxmsw_dist\wxMSW\samples\dynamic
copy *.cpp \wxmsw_dist\wxMSW\samples\dynamic
copy *.h \wxmsw_dist\wxMSW\samples\dynamic
copy *.def \wxmsw_dist\wxMSW\samples\dynamic
copy *.rc \wxmsw_dist\wxMSW\samples\dynamic
copy *.ico \wxmsw_dist\wxMSW\samples\dynamic
cd ..
echo Drawing sample..
cd drawing
md \wxmsw_dist\wxMSW\samples\drawing
copy Makefile.* \wxmsw_dist\wxMSW\samples\drawing
copy *.cpp \wxmsw_dist\wxMSW\samples\drawing
copy *.ico \wxmsw_dist\wxMSW\samples\drawing
copy *.h \wxmsw_dist\wxMSW\samples\drawing
copy *.rc \wxmsw_dist\wxMSW\samples\drawing
copy *.def \wxmsw_dist\wxMSW\samples\drawing
cd ..
echo Forty sample..
cd forty
md \wxmsw_dist\wxMSW\samples\forty
copy Makefile.* \wxmsw_dist\wxMSW\samples\forty
copy *.cpp \wxmsw_dist\wxMSW\samples\forty
copy *.h \wxmsw_dist\wxMSW\samples\forty
copy *.def \wxmsw_dist\wxMSW\samples\forty
copy *.rc \wxmsw_dist\wxMSW\samples\forty
copy *.ico \wxmsw_dist\wxMSW\samples\forty
copy *.bmp \wxmsw_dist\wxMSW\samples\forty
copy *.xpm \wxmsw_dist\wxMSW\samples\forty
copy *.xbm \wxmsw_dist\wxMSW\samples\forty
cd ..
echo Fractal sample..
cd fractal
md \wxmsw_dist\wxMSW\samples\fractal
copy Makefile.* \wxmsw_dist\wxMSW\samples\fractal
copy *.cpp \wxmsw_dist\wxMSW\samples\fractal
copy *.h \wxmsw_dist\wxMSW\samples\fractal
copy *.def \wxmsw_dist\wxMSW\samples\fractal
copy *.rc \wxmsw_dist\wxMSW\samples\fractal
copy *.ico \wxmsw_dist\wxMSW\samples\fractal
cd ..
echo Grid sample..
cd grid
md \wxmsw_dist\wxMSW\samples\grid
copy Makefile.* \wxmsw_dist\wxMSW\samples\grid
copy *.cpp \wxmsw_dist\wxMSW\samples\grid
copy *.h \wxmsw_dist\wxMSW\samples\grid
copy *.def \wxmsw_dist\wxMSW\samples\grid
copy *.rc \wxmsw_dist\wxMSW\samples\grid
copy *.ico \wxmsw_dist\wxMSW\samples\grid
cd ..
echo Help sample..
cd help
md \wxmsw_dist\wxMSW\samples\help
copy Makefile.* \wxmsw_dist\wxMSW\samples\help
copy *.cpp \wxmsw_dist\wxMSW\samples\help
copy *.def \wxmsw_dist\wxMSW\samples\help
copy *.rc \wxmsw_dist\wxMSW\samples\help
copy *.ico \wxmsw_dist\wxMSW\samples\help
copy *.xpm \wxmsw_dist\wxMSW\samples\help
cd doc
md \wxmsw_dist\wxMSW\samples\help\doc
copy *.* \wxmsw_dist\wxMSW\samples\help\doc
cd ..\..
echo Image sample..
cd image
md \wxmsw_dist\wxMSW\samples\image
copy Makefile.* \wxmsw_dist\wxMSW\samples\image
copy *.cpp \wxmsw_dist\wxMSW\samples\image
copy *.def \wxmsw_dist\wxMSW\samples\image
copy *.rc \wxmsw_dist\wxMSW\samples\image
copy *.ico \wxmsw_dist\wxMSW\samples\image
copy horse.png \wxmsw_dist\wxMSW\samples\image
copy horse.gif \wxmsw_dist\wxMSW\samples\image
copy horse.jpg \wxmsw_dist\wxMSW\samples\image
cd ..
echo Internat sample..
cd internat
md \wxmsw_dist\wxMSW\samples\internat
copy Makefile.* \wxmsw_dist\wxMSW\samples\internat
copy *.cpp \wxmsw_dist\wxMSW\samples\internat
copy *.def \wxmsw_dist\wxMSW\samples\internat
copy *.rc \wxmsw_dist\wxMSW\samples\internat
copy *.ico \wxmsw_dist\wxMSW\samples\internat
copy readme.txt \wxmsw_dist\wxMSW\samples\internat
copy wxstd.po \wxmsw_dist\wxMSW\samples\internat
cd fr
md \wxmsw_dist\wxMSW\samples\internat\fr
copy *.?o \wxmsw_dist\wxMSW\samples\internat\fr
cd ..\..
echo Layout sample..
cd layout
md \wxmsw_dist\wxMSW\samples\layout
copy Makefile.* \wxmsw_dist\wxMSW\samples\layout
copy *.cpp \wxmsw_dist\wxMSW\samples\layout
copy *.ico \wxmsw_dist\wxMSW\samples\layout
copy *.def \wxmsw_dist\wxMSW\samples\layout
copy *.rc \wxmsw_dist\wxMSW\samples\layout
copy *.h \wxmsw_dist\wxMSW\samples\layout
cd ..
echo Listctrl sample..
cd listctrl
md \wxmsw_dist\wxMSW\samples\listctrl
copy Makefile.* \wxmsw_dist\wxMSW\samples\listctrl
copy *.cpp \wxmsw_dist\wxMSW\samples\listctrl
copy *.h \wxmsw_dist\wxMSW\samples\listctrl
copy *.def \wxmsw_dist\wxMSW\samples\listctrl
copy *.rc \wxmsw_dist\wxMSW\samples\listctrl
copy *.ico \wxmsw_dist\wxMSW\samples\listctrl
cd bitmaps
md \wxmsw_dist\wxMSW\samples\listctrl\bitmaps
copy *.* \wxmsw_dist\wxMSW\samples\listctrl\bitmaps
cd ..\..
echo MDI sample..
cd mdi
md \wxmsw_dist\wxMSW\samples\mdi
copy Makefile.* \wxmsw_dist\wxMSW\samples\mdi
copy *.cpp \wxmsw_dist\wxMSW\samples\mdi
copy *.rc \wxmsw_dist\wxMSW\samples\mdi
copy *.def \wxmsw_dist\wxMSW\samples\mdi
copy *.h \wxmsw_dist\wxMSW\samples\mdi
copy *.ico \wxmsw_dist\wxMSW\samples\mdi
cd bitmaps
md \wxmsw_dist\wxMSW\samples\mdi\bitmaps
copy *.* \wxmsw_dist\wxMSW\samples\mdi\bitmaps
cd ..\..
echo Memcheck sample..
cd memcheck
md \wxmsw_dist\wxMSW\samples\memcheck
copy Makefile.* \wxmsw_dist\wxMSW\samples\memcheck
copy *.cpp \wxmsw_dist\wxMSW\samples\memcheck
copy *.ico \wxmsw_dist\wxMSW\samples\memcheck
copy *.rc \wxmsw_dist\wxMSW\samples\memcheck
copy *.def \wxmsw_dist\wxMSW\samples\memcheck
copy *.xpm \wxmsw_dist\wxMSW\samples\memcheck
cd ..
echo Minifram sample..
cd minifram
md \wxmsw_dist\wxMSW\samples\minifram
copy Makefile.* \wxmsw_dist\wxMSW\samples\minifram
copy *.cpp \wxmsw_dist\wxMSW\samples\minifram
copy *.h \wxmsw_dist\wxMSW\samples\minifram
copy *.xpm \wxmsw_dist\wxMSW\samples\minifram
copy *.ico \wxmsw_dist\wxMSW\samples\minifram
copy *.def \wxmsw_dist\wxMSW\samples\minifram
copy *.rc \wxmsw_dist\wxMSW\samples\minifram
cd bitmaps
md \wxmsw_dist\wxMSW\samples\minifram\bitmaps
copy *.* \wxmsw_dist\wxMSW\samples\minifram\bitmaps
cd ..\..
echo Notebook sample..
cd notebook
md \wxmsw_dist\wxMSW\samples\notebook
copy Makefile.* \wxmsw_dist\wxMSW\samples\notebook
copy *.cpp \wxmsw_dist\wxMSW\samples\notebook
copy *.ico \wxmsw_dist\wxMSW\samples\notebook
copy *.def \wxmsw_dist\wxMSW\samples\notebook
copy *.rc \wxmsw_dist\wxMSW\samples\notebook
copy *.h \wxmsw_dist\wxMSW\samples\notebook
cd ..
echo Printing sample..
cd printing
md \wxmsw_dist\wxMSW\samples\printing
copy Makefile.* \wxmsw_dist\wxMSW\samples\printing
copy *.cpp \wxmsw_dist\wxMSW\samples\printing
copy *.h \wxmsw_dist\wxMSW\samples\printing
copy *.rc \wxmsw_dist\wxMSW\samples\printing
copy *.ico \wxmsw_dist\wxMSW\samples\printing
copy *.def \wxmsw_dist\wxMSW\samples\printing
copy *.xpm \wxmsw_dist\wxMSW\samples\printing
cd ..
echo Proplist sample..
cd proplist
md \wxmsw_dist\wxMSW\samples\proplist
copy Makefile.* \wxmsw_dist\wxMSW\samples\proplist
copy *.rc \wxmsw_dist\wxMSW\samples\printing
copy *.def \wxmsw_dist\wxMSW\samples\printing
copy *.cpp \wxmsw_dist\wxMSW\samples\proplist
copy *.ico \wxmsw_dist\wxMSW\samples\printing
copy *.h \wxmsw_dist\wxMSW\samples\proplist
cd ..
echo Resource sample..
cd resource
md \wxmsw_dist\wxMSW\samples\resource
copy Makefile.* \wxmsw_dist\wxMSW\samples\resource
copy *.ico \wxmsw_dist\wxMSW\samples\resource
copy *.rc \wxmsw_dist\wxMSW\samples\resource
copy *.def \wxmsw_dist\wxMSW\samples\resource
copy *.cpp \wxmsw_dist\wxMSW\samples\resource
copy *.h \wxmsw_dist\wxMSW\samples\resource
copy *.wxr \wxmsw_dist\wxMSW\samples\resource
cd ..
echo Sashtest sample..
cd sashtest
md \wxmsw_dist\wxMSW\samples\sashtest
copy Makefile.* \wxmsw_dist\wxMSW\samples\sashtest
copy *.cpp \wxmsw_dist\wxMSW\samples\sashtest
copy *.rc \wxmsw_dist\wxMSW\samples\sashtest
copy *.h \wxmsw_dist\wxMSW\samples\sashtest
copy *.def \wxmsw_dist\wxMSW\samples\sashtest
copy *.ico \wxmsw_dist\wxMSW\samples\sashtest
cd ..
echo Scroll sample..
cd scroll
md \wxmsw_dist\wxMSW\samples\scroll
copy Makefile.* \wxmsw_dist\wxMSW\samples\scroll
copy *.cpp \wxmsw_dist\wxMSW\samples\scroll
copy *.def \wxmsw_dist\wxMSW\samples\scroll
copy *.rc \wxmsw_dist\wxMSW\samples\scroll
copy *.ico \wxmsw_dist\wxMSW\samples\scroll
copy *.h \wxmsw_dist\wxMSW\samples\scroll
cd ..
echo Splitter sample..
cd splitter
md \wxmsw_dist\wxMSW\samples\splitter
copy Makefile.* \wxmsw_dist\wxMSW\samples\splitter
copy *.cpp \wxmsw_dist\wxMSW\samples\splitter
copy *.def \wxmsw_dist\wxMSW\samples\splitter
copy *.rc \wxmsw_dist\wxMSW\samples\splitter
copy *.ico \wxmsw_dist\wxMSW\samples\splitter
cd ..
echo Text sample..
cd text
md \wxmsw_dist\wxMSW\samples\text
copy Makefile.* \wxmsw_dist\wxMSW\samples\text
copy *.cpp \wxmsw_dist\wxMSW\samples\text
copy *.def \wxmsw_dist\wxMSW\samples\text
copy *.rc \wxmsw_dist\wxMSW\samples\text
copy *.ico \wxmsw_dist\wxMSW\samples\text
cd ..
echo Thread sample..
cd thread
md \wxmsw_dist\wxMSW\samples\thread
copy Makefile.* \wxmsw_dist\wxMSW\samples\thread
copy *.cpp \wxmsw_dist\wxMSW\samples\thread
copy *.def \wxmsw_dist\wxMSW\samples\thread
copy *.rc \wxmsw_dist\wxMSW\samples\thread
copy *.ico \wxmsw_dist\wxMSW\samples\thread
cd ..
echo Toolbar sample..
cd toolbar
md \wxmsw_dist\wxMSW\samples\toolbar
copy Makefile.* \wxmsw_dist\wxMSW\samples\toolbar
copy *.cpp \wxmsw_dist\wxMSW\samples\toolbar
copy *.h \wxmsw_dist\wxMSW\samples\toolbar
copy *.rc \wxmsw_dist\wxMSW\samples\toolbar
copy *.def \wxmsw_dist\wxMSW\samples\toolbar
copy *.xpm \wxmsw_dist\wxMSW\samples\toolbar
copy *.ico \wxmsw_dist\wxMSW\samples\toolbar
cd bitmaps
md \wxmsw_dist\wxMSW\samples\toolbar\bitmaps
copy *.* \wxmsw_dist\wxMSW\samples\toolbar\bitmaps
cd ..\..
echo TreeCtrl sample..
cd treectrl
md \wxmsw_dist\wxMSW\samples\treectrl
copy Makefile.* \wxmsw_dist\wxMSW\samples\treectrl
copy *.rc \wxmsw_dist\wxMSW\samples\treectrl
copy *.def \wxmsw_dist\wxMSW\samples\treectrl
copy *.cpp \wxmsw_dist\wxMSW\samples\treectrl
copy *.h \wxmsw_dist\wxMSW\samples\treectrl
copy *.xpm \wxmsw_dist\wxMSW\samples\treectrl
copy *.ico \wxmsw_dist\wxMSW\samples\treectrl
cd bitmaps
md \wxmsw_dist\wxMSW\samples\treectrl\bitmaps
copy *.* \wxmsw_dist\wxMSW\samples\treectrl\bitmaps
cd ..\..
echo typetest sample..
cd typetest
md \wxmsw_dist\wxMSW\samples\typetest
copy Makefile.* \wxmsw_dist\wxMSW\samples\typetest
copy *.cpp \wxmsw_dist\wxMSW\samples\typetest
copy *.h \wxmsw_dist\wxMSW\samples\typetest
copy *.ico \wxmsw_dist\wxMSW\samples\typetest
copy *.def \wxmsw_dist\wxMSW\samples\typetest
copy *.rc \wxmsw_dist\wxMSW\samples\typetest
cd ..
echo Validate sample..
cd validate
md \wxmsw_dist\wxMSW\samples\validate
copy Makefile.* \wxmsw_dist\wxMSW\samples\validate
copy *.cpp \wxmsw_dist\wxMSW\samples\validate
copy *.h \wxmsw_dist\wxMSW\samples\validate
copy *.xpm \wxmsw_dist\wxMSW\samples\validate
copy *.rc \wxmsw_dist\wxMSW\samples\validate
copy *.def \wxmsw_dist\wxMSW\samples\validate
cd ..
echo wxPoem sample..
cd wxpoem
md \wxmsw_dist\wxMSW\samples\wxpoem
copy Makefile.* \wxmsw_dist\wxMSW\samples\wxpoem
copy *.cpp \wxmsw_dist\wxMSW\samples\wxpoem
copy *.h \wxmsw_dist\wxMSW\samples\wxpoem
copy *.xpm \wxmsw_dist\wxMSW\samples\wxpoem
copy *.def \wxmsw_dist\wxMSW\samples\wxpoem
copy *.rc \wxmsw_dist\wxMSW\samples\wxpoem
copy wxpoem.dat \wxmsw_dist\wxMSW\samples\wxpoem
copy wxpoem.txt \wxmsw_dist\wxMSW\samples\wxpoem
copy wxpoem.idx \wxmsw_dist\wxMSW\samples\wxpoem
cd ..
echo wxSocket sample..
cd wxsocket
md \wxmsw_dist\wxMSW\samples\wxsocket
copy Makefile.* \wxmsw_dist\wxMSW\samples\wxsocket
copy *.cpp \wxmsw_dist\wxMSW\samples\wxsocket
copy *.h \wxmsw_dist\wxMSW\samples\wxsocket
copy *.rc \wxmsw_dist\wxMSW\samples\wxsocket
copy *.def \wxmsw_dist\wxMSW\samples\wxsocket
copy *.xpm \wxmsw_dist\wxMSW\samples\wxsocket
cd ..\..

109
distrib/msw/cw.rsp Normal file
View File

@@ -0,0 +1,109 @@
src/make_cw.mcp
src/common/cwy_tab.c
src/common/cwlex_yy.c
include/wx_cw.pch
include/wx_cw.pch++
include/wx_cw_d.pch
include/wx_cw_d.pch++
samples/bombs/make_cw.mcp
samples/checklst/make_cw.mcp
samples/config/make_cw.mcp
samples/controls/make_cw.mcp
samples/db/make_cw.mcp
samples/dialogs/make_cw.mcp
samples/dnd/make_cw.mcp
samples/docview/make_cw.mcp
samples/docvwmdi/make_cw.mcp
samples/dynamic/make_cw.mcp
samples/forty/make_cw.mcp
samples/fractal/make_cw.mcp
samples/grid/make_cw.mcp
samples/help/make_cw.mcp
samples/image/make_cw.mcp
samples/internat/make_cw.mcp
samples/joytest/make_cw.mcp
samples/layout/make_cw.mcp
samples/listctrl/make_cw.mcp
samples/mdi/make_cw.mcp
samples/memcheck/make_cw.mcp
samples/mfc/make_cw.mcp
samples/minimal/make_cw.mcp
samples/minifram/make_cw.mcp
samples/nativdlg/make_cw.mcp
samples/notebook/make_cw.mcp
samples/ownerdrw/make_cw.mcp
samples/png/make_cw.mcp
samples/printing/make_cw.mcp
samples/proplist/make_cw.mcp
samples/Regtest/make_cw.mcp
samples/resource/make_cw.mcp
samples/sashtest/make_cw.mcp
samples/splitter/make_cw.mcp
samples/tab/make_cw.mcp
samples/taskbar/make_cw.mcp
samples/thread/make_cw.mcp
samples/toolbar/make_cw.mcp
samples/treectrl/make_cw.mcp
samples/typetest/make_cw.mcp
samples/validate/make_cw.mcp
samples/wxsocket/make_cw.mcp
samples/wxpoem/make_cw.mcp
utils/wxprop/src/make_cw.mcp
utils/wxprop/src/make_sample.mcp
utils/dialoged/src/make_cw.mcp
utils/glcanvas/win/make_cw.mcp
utils/glcanvas/samples/cube/make_cw.mcp
utils/glcanvas/samples/isosurf/make_cw.mcp
utils/ogl/src/make_cw.mcp
utils/ogl/samples/ogledit/make_cw.mcp
utils/wxtree/src/make_cw.mcp
utils/wxtree/src/make_cw.mcp

97
distrib/msw/docsrc.rsp Normal file
View File

@@ -0,0 +1,97 @@
docs/latex/wx/*.tex
docs/latex/wx/*.sty
docs/latex/wx/*.bib
docs/latex/wx/*.hpj
docs/latex/wx/*.ini
docs/latex/wx/*.txt
docs/latex/wx/*.cnt
docs/latex/wx/*.eps
docs/latex/wx/*.bmp
docs/latex/wx/*.gif
docs/latex/wx/*.wmf
docs/latex/proplist/*.tex
docs/latex/proplist/*.sty
docs/latex/proplist/*.bib
docs/latex/proplist/*.hpj
docs/latex/proplist/*.ini
docs/latex/proplist/*.txt
docs/latex/proplist/*.cnt
docs/latex/proplist/*.eps
docs/latex/proplist/*.bmp
docs/latex/proplist/*.gif
docs/latex/proplist/*.wmf
docs/latex/porting/*.tex
docs/latex/porting/*.sty
docs/latex/porting/*.bib
docs/latex/porting/*.hpj
docs/latex/porting/*.ini
docs/latex/porting/*.txt
docs/latex/porting/*.cnt
docs/latex/porting/*.eps
docs/latex/porting/*.gif
docs/latex/porting/*.bmp
utils/wxhelp/docs/*.tex
utils/wxhelp/docs/*.txt
utils/wxhelp/docs/*.hpj
utils/wxhelp/docs/*.ini
utils/wxhelp/docs/*.bmp
utils/wxhelp/docs/*.wmf
utils/wxhelp/docs/*.gif
utils/tex2rtf/docs/*.tex
utils/tex2rtf/docs/*.txt
utils/tex2rtf/docs/*.hpj
utils/tex2rtf/docs/*.bib
utils/tex2rtf/docs/*.ini
utils/tex2rtf/docs/*.sty
utils/tex2rtf/docs/*.bmp
utils/tex2rtf/docs/*.shg
utils/tex2rtf/docs/*.wmf
utils/tex2rtf/docs/*.gif
utils/wxtree/docs/*.tex
utils/wxtree/docs/*.ini
utils/wxtree/docs/*.bib
utils/wxtree/docs/*.txt
utils/wxtree/docs/*.hpj
utils/wxtree/docs/*.bmp
utils/wxtree/docs/*.wmf
utils/wxtree/docs/*.gif
utils/wxgraph/docs/*.tex
utils/wxgraph/docs/*.ini
utils/wxgraph/docs/*.bib
utils/wxgraph/docs/*.txt
utils/wxgraph/docs/*.hpj
utils/wxgraph/docs/*.bmp
utils/wxgraph/docs/*.wmf
utils/wxgraph/docs/*.gif
utils/mfutils/docs/*.tex
utils/mfutils/docs/*.txt
utils/mfutils/docs/*.hpj
utils/mfutils/docs/*.wmf
utils/mfutils/docs/*.bmp
utils/wxprop/docs/*.txt
utils/wxprop/docs/*.hpj
utils/wxprop/docs/*.tex
utils/wxprop/docs/*.ini
utils/wxprop/docs/*.eps
utils/wxprop/docs/*.bmp
utils/wxprop/docs/*.wmf
utils/wxprop/docs/*.gif
utils/dialoged/docs/*.txt
utils/dialoged/docs/*.hpj
utils/dialoged/docs/*.tex
utils/dialoged/docs/*.ini
utils/dialoged/docs/*.eps
utils/dialoged/docs/*.bmp
utils/dialoged/docs/*.wmf
utils/dialoged/docs/*.gif

1038
distrib/msw/generic.rsp Normal file

File diff suppressed because it is too large Load Diff

44
distrib/msw/glcanvas.rsp Normal file
View File

@@ -0,0 +1,44 @@
utils/glcanvas/Makefile.in
utils/glcanvas/docs/*.*
utils/glcanvas/win/*.cpp
utils/glcanvas/win/*.h
utils/glcanvas/win/make*.*
utils/glcanvas/gtk/*.cpp
utils/glcanvas/gtk/*.h
utils/glcanvas/gtk/make*.*
utils/glcanvas/gtk/Makefile
utils/glcanvas/motif/*.cpp
utils/glcanvas/motif/*.h
utils/glcanvas/motif/make*.*
utils/glcanvas/motif/*.txt
utils/glcanvas/motif/Makefile
utils/glcanvas/samples/cube/*.cpp
utils/glcanvas/samples/cube/*.h
utils/glcanvas/samples/cube/*.rc
utils/glcanvas/samples/cube/*.ico
utils/glcanvas/samples/cube/*.xbm
utils/glcanvas/samples/cube/make*.*
utils/glcanvas/samples/cube/Makefile
utils/glcanvas/samples/isosurf/*.cpp
utils/glcanvas/samples/isosurf/*.h
utils/glcanvas/samples/isosurf/*.rc
utils/glcanvas/samples/isosurf/*.ico
utils/glcanvas/samples/isosurf/*.xbm
utils/glcanvas/samples/isosurf/*.dat.gz
utils/glcanvas/samples/isosurf/make*.*
utils/glcanvas/samples/isosurf/Makefile
utils/glcanvas/samples/penguin/*.cpp
utils/glcanvas/samples/penguin/*.c
utils/glcanvas/samples/penguin/*.h
utils/glcanvas/samples/penguin/*.rc
utils/glcanvas/samples/penguin/*.ico
utils/glcanvas/samples/penguin/*.xbm
utils/glcanvas/samples/penguin/*.xpm
utils/glcanvas/samples/penguin/make*.*
utils/glcanvas/samples/penguin/Makefile
utils/glcanvas/samples/penguin/penguin.lwo

84
distrib/msw/gtk.rsp Normal file
View File

@@ -0,0 +1,84 @@
configure
distrib/gtk/copy_src
distrib/gtk/README.txt
distrib/gtk/Setup
docs/gtk/*.html
docs/gtk/*.txt
docs/gtk/COPYING.LIB
docs/gtk/makewxgtk
include/wx/gtk/*.h
include/wx/gtk/*.xpm
include/install-sh
include/wx/install-sh
src/gtk/Makefile
src/gtk/*.cpp
src/gtk/*.c
src/gtk/*.inc
src/gtk/*.xbm
src/iodbc/*.c
src/iodbc/*.ci
src/iodbc/*.h
src/iodbc/IAFA-PACKAGE
src/iodbc/README
src/iodbc/*.exp
src/iodbc/*.mk
src/iodbc/autoconfig
src/iodbc/build
src/iodbc/Changes.log
src/iodbc/postgres/*.h
setup/*.in
setup/*.hin
setup/general/createall
setup/general/jointar
setup/general/makeapp
setup/general/makedirs
setup/general/makedoc
setup/general/mygrep
setup/general/needed
setup/rules/bin
setup/rules/bin2
setup/rules/doc
setup/rules/gbin
setup/rules/gbin2
setup/rules/glib
setup/rules/glibbin
setup/rules/glibgbin
setup/rules/gslib
setup/rules/lib
setup/rules/libbin
setup/rules/libgbin
setup/rules/generic/bin1
setup/rules/generic/bin1gen
setup/rules/generic/bin2
setup/rules/generic/bin2gen
setup/rules/generic/depend
setup/rules/generic/globals
setup/rules/generic/lib
setup/rules/generic/needed
setup/rules/generic/obj
setup/rules/generic/slib
setup/rules/generic/sobj
setup/shared/sharedAIX
setup/shared/sharedBsd
setup/shared/sharedDgux
setup/shared/sharedHpux
setup/shared/sharedIrix
setup/shared/sharedLinux
setup/shared/sharedOSF
setup/shared/sharedSolaris2
setup/shared/sharedSunos4
setup/shared/sharedSysV
misc/afm/*.afm
misc/gs_afm/*.afm

79
distrib/msw/makefile.rsp Normal file
View File

@@ -0,0 +1,79 @@
Makefile.in
src/Makefile
locale/Makefile
samples/Makefile.in
samples/bombs/Makefile.in
samples/caret/Makefile.in
samples/checklst/Makefile.in
samples/config/Makefile.in
samples/controls/Makefile.in
samples/db/Makefile.in
samples/dialogs/Makefile.in
samples/dnd/Makefile.in
samples/docview/Makefile.in
samples/docvwmdi/Makefile.in
samples/drawing/Makefile.in
samples/dynamic/Makefile.in
samples/genvalid/Makefile.in
samples/html/Makefile.in
samples/html/about/Makefile.in
samples/html/help/Makefile.in
samples/html/printing/Makefile.in
samples/html/test/Makefile.in
samples/html/virtual/Makefile.in
samples/html/widget/Makefile.in
samples/html/zip/Makefile.in
samples/image/Makefile.in
samples/layout/Makefile.in
samples/listctrl/Makefile.in
samples/mdi/Makefile.in
samples/minifram/Makefile.in
samples/minimal/Makefile.in
samples/notebook/Makefile.in
samples/printing/Makefile.in
samples/proplist/Makefile.in
samples/sashtest/Makefile.in
samples/scroll/Makefile.in
samples/splitter/Makefile.in
samples/text/Makefile.in
samples/thread/Makefile.in
samples/toolbar/Makefile.in
samples/treectrl/Makefile.in
samples/typetest/Makefile.in
samples/validate/Makefile.in
samples/wizard/Makefile.in
samples/wxpoem/Makefile.in
samples/wxsocket/Makefile.in
samples/nettest/Makefile.in
samples/scrollsub/Makefile.in
utils/glcanvas/motif/Makefile.in
utils/Makefile.in
utils/wxMMedia2/Makefile.in
utils/wxMMedia2/lib/Makefile.in
utils/wxMMedia2/sample/Makefile.in
include/wx/msw/Makefile.am
include/wx/msw/ctl3d/Makefile.am
include/wx/msw/gnuwin32/Makefile.am
misc/Makefile.am
misc/afm/Makefile.am
misc/gs_afm/Makefile.am
samples/animatn/Makefile.am
samples/db/Makefile.am
samples/forty/Makefile.am
samples/fractal/Makefile.am
samples/grid/Makefile.am
samples/help/Makefile.am
samples/internat/Makefile.am
samples/joytest/Makefile.am
samples/memcheck/Makefile.am
samples/mfc/Makefile.am
samples/nativdlg/Makefile.am
samples/oleauto/Makefile.am
samples/ownerdrw/Makefile.am
samples/png/Makefile.am
samples/regtest/Makefile.am
samples/resource/Makefile.am
samples/richedit/Makefile.am
samples/tab/Makefile.am
samples/taskbar/Makefile.am
src/msw/Makefile.am

51
distrib/msw/makewise.bat Executable file
View File

@@ -0,0 +1,51 @@
@echo off
Rem Make a WISE Installer distribution list, where each file is represented by
Rem a section like this:
Rem
Rem item: Install File
Rem Source=d:\wx2\thefile.txt
Rem Destination=%MAINDIR%\thefile.txt
Rem Flags=0000000000000010
Rem end
Rem Generate a list of all files in the distribution.
dir /BS >& %TEMP\files1.tmp
Rem Now we iterate through the list of files, writing out the middle section of
Rem the file.
Rem We have to remove the first part of the path,
Rem by truncating the start by the size of the current directory.
set sz=%@EVAL[%@LEN[%_CWD]+1]
set len=%@LINES[%TEMP\files1.tmp]
erase /Y %TEMP\files2.tmp
Rem, first add system files
cat %WXWIN\distrib\msw\wisesys.txt > %temp\files2.tmp
do i = 0 to %len by 1
set line=%@LINE[%TEMP\files1.tmp,%i]
Rem Skip directories.
if isdir %line enddo
set sz2=%@LEN[%line]
set n=%@EVAL[%sz2-%sz]
set line2=%@SUBSTR[%line,%sz,%n]
Rem Echo the file section
echo item: Install File >> %TEMP\files2.tmp
echo Source=%line >> %TEMP\files2.tmp
echo Destination=%%MAINDIR%%\%line2 >> %TEMP\files2.tmp
echo Flags=0000000000000010 >> %TEMP\files2.tmp
echo end >> %TEMP\files2.tmp
enddo
Rem Concatenate the 3 sections
cat %WXWIN\distrib\msw\wisetop.txt %TEMP\files2.tmp %WXWIN\distrib\msw\wisebott.txt > %WXWIN\distrib\msw\wxwin2.wse
erase /Y %TEMP\files1.tmp
rem erase /Y %TEMP\files2.tmp
goto end
:end

88
distrib/msw/motif.rsp Normal file
View File

@@ -0,0 +1,88 @@
src/motif.inc
src/motif/*.cpp
src/motif/*.c
src/motif/*.h
src/motif/makefile*
src/motif/*.inc
src/motif/*.xbm
src/motif/xmcombo/*.c
src/motif/xmcombo/*.h
src/motif/xmcombo/*.doc
src/motif/xmcombo/*.man
src/motif/xmcombo/*.txt
src/iodbc/*.c
src/iodbc/*.ci
src/iodbc/*.h
src/iodbc/IAFA-PACKAGE
src/iodbc/README
src/iodbc/*.exp
src/iodbc/*.mk
src/iodbc/autoconfig
src/iodbc/build
src/iodbc/Changes.log
src/iodbc/postgres/*.h
include/wx/motif/*.h
include/install-sh
include/wx/install-sh
docs/motif/*.txt
docs/motif/makewxmotif
docs/motif2/*.txt
docs/motif2/COPYING.LIB
lib/dummy
misc/afm/*.afm
misc/gs_afm/*.afm
setup/*.in
setup/*.hin
setup/general/createall
setup/general/jointar
setup/general/makeapp
setup/general/makedirs
setup/general/makedoc
setup/general/mygrep
setup/general/needed
setup/rules/bin
setup/rules/bin2
setup/rules/doc
setup/rules/gbin
setup/rules/gbin2
setup/rules/glib
setup/rules/glibbin
setup/rules/glibgbin
setup/rules/gslib
setup/rules/lib
setup/rules/libbin
setup/rules/libgbin
setup/rules/generic/bin1
setup/rules/generic/bin1gen
setup/rules/generic/bin2
setup/rules/generic/bin2gen
setup/rules/generic/depend
setup/rules/generic/globals
setup/rules/generic/lib
setup/rules/generic/needed
setup/rules/generic/obj
setup/rules/generic/slib
setup/rules/generic/sobj
setup/shared/sharedAIX
setup/shared/sharedBsd
setup/shared/sharedDgux
setup/shared/sharedHpux
setup/shared/sharedIrix
setup/shared/sharedLinux
setup/shared/sharedOSF
setup/shared/sharedSolaris2
setup/shared/sharedSunos4
setup/shared/sharedSysV

181
distrib/msw/msw.rsp Normal file
View File

@@ -0,0 +1,181 @@
Mingw32-gcc295.patches
lib/watcom/*.txt
lib/watcom/*.lib
lib/watcom/*.bat
lib/bcc16/*.lib
docs/licence.txt
docs/msw/*.txt
docs/wine/*.txt
docs/wine/COPYING.LIB
distrib/msw/*.rsp
distrib/msw/*.bat
tools/gettext/xgettext.exe
tools/gettext/msgfmt.exe
tools/gettext/msgunfmt.exe
src/makeb32.env
src/makeprog.b32
src/makelib.b32
src/makebcc.env
src/makeprog.bcc
src/makelib.bcc
src/makemsc.env
src/makeprog.msc
src/makelib.msc
src/makewat.env
src/makeprog.wat
src/makelib.wat
src/makesc.env
src/makevc.env
src/makeprog.vc
src/makelib.vc
src/makeg95.env
src/makeprog.g95
src/makelib.g95
src/makesl.env
src/makeprog.sl
src/makelib.sl
src/salford.lnk
src/maketwin.env
src/makeprog.twn
src/makelib.twn
src/makefile.bcc
src/makefile.dos
src/makefile.vc
src/*.bat
src/common/dosyacc.c
src/common/doslex.c
src/common/y_tab.c
src/common/lex_yy.c
src/msw/*.cpp
src/msw/*.h
src/msw/makefile.*
src/msw/*.lst
src/msw/*.def
src/msw/*.inc
src/msw/winestub.c
src/msw/gsocket.c
src/msw/ole/*.cpp
src/msw/*.prj
src/xpm/*.c
src/xpm/*.h
src/xpm/makefile*
src/xpm/changes
src/xpm/readme
src/xpm/readme.msw
src/xpm/copyrigh.t
src/xpm/files
include/wx/msw/*.h
include/wx/msw/*.rc
include/wx/msw/ctl3d/*.h
include/wx/msw/gnuwin32/*.h
include/wx/msw/ole/*.h
include/wx/msw/*.cur
include/wx/msw/*.ico
include/wx/msw/*.bmp
lib/dummy
samples/ownerdrw/*.cpp
samples/ownerdrw/*.h
samples/ownerdrw/makefile.*
samples/ownerdrw/*.rc
samples/ownerdrw/*.def
samples/ownerdrw/*.bmp
samples/ownerdrw/*.ico
samples/ownerdrw/*.txt
samples/taskbar/*.cpp
samples/taskbar/*.h
samples/taskbar/makefile.*
samples/taskbar/*.rc
samples/taskbar/*.def
samples/taskbar/*.bmp
samples/taskbar/*.ico
samples/taskbar/*.txt
samples/regtest/*.cpp
samples/regtest/*.h
samples/regtest/makefile.*
samples/regtest/*.rc
samples/regtest/*.def
samples/regtest/*.bmp
samples/regtest/*.ico
samples/regtest/*.txt
samples/nativdlg/*.cpp
samples/nativdlg/*.h
samples/nativdlg/*.def
samples/nativdlg/*.rc
samples/nativdlg/*.txt
samples/nativdlg/makefile.*
samples/nativdlg/*.xbm
samples/nativdlg/*.ico
samples/nativdlg/*.bmp
samples/mfc/*.h
samples/mfc/*.cpp
samples/mfc/*.def
samples/mfc/*.rc
samples/mfc/makefile.*
samples/mfc/*.txt
samples/mfc/*.bmp
samples/mfc/*.ico
samples/joytest/*.h
samples/joytest/*.cpp
samples/joytest/*.def
samples/joytest/*.rc
samples/joytest/makefile.*
samples/joytest/*.txt
samples/joytest/*.bmp
samples/joytest/*.wav
samples/joytest/*.ico
samples/oleauto/*.h
samples/oleauto/*.cpp
samples/oleauto/*.def
samples/oleauto/*.rc
samples/oleauto/makefile.*
samples/oleauto/*.txt
samples/oleauto/*.bmp
samples/oleauto/*.ico
utils/nplugin/make*.*
utils/nplugin/src/*.cpp
utils/nplugin/src/*.h
utils/nplugin/src/*.rc
utils/nplugin/src/*.def
utils/nplugin/src/makefile.*
utils/nplugin/src/*.txt
utils/nplugin/samples/simple/*.cpp
utils/nplugin/samples/simple/*.h
utils/nplugin/samples/simple/*.rc
utils/nplugin/samples/simple/*.def
utils/nplugin/samples/simple/makefile.*
utils/nplugin/samples/simple/*.txt
utils/nplugin/samples/gui/*.cpp
utils/nplugin/samples/gui/*.h
utils/nplugin/samples/gui/*.rc
utils/nplugin/samples/gui/*.def
utils/nplugin/samples/gui/makefile.*
utils/nplugin/samples/gui/*.txt
utils/nplugin/docs/*.tex
utils/nplugin/docs/*.txt
utils/nplugin/docs/*.hpj
utils/nplugin/docs/*.eps
utils/nplugin/docs/*.ps
utils/nplugin/docs/*.ini
utils/nplugin/docs/*.cnt
utils/nplugin/docs/*.hlp
utils/nplugin/lib/dummy

73
distrib/msw/ogl.rsp Normal file
View File

@@ -0,0 +1,73 @@
utils/ogl/Makefile.in
utils/ogl/Makefile
utils/ogl/src/*.cpp
utils/ogl/src/*.h
utils/ogl/src/*.rc
utils/ogl/src/*.def
utils/ogl/src/*.xbm
utils/ogl/src/*.xpm
utils/ogl/src/make*.*
utils/ogl/src/Makefile
utils/ogl/src/*.txt
utils/ogl/src/*.ico
utils/ogl/src/*.bmp
utils/ogl/samples/ogledit/*.cpp
utils/ogl/samples/ogledit/*.h
utils/ogl/samples/ogledit/*.rc
utils/ogl/samples/ogledit/*.def
utils/ogl/samples/ogledit/*.xbm
utils/ogl/samples/ogledit/make*.*
utils/ogl/samples/ogledit/Makefile
utils/ogl/samples/ogledit/*.txt
utils/ogl/samples/ogledit/*.ico
utils/ogl/samples/ogledit/*.bmp
utils/ogl/samples/ogledit/*.xpm
utils/ogl/samples/ogledit/bitmaps/*.bmp
utils/ogl/samples/ogledit/bitmaps/*.gif
utils/ogl/samples/ogledit/bitmaps/*.xbm
utils/ogl/samples/ogledit/bitmaps/*.xpm
utils/ogl/samples/studio/*.cpp
utils/ogl/samples/studio/*.h
utils/ogl/samples/studio/*.rc
utils/ogl/samples/studio/*.def
utils/ogl/samples/studio/*.xbm
utils/ogl/samples/studio/make*.*
utils/ogl/samples/studio/Makefile
utils/ogl/samples/studio/*.txt
utils/ogl/samples/studio/*.ico
utils/ogl/samples/studio/*.bmp
utils/ogl/samples/studio/*.xpm
utils/ogl/samples/studio/*.wxr
utils/ogl/samples/studio/bitmaps/*.bmp
utils/ogl/samples/studio/bitmaps/*.gif
utils/ogl/samples/studio/bitmaps/*.xbm
utils/ogl/samples/studio/bitmaps/*.xpm
utils/ogl/samples/studio/manual/*.tex
utils/ogl/samples/studio/manual/*.ini
utils/ogl/samples/studio/manual/*.gif
utils/ogl/samples/studio/manual/*.bmp
utils/ogl/samples/studio/manual/*.htm
utils/ogl/samples/studio/manual/*.hlp
utils/ogl/samples/studio/manual/*.cnt
utils/ogl/samples/studio/manual/Makefile
utils/ogl/distrib/*.rsp
utils/ogl/distrib/*.bat
utils/ogl/docs/*.txt
utils/ogl/docs/*.tex
utils/ogl/docs/*.ini
utils/ogl/docs/*.hpj
utils/ogl/docs/*.ps
utils/ogl/docs/*.eps
utils/ogl/docs/*.bmp
utils/ogl/docs/*.gif
docs/html/ogl/*.*
docs/winhelp/ogl.hlp
docs/winhelp/ogl.cnt
docs/pdf/ogl.pdf

36
distrib/msw/readme.txt Normal file
View File

@@ -0,0 +1,36 @@
Distribution scripts and lists
-----------------------------------------------------------------
This directory (distrib\msw) contains some 4DOS batch files
(.bat) and 'response' files (.rsp) to simplify the job of
producing distributions. The .rsp files specify which files are
associated with a particular module, e.g. wx200vc.rsp refers to
the VC++ project files, wx200gen.rsp represents the generic files,
wx200msw.rsp specifies the Windows specific files, etc.
When making a distribution on Windows, I call zipdist.bat to prepare
zip files with everything needed for Windows,
GTK and Motif. zipdist then unzips some of them into
deliver\wx, removes and adds a few files to perfect the
distribution.
zipdist then calls 'makewise.bat' to generate a new wxwin2.wse
script, for WISE Installer. It takes wisetop.txt, wisebott.txt
and adds the section for file installation. (If you've modified
wxwin2.wse using WISE Installer, simply compile and run splitwise.exe
to put back up-to-date wisetop.txt, wisebott.txt files before
running zipdist.)
Finally, zipdist runs WISE Installer using a command line
argument to produce the setup.* files automatically.
Note that although zipdist.bat produces archives for 3 platforms,
I only use a subset of these to produce the Windows-specific
setup.exe. I then have the option of distributing the zip files
as well.
You may need to install 4DOS to run these scripts. If anyone
wishes to remove 4DOS dependency, that's fine with me.
Julian Smart, 11th October 1999

106
distrib/msw/splitwise.cpp Normal file
View File

@@ -0,0 +1,106 @@
///////////////////////////////////////////////////////////////////////////////
// Name: splitwise.cpp
// Purpose: Use this to split wxwin2.wse in the distrib/msw directory
// into wisetop.txt, wisebott.txt. This allows you to do the
// following:
//
// 1) Edit the existing wxwin2.wse in WISE Install.
// 2) Call splitwise.exe to split off the non-file bits (i.e.
// preserve everything except the "item: Install File" lines).
// 3) Call makewise.bat to generate a new wxwin2.wse from
// wisetop.txt, wisebott.txt and the file list generated
// from the files in deliver\wx (which themselves have been
// put there by zipdist.bat).
//
// If you don't wish to change the WISE settings, then there's no
// need to use splitwise, but it's very likely that settings will
// be altered, e.g. to change the version number, what's installed,
// etc.
//
// Author: Julian Smart
// Modified by:
// Created: 13/10/99
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char g_Line[1024];
int ReadLine(FILE* fd, char* buf)
{
int ch;
int i = 0;
while (((ch = getc(fd)) != EOF) && (ch != '\n'))
{
buf[i] = ch;
i ++;
}
buf[i] = 0;
if (ch == EOF && (i == 0))
return 0;
else
return 1;
}
void WriteLine(FILE* fd, char* buf)
{
int len = strlen(buf);
int i;
for (i = 0; i < len; i++)
putc(buf[i], fd);
putc('\n', fd);
}
int main(int argc, char* argv[])
{
FILE* wiseTop = fopen("wisetop.txt", "w");
if (!wiseTop)
return 1;
FILE* wiseBottom = fopen("wisebott.txt", "w");
if (!wiseBottom)
return 1;
FILE* wiseWhole = fopen("wxwin2.wse", "r");
if (!wiseWhole)
return 1;
// Write out the top of the file
g_Line[0] = 0;
while (ReadLine(wiseWhole, g_Line))
{
if (strcmp(g_Line, "item: Install File") == 0)
break;
else
WriteLine(wiseTop, g_Line);
}
// Skip to the end of the file items
while (ReadLine(wiseWhole, g_Line))
{
if ((strncmp(g_Line, "item:", 5) == 0) && (strcmp(g_Line, "item: Install File") != 0))
{
WriteLine(wiseBottom, g_Line);
break;
}
}
// Write the rest of the bottom
while (ReadLine(wiseWhole, g_Line))
{
WriteLine(wiseBottom, g_Line);
}
fclose(wiseTop);
fclose(wiseBottom);
fclose(wiseWhole);
return 0;
}

15
distrib/msw/stubs.rsp Normal file
View File

@@ -0,0 +1,15 @@
src/stubs/*.cpp
src/stubs/*.h
src/stubs/makefile*
src/stubs/*.inc
src/make.env
src/makeprog.env
src/makelib.env
include/wx/stubs/*.h
include/wx/stubs/*.rc
lib/dummy

108
distrib/msw/tardist Normal file
View File

@@ -0,0 +1,108 @@
#!/bin/sh
# tardist: make up a tar.gz distribution of wxWindows 2
# Supply a source (e.g. ~/wx2) and destination (e.g. ~/wx2/deliver)
init=""
if [ $1 = "" ]
then
exit
fi
if [ $2 = "" ]
then
exit
fi
echo About to archive wxWindows:
echo From $1
echo To $2
echo CTRL-C if this is not correct.
read dummy
cd $1
echo Removing backup files...
rm *~ */*~ */*/*~ */*/*/*~ */*/*/*/*~
rm -f $2/wx200*.tgz
rm -f $2/tex2rtf2.tgz
rm -f $2/ogl3.tgz
rm -f $2/treedraw.tar.gz
rm -f $2/glcanvas.tar.gz
rm -f $2/jpeg.tgz
echo Tarring...
### Generic
ls `cat $1/distrib/msw/generic.rsp $1/distrib/msw/makefile.rsp` > /tmp/wxgen.txt
tar cvf $2/wx200gen.tar -T /tmp/wxgen.txt
gzip $2/wx200gen.tar
mv $2/wx200gen.tar.gz $2/wx200gen.tgz
### wxGTK
ls `cat $1/distrib/msw/generic.rsp $1/distrib/msw/gtk.rsp $1/distrib/msw/makefile.rsp` > /tmp/wxgtk.txt
tar cvf $2/wx200gtk.tar -T /tmp/wxgtk.txt
gzip $2/wx200gtk.tar
mv $2/wx200gtk.tar.gz $2/wx200gtk.tgz
### wxMotif
ls `cat $1/distrib/msw/generic.rsp $1/distrib/msw/motif.rsp $1/distrib/msw/makefile.rsp` > /tmp/wxmotif.txt
tar cvf $2/wx200mot.tar -T /tmp/wxmotif.txt
gzip $2/wx200mot.tar
mv $2/wx200mot.tar.gz $2/wx200mot.tgz
### Doc sources
ls `cat $1/distrib/msw/docsrc.rsp` > /tmp/docsrc.txt
tar cvf $2/wx200doc.tar -T /tmp/docsrc.txt
gzip $2/wx200doc.tar
mv $2/wx200doc.tar.gz $2/wx200doc.tgz
### HTML docs
ls `cat $1/distrib/msw/wx_html.rsp` > /tmp/html.txt
tar cvf $2/wx200htm.tar -T /tmp/html.txt
gzip $2/wx200htm.tar
mv $2/wx200htm.tar.gz $2/wx200htm.tgz
### PDF docs
ls `cat $1/distrib/msw/wx_pdf.rsp` > /tmp/pdf.txt
tar cvf $2/wx200pdf.tar -T /tmp/pdf.txt
gzip $2/wx200pdf.tar
mv $2/wx200pdf.tar.gz $2/wx200pdf.tgz
### Stubs files
ls `cat $1/distrib/msw/stubs.rsp` > /tmp/stubs.txt
tar cvf $2/wx200stubs.tar -T /tmp/stubs.txt
gzip $2/wx200stubs.tar
mv $2/wx200stubs.tar.gz $2/wx200stubs.tgz
### Tex2RTF
ls `cat $1/distrib/msw/tex2rtf.rsp` > /tmp/tex2rtf.txt
tar cvf $2/tex2rtf2.tar -T /tmp/tex2rtf.txt
gzip $2/tex2rtf2.tar
mv $2/tex2rtf2.tar.gz $2/tex2rtf2.tgz
### OGL
ls `cat $1/distrib/msw/ogl.rsp` > /tmp/ogl.txt
tar cvf $2/ogl3.tar -T /tmp/ogl.txt
gzip $2/ogl3.tar
mv $2/ogl3.tar.gz $2/ogl3.tgz
### wxGLCanvas
ls `cat $1/distrib/msw/glcanvas.rsp` > /tmp/glcanvas.txt
tar cvf $2/glcanvas.tar -T /tmp/glcanvas.txt
gzip $2/glcanvas.tar
mv $2/glcanvas.tar.gz $2/glcanvas.tgz
### wxTreeLayout
ls `cat $1/distrib/msw/wxtree.rsp` > /tmp/wxtree.txt
tar cvf $2/treedraw.tar -T /tmp/wxtree.txt
gzip $2/treedraw.tar
mv $2/treedraw.tar.gz $2/treedraw.tgz
### JPEG
ls `cat $1/distrib/msw/jpeg.rsp` > /tmp/jpeg.txt
tar cvf $2/jpeg.tar -T /tmp/jpeg.txt
gzip $2/jpeg.tar
mv $2/jpeg.tar.gz $2/jpeg.tgz
echo Done!

117
distrib/msw/tardist.bat Executable file
View File

@@ -0,0 +1,117 @@
@echo off
rem Tar up an external distribution of wxWindows 2.0: but
rem putting in separate ASCII and binary files
rem This seems to be the one that works, using
rem separate tar programs for conversion/non-conversion
rem of ASCII/binary files.
if "%1" == "" goto usage
if "%2" == "" goto usage
echo About to archive an external wxWindows 2.0 distribution:
echo From %1
echo To %2\wx200_1.tgz, %2\wx200_2.tgz, %2\wx200hlp.tgz, %2\wx200ps.tgz, %2\wx200htm.tgz
echo CTRL-C if this is not correct.
inkey /W4 `Press any key to continue...` %%input
erase %2\*.tgz
cd %1
rem First, expand the wildcards in the rsp files
rem Create empty list file
erase %1\distrib\*.lis
c:\bin\touch %1\distrib\wx200asc.lis
c:\bin\touch %1\distrib\wx200bin.lis
c:\bin\touch %1\distrib\wx200hlp.lis
c:\bin\touch %1\distrib\wx200ps.lis
c:\bin\touch %1\distrib\wx200xlp.lis
rem Create a .rsp file with backslashes instead
rem of forward slashes
rem No need if using ls2 (from UNIX95 distribution)
rem sed -e "s/\//\\/g" %1\distrib\wx_asc.rsp > %1\distrib\wx_asc.rs2
call %1\distrib\expdwild.bat %1\distrib\wx_asc.rsp %1\distrib\wx200asc.lis
call %1\distrib\expdwild.bat %1\distrib\util_asc.rsp %1\distrib\wx200asc.lis
call %1\distrib\expdwild.bat %1\distrib\smpl_asc.rsp %1\distrib\wx200asc.lis
rem call %1\distrib\expdwild.bat %1\distrib\wxim1asc.rsp %1\distrib\wx200asc.lis
rem call %1\distrib\expdwild.bat %1\distrib\wxim2asc.rsp %1\distrib\wx200asc.lis
call %1\distrib\expdwild.bat %1\distrib\wx_bin.rsp %1\distrib\wx200bin.lis
call %1\distrib\expdwild.bat %1\distrib\util_bin.rsp %1\distrib\wx200bin.lis
call %1\distrib\expdwild.bat %1\distrib\smpl_bin.rsp %1\distrib\wx200bin.lis
rem call %1\distrib\expdwild.bat %1\distrib\wxim1bin.rsp %1\distrib\wx200bin.lis
rem Docs
call %1\distrib\expdwild.bat %1\distrib\wx_hlp.rsp %1\distrib\wx200hlp.lis
call %1\distrib\expdwild.bat %1\distrib\wx_ps.rsp %1\distrib\wx200ps.lis
call %1\distrib\expdwild.bat %1\distrib\wx_html.rsp %1\distrib\wx200htm.lis
call %1\distrib\expdwild.bat %1\distrib\wx_pdf.rsp %1\distrib\wx200pdf.lis
rem Do some further massaging of the .lis files
sed -e "s/\\/\//g" %1\distrib\wx200asc.lis > c:\temp\temp.tmp
sed -e "s/D:\/wx\///g" c:\temp\temp.tmp > %1\distrib\wx200asc.lis
sed -e "s/\\/\//g" %1\distrib\wx200bin.lis > c:\temp\temp.tmp
sed -e "s/D:\/wx\///g" c:\temp\temp.tmp > %1\distrib\wx200bin.lis
sed -e "s/\\/\//g" %1\distrib\wx200hlp.lis > c:\temp\temp.tmp
sed -e "s/D:\/wx\///g" c:\temp\temp.tmp > %1\distrib\wx200hlp.lis
sed -e "s/\\/\//g" %1\distrib\wx200ps.lis > c:\temp\temp.tmp
sed -e "s/D:\/wx\///g" c:\temp\temp.tmp > %1\distrib\wx200ps.lis
sed -e "s/\\/\//g" %1\distrib\wx200htm.lis > c:\temp\temp.tmp
sed -e "s/D:\/wx\///g" c:\temp\temp.tmp > %1\distrib\wx200htm.lis
sed -e "s/\\/\//g" %1\distrib\wx200pdf.lis > c:\temp\temp.tmp
sed -e "s/D:\/wx\///g" c:\temp\temp.tmp > %1\distrib\wx200pdf.lis
rem 'tar' converts linefeeds.
tar -c -T %1\distrib\wx200asc.lis -f %2\wx200.tar
rem pause Press a key to continue.
rem This converts to lower case
ren %2\wx200.tar %2\wx200_1.tar
gzip32 %2\wx200_1.tar
ren %2\wx200_1.tar.gz %2\wx200_1.tgz
rem No linefeed conversion wanted
rem Note: GNU tar seems to crash with a full destination path, so
rem pander to it.
targnu -c -T %1\distrib\wx200bin.lis -f wx200_2.tar
move wx200_2.tar %2
gzip32 %2\wx200_2.tar
ren %2\wx200_2.tar.gz %2\wx200_2.tgz
targnu -c -T %1\distrib\wx200hlp.lis -f wx200_hlp.tar
move wx200_hlp.tar %2
gzip32 %2\wx200_hlp.tar
ren %2\wx200_hlp.tar.gz %2\wx200hlp.tgz
tar -c -T %1\distrib\wx200ps.lis -f %2\wx200ps.tar
gzip32 %2\wx200ps.tar
ren %2\wx200ps.tar.gz %2\wx200ps.tgz
targnu -c -T %1\distrib\wx200htm.lis -f wx200htm.tar
move wx200htm.tar %2
gzip32 %2\wx200htm.tar
ren %2\wx200htm.tar.gz %2\wx200htm.tgz
targnu -c -T %1\distrib\wx200pdf.lis -f wx200pdf.tar
move wx200pdf.tar %2
gzip32 %2\wx200pdf.tar
ren %2\wx200pdf.tar.gz %2\wx200pdf.tgz
cd %2
echo wxWindows archived.
goto end
:usage
echo Tar/gzip wxWindows distribution under DOS, making an ASCII and binary file
echo Usage: tardist source destination
echo e.g. tardist d:\wx d:\wx\deliver
:end

27
distrib/msw/tex2rtf.rsp Normal file
View File

@@ -0,0 +1,27 @@
utils/tex2rtf/src/*.cpp
utils/tex2rtf/src/*.h
utils/tex2rtf/src/make*.*
utils/tex2rtf/src/Makefile
utils/tex2rtf/src/*.xbm
utils/tex2rtf/src/*.xpm
utils/tex2rtf/src/*.sty
utils/tex2rtf/src/*.ini
utils/tex2rtf/lib/dummy
utils/tex2rtf/src/*.bmp
utils/tex2rtf/src/*.ico
utils/tex2rtf/src/*.def
utils/tex2rtf/src/*.rc
utils/tex2rtf/docs/*.tex
utils/tex2rtf/docs/*.sty
utils/tex2rtf/docs/*.bib
utils/tex2rtf/docs/*.hpj
utils/tex2rtf/docs/*.ini
utils/tex2rtf/docs/*.txt
utils/tex2rtf/docs/*.cnt
utils/tex2rtf/docs/*.eps
utils/tex2rtf/docs/*.bmp
utils/tex2rtf/docs/*.gif
utils/tex2rtf/docs/*.wmf
utils/tex2rtf/docs/*.shg

View File

@@ -0,0 +1,44 @@
# FIXME we'll generate this makefile with configure later, but for now please
# change it manually
TMAKEDIR=/home/zeitlin/build/tmake
TMAKE=$(TMAKEDIR)/bin/tmake
WXDIR=../../..
MSW_MAKEFILES_DIR=$(WXDIR)/src/msw
all: $(MSW_MAKEFILES_DIR)/makefile.vc \
$(MSW_MAKEFILES_DIR)/makefile.b32 \
$(MSW_MAKEFILES_DIR)/makefile.dos \
$(MSW_MAKEFILES_DIR)/makefile.bcc \
$(MSW_MAKEFILES_DIR)/makefile.sc \
$(MSW_MAKEFILES_DIR)/makefile.wat \
$(MSW_MAKEFILES_DIR)/makefile.g95 \
$(MSW_MAKEFILES_DIR)/makefile.g295 \
$(WXDIR)/Makefile.in
$(MSW_MAKEFILES_DIR)/makefile.vc: filelist.txt wxwin.pro
$(TMAKE) -t vc wxwin.pro -o $@
$(MSW_MAKEFILES_DIR)/makefile.b32: filelist.txt wxwin.pro
$(TMAKE) -t b32 wxwin.pro -o $@
$(MSW_MAKEFILES_DIR)/makefile.dos: filelist.txt wxwin.pro
$(TMAKE) -t dos wxwin.pro -o $@
$(MSW_MAKEFILES_DIR)/makefile.bcc: filelist.txt wxwin.pro
$(TMAKE) -t bcc wxwin.pro -o $@
$(MSW_MAKEFILES_DIR)/makefile.sc: filelist.txt wxwin.pro
$(TMAKE) -t sc wxwin.pro -o $@
$(MSW_MAKEFILES_DIR)/makefile.wat: filelist.txt wxwin.pro
$(TMAKE) -t wat wxwin.pro -o $@
$(MSW_MAKEFILES_DIR)/makefile.g95: filelist.txt wxwin.pro
$(TMAKE) -t g95 wxwin.pro -o $@
$(MSW_MAKEFILES_DIR)/makefile.g295: filelist.txt wxwin.pro g295.t
$(TMAKE) -t g295 wxwin.pro -o $@
$(WXDIR)/Makefile.in: filelist.txt wxwin.pro
$(TMAKE) -t unx wxwin.pro -o $@

Some files were not shown because too many files have changed in this diff Show More