Compare commits
164 Commits
v2.2.0
...
WX_MAIN_AF
Author | SHA1 | Date | |
---|---|---|---|
|
ad6e48a469 | ||
|
3ca6a5f046 | ||
|
8fb3bfe20f | ||
|
2736b3ce6d | ||
|
3e14ad2f45 | ||
|
0ceae93229 | ||
|
2ada7c652c | ||
|
ad90972f27 | ||
|
aec4371660 | ||
|
33fed83514 | ||
|
0e67e9e2d0 | ||
|
266527ec60 | ||
|
29b5f2cc19 | ||
|
f737d3967f | ||
|
27316302a4 | ||
|
233058c7ab | ||
|
941830cbe5 | ||
|
3bd380a388 | ||
|
484523cf52 | ||
|
b1944ebcd0 | ||
|
b64de91622 | ||
|
63da7df701 | ||
|
bfc38e4363 | ||
|
8062a6ab7b | ||
|
9e85f5ec6c | ||
|
d44523b1e0 | ||
|
a793c17b6c | ||
|
4b0ca8b999 | ||
|
f6fb552e5d | ||
|
0bc6abf126 | ||
|
2695b17409 | ||
|
85d03040fc | ||
|
2f382cc6be | ||
|
5e5437e00b | ||
|
3f4fc7967b | ||
|
cbb4b02f09 | ||
|
c909783630 | ||
|
a6a997a68d | ||
|
11b6e0c533 | ||
|
75e0bd4460 | ||
|
ab13d1c58f | ||
|
45a248176c | ||
|
0bed1ceef8 | ||
|
f9c165b1d6 | ||
|
d62653e63f | ||
|
55b88634eb | ||
|
b0f853260e | ||
|
af2251f16f | ||
|
4ee0ff3bd6 | ||
|
7f3938321d | ||
|
f443043db0 | ||
|
1ad83f6b37 | ||
|
ae9cab0676 | ||
|
a0948e2723 | ||
|
0767cb6f44 | ||
|
4c7277db42 | ||
|
5c69031cd1 | ||
|
35a0184e7d | ||
|
10461e195f | ||
|
d3e41b770e | ||
|
78cb10ef7d | ||
|
fccd6cdc31 | ||
|
55db6a69ce | ||
|
4ccd46a29e | ||
|
dfc0e3fb9a | ||
|
1cfae2e074 | ||
|
1d43cb9e7f | ||
|
07d7f20b50 | ||
|
ad9cd15cb0 | ||
|
031dfec8d4 | ||
|
1126585b76 | ||
|
df801fc6d4 | ||
|
e45212eb04 | ||
|
fd433c2e31 | ||
|
3fa4bd0e78 | ||
|
3509d340e2 | ||
|
3112490359 | ||
|
56d2f75071 | ||
|
ca7408bd9a | ||
|
54ca0d120a | ||
|
3419e8e7bd | ||
|
5e679c4070 | ||
|
f77034779a | ||
|
3e61dfb0e8 | ||
|
0a1c1e6214 | ||
|
bb8a8dc5f7 | ||
|
2a2b997f07 | ||
|
012286eb3b | ||
|
632efa475b | ||
|
64c13219b0 | ||
|
51a58d8b4b | ||
|
4567f2b2c6 | ||
|
74afbadc17 | ||
|
494a19d6d9 | ||
|
71c97a89fa | ||
|
a55e0ebc56 | ||
|
264de0cc03 | ||
|
919ae91ad7 | ||
|
03817a5e24 | ||
|
78c49c5829 | ||
|
d82323930c | ||
|
47af912426 | ||
|
aff5d59148 | ||
|
e6afccba51 | ||
|
83918cccc9 | ||
|
f48d169c4a | ||
|
0f8d11dc8d | ||
|
8943b4030c | ||
|
a2d8ce854e | ||
|
dd00f3f6fa | ||
|
2afa14f2c7 | ||
|
ff67d5860d | ||
|
b7c2d6ffcb | ||
|
9d084560f8 | ||
|
e6ae733061 | ||
|
7edc258ec2 | ||
|
df530a2693 | ||
|
307fc8d582 | ||
|
2d4dc3a4d0 | ||
|
4aefa363ef | ||
|
63c8fa9565 | ||
|
d42508c2a0 | ||
|
8a667305e7 | ||
|
10ca1c1459 | ||
|
1cd5241886 | ||
|
66b3ec7f9a | ||
|
888b0f22a9 | ||
|
6f72b08293 | ||
|
ecc7ceee42 | ||
|
a3c8a7ad5e | ||
|
f6bcfd974e | ||
|
8a693e6e04 | ||
|
c42b1de68a | ||
|
b97a2c5385 | ||
|
05ba6762b5 | ||
|
00a96720ec | ||
|
a8e72c8f27 | ||
|
dbaf885e87 | ||
|
0384e718cf | ||
|
e0fcbf2390 | ||
|
55a76346b1 | ||
|
fbdcff4a78 | ||
|
8947dc6d65 | ||
|
1f7fd1a500 | ||
|
d8ecfb85ee | ||
|
09b61d999d | ||
|
69d4002111 | ||
|
da27bd0b4a | ||
|
b01ca3e3d9 | ||
|
8c6f3b9c6d | ||
|
88b780d9f9 | ||
|
64a3ee5fd2 | ||
|
13d7105a66 | ||
|
bb4624242b | ||
|
b963e7d546 | ||
|
40bd6154f1 | ||
|
96525e629a | ||
|
02c6eadbc8 | ||
|
15b8c27a7a | ||
|
61714c237d | ||
|
2df793f9f4 | ||
|
d92a1d4f5a | ||
|
d6a3816816 | ||
|
ea1f75db44 |
61
BuildCVS.txt
@@ -16,45 +16,30 @@ varaibles and PATH entries.
|
||||
Continue with item c) below.
|
||||
|
||||
|
||||
b) If using the GNU MinGW32 or GNU CygWin32 compilers
|
||||
b) If using the GNU Mingw32 or GNU Cygwin32 compilers
|
||||
|
||||
You'll need the compiler itself which is available from
|
||||
You can get Mingw32 from http://www.mingw.org
|
||||
|
||||
http://www.cygwin.com
|
||||
Cygwin32 is available at 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).
|
||||
The makefile might have small problems with Cygwin's tools
|
||||
so it is recommended to use Mingw32 and its toolchain instead
|
||||
if possible.
|
||||
|
||||
-> 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.
|
||||
-> If your are using an old Mingw32 version (gcc-2.95 or older),
|
||||
you might need to fix some headers with the patches contained
|
||||
in the wxWin\Mingw32-gcc295.patches file. PLEASE APPLY THESE
|
||||
PATCHES BY HAND! There are apparently a few different versions
|
||||
of the headers floating around. Note that these patches are
|
||||
not needed if you are using Mingw32 gcc-2.95.2 or newer.
|
||||
|
||||
-> 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
|
||||
appropiately.
|
||||
|
||||
|
||||
c) Build instructions
|
||||
@@ -64,9 +49,9 @@ c) Build instructions
|
||||
-> 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
|
||||
most features are enabled (i.e. defined to 1), for example:
|
||||
#define wxUSE_ODBC 0
|
||||
#define wxUSE_SOCKETS 0
|
||||
#define wxUSE_SOCKETS 1
|
||||
#define wxUSE_HTML 1
|
||||
#define wxUSE_THREADS 1
|
||||
#define wxUSE_FS_INET 0
|
||||
@@ -77,14 +62,12 @@ c) Build instructions
|
||||
#define wxUSE_LIBJPEG 1
|
||||
#define wxUSE_LIBPNG 1
|
||||
|
||||
and iostreams ares disabled with
|
||||
and std iostreams are 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++)
|
||||
or type: nmake -f makefile.vc (if using MS VC++)
|
||||
|
||||
|
||||
II) Unix ports
|
||||
|
135
Makefile.in
@@ -67,6 +67,8 @@ oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
localedir = $(datadir)/locale
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
@@ -123,18 +125,28 @@ DEMODIR = $(WXDIR)/demos
|
||||
UTILSDIR = $(WXDIR)/utils
|
||||
MISCDIR = $(WXDIR)/misc
|
||||
|
||||
DOCDIR = $(WXDIR)/docs
|
||||
DOCDIR = $(WXDIR)/docs
|
||||
INTLDIR = $(WXDIR)/locale
|
||||
|
||||
########################## Archive name ###############################
|
||||
|
||||
WXARCHIVE = @DISTDIR@-$(WX_MAJOR_VERSION_NUMBER).$(WX_MINOR_VERSION_NUMBER).$(WX_RELEASE_NUMBER).tgz
|
||||
WXGLARCHIVE = @DISTDIR@-gl-$(WX_MAJOR_VERSION_NUMBER).$(WX_MINOR_VERSION_NUMBER).$(WX_RELEASE_NUMBER).tgz
|
||||
WXSAMPLES = wx$(TOOLKIT)-samples-$(WX_MAJOR_VERSION_NUMBER).$(WX_MINOR_VERSION_NUMBER).$(WX_RELEASE_NUMBER).tgz
|
||||
WXDEMOS = wx$(TOOLKIT)-demos-$(WX_MAJOR_VERSION_NUMBER).$(WX_MINOR_VERSION_NUMBER).$(WX_RELEASE_NUMBER).tgz
|
||||
WXARCHIVE = @DISTDIR@-$(WX_MAJOR_VERSION_NUMBER).$(WX_MINOR_VERSION_NUMBER).$(WX_RELEASE_NUMBER).tar.gz
|
||||
WXGLARCHIVE = @DISTDIR@-gl-$(WX_MAJOR_VERSION_NUMBER).$(WX_MINOR_VERSION_NUMBER).$(WX_RELEASE_NUMBER).tar.gz
|
||||
WXSAMPLES = wx$(TOOLKIT)-samples-$(WX_MAJOR_VERSION_NUMBER).$(WX_MINOR_VERSION_NUMBER).$(WX_RELEASE_NUMBER).tar.gz
|
||||
WXDEMOS = wx$(TOOLKIT)-demos-$(WX_MAJOR_VERSION_NUMBER).$(WX_MINOR_VERSION_NUMBER).$(WX_RELEASE_NUMBER).tar.gz
|
||||
|
||||
WXARCHIVE_BZIP = @DISTDIR@-$(WX_MAJOR_VERSION_NUMBER).$(WX_MINOR_VERSION_NUMBER).$(WX_RELEASE_NUMBER).tar.bz2
|
||||
WXGLARCHIVE_BZIP = @DISTDIR@-gl-$(WX_MAJOR_VERSION_NUMBER).$(WX_MINOR_VERSION_NUMBER).$(WX_RELEASE_NUMBER).tar.bz2
|
||||
WXSAMPLES_BZIP = wx$(TOOLKIT)-samples-$(WX_MAJOR_VERSION_NUMBER).$(WX_MINOR_VERSION_NUMBER).$(WX_RELEASE_NUMBER).tar.bz2
|
||||
WXDEMOS_BZIP = wx$(TOOLKIT)-demos-$(WX_MAJOR_VERSION_NUMBER).$(WX_MINOR_VERSION_NUMBER).$(WX_RELEASE_NUMBER).tar.bz2
|
||||
|
||||
DISTDIR = ./_dist_dir/@DISTDIR@
|
||||
|
||||
|
||||
############################## Files ##################################
|
||||
|
||||
WX_LINGUAS = `cd $(top_srcdir)/locale && ls *.mo 2> /dev/null | sed -n 's/\.mo//p'`
|
||||
|
||||
# this line will include a file which defines ALL_SOURCES, ALL_OBJECTS,
|
||||
# ALL_DEPFILES and ALL_HEADERS variables with the complete list of .cpp, .o,
|
||||
# .d and .h/.inl files for the current toolkit
|
||||
@@ -380,7 +392,7 @@ afminstall: preinstall
|
||||
|
||||
# this is the real install target: copies the library, wx-config and the
|
||||
# headers to the installation directory
|
||||
preinstall: $(top_builddir)/lib/@WX_TARGET_LIBRARY@ $(top_builddir)/wx@TOOLKIT_DIR@-config
|
||||
preinstall: $(top_builddir)/lib/@WX_TARGET_LIBRARY@ $(top_builddir)/wx@TOOLKIT_NAME@-config
|
||||
@echo " "
|
||||
@echo " Installing wxWindows..."
|
||||
@echo " "
|
||||
@@ -389,15 +401,15 @@ preinstall: $(top_builddir)/lib/@WX_TARGET_LIBRARY@ $(top_builddir)/wx@TOOLKIT_D
|
||||
$(INSTALL) -d $(bindir)
|
||||
$(INSTALL) -d $(libdir)
|
||||
|
||||
$(INSTALL_SCRIPT) $(top_builddir)/wx@TOOLKIT_DIR@-config $(bindir)/wx@TOOLKIT_DIR@-config
|
||||
cd $(bindir) && rm -f wx-config && $(LN_S) wx@TOOLKIT_DIR@-config wx-config
|
||||
$(INSTALL_SCRIPT) $(top_builddir)/wx@TOOLKIT_NAME@-config $(bindir)/wx@TOOLKIT_NAME@-config
|
||||
cd $(bindir) && rm -f wx-config && $(LN_S) wx@TOOLKIT_NAME@-config wx-config
|
||||
$(INSTALL_PROGRAM) $(top_builddir)/lib/@WX_TARGET_LIBRARY@ $(libdir)/@WX_TARGET_LIBRARY@
|
||||
|
||||
$(INSTALL) -d $(libdir)/wx
|
||||
$(INSTALL) -d $(libdir)/wx/include
|
||||
$(INSTALL) -d $(libdir)/wx/include/wx
|
||||
$(INSTALL) -d $(libdir)/wx/include/wx/@TOOLKIT_DIR@
|
||||
$(INSTALL_DATA) $(top_builddir)/include/wx/@TOOLKIT_DIR@/setup.h $(libdir)/wx/include/wx/@TOOLKIT_DIR@/setup.h
|
||||
$(INSTALL) -d $(libdir)/wx/include/wx/@TOOLKIT_NAME@
|
||||
$(INSTALL_DATA) $(top_builddir)/include/wx/@TOOLKIT_DIR@/setup.h $(libdir)/wx/include/wx/@TOOLKIT_NAME@/setup.h
|
||||
|
||||
$(INSTALL) -d $(includedir)/wx
|
||||
@if test "$(USE_GUI)" = 1; then $(INSTALL) -d $(includedir)/wx/@TOOLKIT_DIR@; fi
|
||||
@@ -410,6 +422,14 @@ preinstall: $(top_builddir)/lib/@WX_TARGET_LIBRARY@ $(top_builddir)/wx@TOOLKIT_D
|
||||
echo "$(INSTALL_DATA) $(top_srcdir)/include/wx/$$p $(includedir)/wx/$$p"; \
|
||||
done
|
||||
|
||||
$(INSTALL) -d $(localedir)
|
||||
@for p in $(WX_LINGUAS); do \
|
||||
$(INSTALL) -d $(localedir)/$$p; \
|
||||
$(INSTALL) -d $(localedir)/$$p/LC_MESSAGES; \
|
||||
$(INSTALL_DATA) $(top_srcdir)/locale/$$p.mo $(localedir)/$$p/LC_MESSAGES/wxstd.mo; \
|
||||
echo "$(INSTALL_DATA) $(top_srcdir)/locale/$$p.mo $(localedir)/$$p/LC_MESSAGES/wxstd.mo"; \
|
||||
done
|
||||
|
||||
preinstall_gl: $(top_builddir)/lib/@WX_TARGET_LIBRARY_GL@
|
||||
@echo " "
|
||||
@echo " Installing wxWindows OpenGl add-on..."
|
||||
@@ -445,9 +465,9 @@ uninstall:
|
||||
@$(RM) $(libdir)/@WX_LIBRARY_LINK2_GL@
|
||||
@$(RM) $(libdir)/@WX_LIBRARY_LINK3_GL@
|
||||
@echo " Removing helper files..."
|
||||
@$(RM) $(libdir)/wx/include/wx/@TOOLKIT_DIR@/setup.h
|
||||
@$(RM) $(libdir)/wx/include/wx/@TOOLKIT_NAME@/setup.h
|
||||
@$(RM) $(bindir)/wx-config
|
||||
@$(RM) $(bindir)/wx@TOOLKIT_DIR@-config
|
||||
@$(RM) $(bindir)/wx@TOOLKIT_NAME@-config
|
||||
@$(RM) $(datadir)/wx/afm/*
|
||||
@$(RM) $(datadir)/wx/gs_afm/*
|
||||
# FIXME: wxBase doesnt install these next 3 dirs.
|
||||
@@ -458,8 +478,15 @@ uninstall:
|
||||
@list='$(HEADERS)'; for p in $$list; do \
|
||||
$(RM) $(includedir)/wx/$$p; \
|
||||
done
|
||||
@echo " Removing i18n files..."
|
||||
@-for p in $(WX_LINGUAS); do \
|
||||
$(RM) $(localedir)/$$p/LC_MESSAGES/wxstd.mo; \
|
||||
rmdir $(localedir)/$$p/LC_MESSAGES; \
|
||||
rmdir $(localedir)/$$p; \
|
||||
done
|
||||
@echo " Removing directories..."
|
||||
@if test -d $(libdir)/wx/include/wx/@TOOLKIT_DIR@; then rmdir $(libdir)/wx/include/wx/@TOOLKIT_DIR@; fi
|
||||
@-rmdir $(localedir)
|
||||
@if test -d $(libdir)/wx/include/wx/@TOOLKIT_NAME@; then rmdir $(libdir)/wx/include/wx/@TOOLKIT_NAME@; fi
|
||||
@if test -d $(libdir)/wx/include/wx; then rmdir $(libdir)/wx/include/wx; fi
|
||||
@if test -d $(libdir)/wx/include; then rmdir $(libdir)/wx/include; fi
|
||||
@if test -d $(libdir)/wx; then rmdir $(libdir)/wx; fi
|
||||
@@ -657,6 +684,7 @@ DEMOS_DIST: ALL_GUI_DIST
|
||||
cp $(DEMODIR)/life/*.h $(DISTDIR)/demos/life
|
||||
cp $(DEMODIR)/life/*.xpm $(DISTDIR)/demos/life
|
||||
cp $(DEMODIR)/life/*.inc $(DISTDIR)/demos/life
|
||||
cp $(DEMODIR)/life/*.lif $(DISTDIR)/demos/life
|
||||
cp $(DEMODIR)/life/bitmaps/*.xpm $(DISTDIR)/demos/life/bitmaps
|
||||
|
||||
mkdir $(DISTDIR)/demos/poem
|
||||
@@ -1144,6 +1172,12 @@ MISC_DIST: ALL_GUI_DIST
|
||||
mkdir $(DISTDIR)/misc/gs_afm
|
||||
cp $(MISCDIR)/gs_afm/*.afm $(DISTDIR)/misc/gs_afm
|
||||
|
||||
INTL_DIST:
|
||||
mkdir $(DISTDIR)/locale
|
||||
cp $(INTLDIR)/Makefile $(DISTDIR)/locale
|
||||
cp $(INTLDIR)/*.po $(DISTDIR)/locale
|
||||
-cp $(INTLDIR)/*.mo $(DISTDIR)/locale
|
||||
|
||||
MANUAL_DIST:
|
||||
mkdir $(DISTDIR)/docs
|
||||
mkdir $(DISTDIR)/docs/latex
|
||||
@@ -1158,40 +1192,45 @@ MANUAL_DIST:
|
||||
# those files needed for the Debian source package.
|
||||
# see utils/wxPython/distrib for scripts to make a proper wxPython dist.
|
||||
PYTHON_DIST:
|
||||
mkdir $(DISTDIR)/utils/wxPython
|
||||
mkdir $(DISTDIR)/utils/wxPython/demo
|
||||
mkdir $(DISTDIR)/utils/wxPython/demo/bitmaps
|
||||
mkdir $(DISTDIR)/utils/wxPython/demo/data
|
||||
mkdir $(DISTDIR)/utils/wxPython/distrib
|
||||
mkdir $(DISTDIR)/utils/wxPython/lib
|
||||
mkdir $(DISTDIR)/utils/wxPython/lib/editor
|
||||
mkdir $(DISTDIR)/utils/wxPython/lib/sizers
|
||||
mkdir $(DISTDIR)/utils/wxPython/modules
|
||||
mkdir $(DISTDIR)/utils/wxPython/modules/html
|
||||
mkdir $(DISTDIR)/utils/wxPython/modules/utils
|
||||
mkdir $(DISTDIR)/utils/wxPython/modules/utils/gtk
|
||||
mkdir $(DISTDIR)/utils/wxPython/src
|
||||
mkdir $(DISTDIR)/utils/wxPython/src/gtk
|
||||
mkdir $(DISTDIR)/wxPython
|
||||
mkdir $(DISTDIR)/wxPython/contrib
|
||||
mkdir $(DISTDIR)/wxPython/contrib/glcanvas
|
||||
mkdir $(DISTDIR)/wxPython/contrib/glcanvas/gtk
|
||||
mkdir $(DISTDIR)/wxPython/contrib/ogl
|
||||
mkdir $(DISTDIR)/wxPython/contrib/stc
|
||||
mkdir $(DISTDIR)/wxPython/demo
|
||||
mkdir $(DISTDIR)/wxPython/demo/bitmaps
|
||||
mkdir $(DISTDIR)/wxPython/demo/data
|
||||
mkdir $(DISTDIR)/wxPython/distrib
|
||||
mkdir $(DISTDIR)/wxPython/src
|
||||
mkdir $(DISTDIR)/wxPython/src/gtk
|
||||
mkdir $(DISTDIR)/wxPython/wxPython
|
||||
mkdir $(DISTDIR)/wxPython/wxPython/lib
|
||||
mkdir $(DISTDIR)/wxPython/wxPython/lib/editor
|
||||
mkdir $(DISTDIR)/wxPython/wxPython/lib/sizers
|
||||
|
||||
cp $(UTILSDIR)/wxPython/*.txt $(DISTDIR)/utils/wxPython
|
||||
-cp $(UTILSDIR)/wxPython/demo/* $(DISTDIR)/utils/wxPython/demo
|
||||
-cp $(UTILSDIR)/wxPython/demo/bitmaps/* $(DISTDIR)/utils/wxPython/demo/bitmaps
|
||||
-cp $(UTILSDIR)/wxPython/demo/data/* $(DISTDIR)/utils/wxPython/demo/data
|
||||
cp $(UTILSDIR)/wxPython/distrib/build.py $(DISTDIR)/utils/wxPython/distrib
|
||||
cp $(UTILSDIR)/wxPython/lib/*.py $(DISTDIR)/utils/wxPython/lib
|
||||
cp $(UTILSDIR)/wxPython/lib/editor/*.py $(DISTDIR)/utils/wxPython/lib/editor
|
||||
cp $(UTILSDIR)/wxPython/lib/sizers/*.py $(DISTDIR)/utils/wxPython/lib/sizers
|
||||
-cp $(UTILSDIR)/wxPython/modules/html/* $(DISTDIR)/utils/wxPython/modules/html
|
||||
-cp $(UTILSDIR)/wxPython/modules/utils/* $(DISTDIR)/utils/wxPython/modules/utils
|
||||
cp $(UTILSDIR)/wxPython/modules/utils/gtk/utils.* $(DISTDIR)/utils/wxPython/modules/utils/gtk
|
||||
-cp $(UTILSDIR)/wxPython/src/* $(DISTDIR)/utils/wxPython/src
|
||||
cp $(UTILSDIR)/wxPython/src/gtk/*.py $(DISTDIR)/utils/wxPython/src/gtk
|
||||
cp $(UTILSDIR)/wxPython/src/gtk/*.cpp $(DISTDIR)/utils/wxPython/src/gtk
|
||||
cp $(WXDIR)/wxPython/*.txt $(DISTDIR)/wxPython
|
||||
cp $(WXDIR)/wxPython/contrib/buildall.py $(DISTDIR)/wxPython/contrib
|
||||
-cp $(WXDIR)/wxPython/contrib/glcanvas/* $(DISTDIR)/wxPython/contrib/glcanvas
|
||||
cp $(WXDIR)/wxPython/contrib/glcanvas/gtk/glcanvas.* $(DISTDIR)/wxPython/contrib/glcanvas/gtk
|
||||
-cp $(WXDIR)/wxPython/contrib/ogl/* $(DISTDIR)/wxPython/contrib/ogl
|
||||
-cp $(WXDIR)/wxPython/contrib/stc/* $(DISTDIR)/wxPython/contrib/stc
|
||||
-cp $(WXDIR)/wxPython/demo/* $(DISTDIR)/wxPython/demo
|
||||
-cp $(WXDIR)/wxPython/demo/bitmaps/* $(DISTDIR)/wxPython/demo/bitmaps
|
||||
-cp $(WXDIR)/wxPython/demo/data/* $(DISTDIR)/wxPython/demo/data
|
||||
cp $(WXDIR)/wxPython/distrib/build.py $(DISTDIR)/wxPython/distrib
|
||||
-cp $(WXDIR)/wxPython/src/* $(DISTDIR)/wxPython/src
|
||||
cp $(WXDIR)/wxPython/src/gtk/*.py $(DISTDIR)/wxPython/src/gtk
|
||||
cp $(WXDIR)/wxPython/src/gtk/*.cpp $(DISTDIR)/wxPython/src/gtk
|
||||
cp $(WXDIR)/wxPython/wxPython/lib/*.py $(DISTDIR)/wxPython/wxPython/lib
|
||||
cp $(WXDIR)/wxPython/wxPython/lib/editor/*.py $(DISTDIR)/wxPython/wxPython/lib/editor
|
||||
cp $(WXDIR)/wxPython/wxPython/lib/sizers/*.py $(DISTDIR)/wxPython/wxPython/lib/sizers
|
||||
|
||||
distclean:
|
||||
$(RM) -r _dist_dir
|
||||
|
||||
dist: @GUIDIST@
|
||||
cp $(WXDIR)/src/files.lst $(DISTDIR)/src/
|
||||
@echo "*** Creating wxWindows distribution in $(DISTDIR)..."
|
||||
cd _dist_dir; tar ch @DISTDIR@ | gzip -f9 > $(WXARCHIVE); mv $(WXARCHIVE) ..
|
||||
@if test "$(USE_GUI)" = 1; then \
|
||||
@@ -1204,6 +1243,20 @@ dist: @GUIDIST@
|
||||
mv wxDemos demos; \
|
||||
fi
|
||||
|
||||
bzip-dist: @GUIDIST@
|
||||
cp $(WXDIR)/src/files.lst $(DISTDIR)/src/
|
||||
@echo "*** Creating wxWindows distribution in $(DISTDIR)..."
|
||||
cd _dist_dir; tar ch @DISTDIR@ | bzip2 -f9 > $(WXARCHIVE_BZIP); mv $(WXARCHIVE_BZIP) ..
|
||||
@if test "$(USE_GUI)" = 1; then \
|
||||
cd $(DISTDIR); \
|
||||
mv samples wxSamples; \
|
||||
tar ch wxSamples | bzip2 -f9 > ../../$(WXSAMPLES_BZIP); \
|
||||
mv wxSamples samples; \
|
||||
mv demos wxDemos; \
|
||||
tar ch wxDemos | bzip2 -f9 > ../../$(WXDEMOS_BZIP); \
|
||||
mv wxDemos demos; \
|
||||
fi
|
||||
|
||||
debian-dist: @GUIDIST@ MANUAL_DIST PYTHON_DIST
|
||||
mkdir $(DISTDIR)/debian
|
||||
-cp $(WXDIR)/debian/* $(DISTDIR)/debian
|
||||
|
194
aclocal.m4
vendored
Normal file
@@ -0,0 +1,194 @@
|
||||
# Configure paths for GTK+
|
||||
# Owen Taylor 97-11-3
|
||||
|
||||
dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
|
||||
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
|
||||
dnl
|
||||
AC_DEFUN(AM_PATH_GTK_2_0,
|
||||
[dnl
|
||||
dnl Get the cflags and libraries from the gtk-config-2.0 script
|
||||
dnl
|
||||
AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
|
||||
gtk_config_prefix="$withval", gtk_config_prefix="")
|
||||
AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
|
||||
gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
|
||||
AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
|
||||
, enable_gtktest=yes)
|
||||
|
||||
for module in . $4
|
||||
do
|
||||
case "$module" in
|
||||
gthread)
|
||||
gtk_config_args="$gtk_config_args gthread"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test x$gtk_config_exec_prefix != x ; then
|
||||
gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
|
||||
if test x${GTK_CONFIG_2_0+set} != xset ; then
|
||||
GTK_CONFIG_2_0=$gtk_config_exec_prefix/bin/gtk-config-2.0
|
||||
fi
|
||||
fi
|
||||
if test x$gtk_config_prefix != x ; then
|
||||
gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
|
||||
if test x${GTK_CONFIG_2_0+set} != xset ; then
|
||||
GTK_CONFIG_2_0=$gtk_config_prefix/bin/gtk-config-2.0
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_PATH_PROG(GTK_CONFIG_2_0, gtk-config-2.0, no)
|
||||
min_gtk_version=ifelse([$1], ,1.3.1,$1)
|
||||
AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
|
||||
no_gtk=""
|
||||
if test "$GTK_CONFIG_2_0" = "no" ; then
|
||||
no_gtk=yes
|
||||
else
|
||||
GTK_CFLAGS=`$GTK_CONFIG_2_0 $gtk_config_args --cflags`
|
||||
GTK_LIBS=`$GTK_CONFIG_2_0 $gtk_config_args --libs`
|
||||
gtk_config_major_version=`$GTK_CONFIG_2_0 $gtk_config_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
gtk_config_minor_version=`$GTK_CONFIG_2_0 $gtk_config_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
gtk_config_micro_version=`$GTK_CONFIG_2_0 $gtk_config_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
if test "x$enable_gtktest" = "xyes" ; then
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $GTK_CFLAGS"
|
||||
LIBS="$GTK_LIBS $LIBS"
|
||||
dnl
|
||||
dnl Now check if the installed GTK is sufficiently new. (Also sanity
|
||||
dnl checks the results of gtk-config-2.0 to some extent
|
||||
dnl
|
||||
rm -f conf.gtktest
|
||||
AC_TRY_RUN([
|
||||
#include <gtk/gtk.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
int major, minor, micro;
|
||||
char *tmp_version;
|
||||
|
||||
system ("touch conf.gtktest");
|
||||
|
||||
/* HP/UX 9 (%@#!) writes to sscanf strings */
|
||||
tmp_version = g_strdup("$min_gtk_version");
|
||||
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
|
||||
printf("%s, bad version string\n", "$min_gtk_version");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ((gtk_major_version != $gtk_config_major_version) ||
|
||||
(gtk_minor_version != $gtk_config_minor_version) ||
|
||||
(gtk_micro_version != $gtk_config_micro_version))
|
||||
{
|
||||
printf("\n*** 'gtk-config-2.0 --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
|
||||
$gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
|
||||
gtk_major_version, gtk_minor_version, gtk_micro_version);
|
||||
printf ("*** was found! If gtk-config-2.0 was correct, then it is best\n");
|
||||
printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
|
||||
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
|
||||
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
|
||||
printf("*** required on your system.\n");
|
||||
printf("*** If gtk-config-2.0 was wrong, set the environment variable GTK_CONFIG_2_0\n");
|
||||
printf("*** to point to the correct copy of gtk-config-2.0, and remove the file config.cache\n");
|
||||
printf("*** before re-running configure\n");
|
||||
}
|
||||
#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
|
||||
else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
|
||||
(gtk_minor_version != GTK_MINOR_VERSION) ||
|
||||
(gtk_micro_version != GTK_MICRO_VERSION))
|
||||
{
|
||||
printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
|
||||
GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
|
||||
printf("*** library (version %d.%d.%d)\n",
|
||||
gtk_major_version, gtk_minor_version, gtk_micro_version);
|
||||
}
|
||||
#endif /* defined (GTK_MAJOR_VERSION) ... */
|
||||
else
|
||||
{
|
||||
if ((gtk_major_version > major) ||
|
||||
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
|
||||
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
|
||||
gtk_major_version, gtk_minor_version, gtk_micro_version);
|
||||
printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
|
||||
major, minor, micro);
|
||||
printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
|
||||
printf("***\n");
|
||||
printf("*** If you have already installed a sufficiently new version, this error\n");
|
||||
printf("*** probably means that the wrong copy of the gtk-config-2.0 shell script is\n");
|
||||
printf("*** being found. The easiest way to fix this is to remove the old version\n");
|
||||
printf("*** of GTK+, but you can also set the GTK_CONFIG_2_0 environment to point to the\n");
|
||||
printf("*** correct copy of gtk-config-2.0. (In this case, you will have to\n");
|
||||
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
|
||||
printf("*** so that the correct libraries are found at run-time))\n");
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
if test "x$no_gtk" = x ; then
|
||||
AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
|
||||
ifelse([$2], , :, [$2])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test "$GTK_CONFIG_2_0" = "no" ; then
|
||||
echo "*** The gtk-config-2.0 script installed by GTK could not be found"
|
||||
echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
|
||||
echo "*** your path, or set the GTK_CONFIG_2_0 environment variable to the"
|
||||
echo "*** full path to gtk-config-2.0."
|
||||
else
|
||||
if test -f conf.gtktest ; then
|
||||
:
|
||||
else
|
||||
echo "*** Could not run GTK test program, checking why..."
|
||||
CFLAGS="$CFLAGS $GTK_CFLAGS"
|
||||
LIBS="$LIBS $GTK_LIBS"
|
||||
AC_TRY_LINK([
|
||||
#include <gtk/gtk.h>
|
||||
#include <stdio.h>
|
||||
], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
|
||||
[ echo "*** The test program compiled, but did not run. This usually means"
|
||||
echo "*** that the run-time linker is not finding GTK or finding the wrong"
|
||||
echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
|
||||
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
||||
echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
||||
echo "*** is required on your system"
|
||||
echo "***"
|
||||
echo "*** If you have an old version installed, it is best to remove it, although"
|
||||
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
|
||||
echo "***"
|
||||
echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
|
||||
echo "*** came with the system with the command"
|
||||
echo "***"
|
||||
echo "*** rpm --erase --nodeps gtk gtk-devel" ],
|
||||
[ echo "*** The test program failed to compile or link. See the file config.log for the"
|
||||
echo "*** exact error that occured. This usually means GTK was incorrectly installed"
|
||||
echo "*** or that you have moved GTK since it was installed. In the latter case, you"
|
||||
echo "*** may want to edit the gtk-config-2.0 script: $GTK_CONFIG_2_0" ])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
GTK_CFLAGS=""
|
||||
GTK_LIBS=""
|
||||
ifelse([$3], , :, [$3])
|
||||
fi
|
||||
AC_SUBST(GTK_CFLAGS)
|
||||
AC_SUBST(GTK_LIBS)
|
||||
rm -f conf.gtktest
|
||||
])
|
286
config.guess
vendored
@@ -1,6 +1,7 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
|
||||
# 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
|
||||
@@ -23,6 +24,7 @@
|
||||
|
||||
# Written by Per Bothner <bothner@cygnus.com>.
|
||||
# The master version of this file is at the FSF in /home/gd/gnu/lib.
|
||||
# Please send patches to the Autoconf mailing list <autoconf@gnu.org>.
|
||||
#
|
||||
# This script attempts to guess a canonical system name similar to
|
||||
# config.sub. If it succeeds, it prints the system name on stdout, and
|
||||
@@ -35,6 +37,20 @@
|
||||
# (but try to keep the structure clean).
|
||||
#
|
||||
|
||||
# Use $HOST_CC if defined. $CC may point to a cross-compiler
|
||||
if test x"$CC_FOR_BUILD" = x; then
|
||||
if test x"$HOST_CC" != x; then
|
||||
CC_FOR_BUILD="$HOST_CC"
|
||||
else
|
||||
if test x"$CC" != x; then
|
||||
CC_FOR_BUILD="$CC"
|
||||
else
|
||||
CC_FOR_BUILD=cc
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# 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
|
||||
@@ -46,7 +62,8 @@ 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
|
||||
dummy=dummy-$$
|
||||
trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
|
||||
|
||||
# Note: order is significant - the case branches are not exclusive.
|
||||
|
||||
@@ -59,7 +76,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
# 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
|
||||
cat <<EOF >$dummy.s
|
||||
.globl main
|
||||
.ent main
|
||||
main:
|
||||
@@ -76,9 +93,9 @@ main:
|
||||
ret \$31,(\$26),1
|
||||
.end main
|
||||
EOF
|
||||
${CC-cc} dummy.s -o dummy 2>/dev/null
|
||||
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
./dummy
|
||||
./$dummy
|
||||
case "$?" in
|
||||
7)
|
||||
UNAME_MACHINE="alpha"
|
||||
@@ -97,8 +114,14 @@ EOF
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
rm -f dummy.s dummy
|
||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
|
||||
rm -f $dummy.s $dummy
|
||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
exit 0 ;;
|
||||
Alpha\ *:Windows_NT*:*)
|
||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||
# Should we change UNAME_MACHINE based on the output of uname instead
|
||||
# of the specific Alpha model?
|
||||
echo alpha-pc-interix
|
||||
exit 0 ;;
|
||||
21064:Windows_NT:50:3)
|
||||
echo alpha-dec-winnt3.5
|
||||
@@ -142,7 +165,7 @@ EOF
|
||||
SR2?01:HI-UX/MPP:*:*)
|
||||
echo hppa1.1-hitachi-hiuxmpp
|
||||
exit 0;;
|
||||
Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*)
|
||||
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
|
||||
@@ -150,7 +173,7 @@ EOF
|
||||
echo pyramid-pyramid-bsd
|
||||
fi
|
||||
exit 0 ;;
|
||||
NILE:*:*:dcosx)
|
||||
NILE*:*:*:dcosx)
|
||||
echo pyramid-pyramid-svr4
|
||||
exit 0 ;;
|
||||
sun4H:SunOS:5.*:*)
|
||||
@@ -201,6 +224,32 @@ EOF
|
||||
atari*:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
# The situation for MiNT is a little confusing. The machine name
|
||||
# can be virtually everything (everything which is not
|
||||
# "atarist" or "atariste" at least should have a processor
|
||||
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
|
||||
# to the lowercase version "mint" (or "freemint"). Finally
|
||||
# the system name "TOS" denotes a system which is actually not
|
||||
# MiNT. But MiNT is downward compatible to TOS, so this should
|
||||
# be no problem.
|
||||
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
|
||||
echo m68k-milan-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
|
||||
echo m68k-hades-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
|
||||
echo m68k-unknown-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3*:NetBSD:*:*)
|
||||
echo m68k-sun-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
@@ -234,12 +283,16 @@ EOF
|
||||
VAX*:ULTRIX*:*:*)
|
||||
echo vax-dec-ultrix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
2020:CLIX:*:*)
|
||||
2020:CLIX:*:* | 2430: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; {
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#ifdef __cplusplus
|
||||
int main (int argc, char *argv[]) {
|
||||
#else
|
||||
int main (argc, argv) int argc; char *argv[]; {
|
||||
#endif
|
||||
#if defined (host_mips) && defined (MIPSEB)
|
||||
#if defined (SYSTYPE_SYSV)
|
||||
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
|
||||
@@ -254,10 +307,10 @@ EOF
|
||||
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
|
||||
$CC_FOR_BUILD $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:*:*)
|
||||
@@ -309,7 +362,7 @@ EOF
|
||||
exit 0 ;;
|
||||
*:AIX:2:3)
|
||||
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
|
||||
sed 's/^ //' << EOF >dummy.c
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#include <sys/systemcfg.h>
|
||||
|
||||
main()
|
||||
@@ -320,8 +373,8 @@ EOF
|
||||
exit(0);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
$CC_FOR_BUILD $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
|
||||
@@ -368,25 +421,25 @@ EOF
|
||||
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
|
||||
9000/[678][0-9][0-9])
|
||||
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
|
||||
#endif
|
||||
long cpu = sysconf (_SC_CPU_VERSION);
|
||||
|
||||
switch (cpu)
|
||||
|
||||
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:
|
||||
case CPU_PA_RISC2_0:
|
||||
#if defined(_SC_KERNEL_BITS)
|
||||
switch (bits)
|
||||
switch (bits)
|
||||
{
|
||||
case 64: puts ("hppa2.0w"); break;
|
||||
case 32: puts ("hppa2.0n"); break;
|
||||
@@ -394,20 +447,20 @@ EOF
|
||||
} break;
|
||||
#else /* !defined(_SC_KERNEL_BITS) */
|
||||
puts ("hppa2.0"); break;
|
||||
#endif
|
||||
#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
|
||||
($CC_FOR_BUILD $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
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#include <unistd.h>
|
||||
int
|
||||
main ()
|
||||
@@ -432,8 +485,8 @@ EOF
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
$CC_FOR_BUILD $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:*:* )
|
||||
@@ -442,6 +495,9 @@ EOF
|
||||
9000/8??:4.3bsd:*:*)
|
||||
echo hppa1.0-hp-bsd
|
||||
exit 0 ;;
|
||||
*9??*:MPE/iX:*:*)
|
||||
echo hppa1.0-hp-mpeix
|
||||
exit 0 ;;
|
||||
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
|
||||
echo hppa1.1-hp-osf
|
||||
exit 0 ;;
|
||||
@@ -458,6 +514,9 @@ EOF
|
||||
parisc*:Lites*:*:*)
|
||||
echo hppa1.1-hp-lites
|
||||
exit 0 ;;
|
||||
hppa*:OpenBSD:*:*)
|
||||
echo hppa-unknown-openbsd
|
||||
exit 0 ;;
|
||||
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
|
||||
echo c1-convex-bsd
|
||||
exit 0 ;;
|
||||
@@ -490,11 +549,14 @@ EOF
|
||||
CRAY*TS:*:*:*)
|
||||
echo t90-cray-unicos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
CRAY*T3E:*:*:*)
|
||||
echo t3e-cray-unicosmk${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_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
|
||||
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit 0 ;;
|
||||
@@ -507,13 +569,22 @@ EOF
|
||||
hp300:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-bsdi${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}
|
||||
*:BSD/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:FreeBSD:*:*)
|
||||
if test -x /usr/bin/objformat; then
|
||||
if test "elf" = "`/usr/bin/objformat`"; then
|
||||
echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
exit 0 ;;
|
||||
*:NetBSD:*:*)
|
||||
@@ -523,13 +594,22 @@ EOF
|
||||
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
exit 0 ;;
|
||||
i*:CYGWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-cygwin32
|
||||
echo ${UNAME_MACHINE}-pc-cygwin
|
||||
exit 0 ;;
|
||||
i*:MINGW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-mingw32
|
||||
exit 0 ;;
|
||||
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
|
||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
|
||||
# UNAME_MACHINE based on the output of uname instead of i386?
|
||||
echo i386-pc-interix
|
||||
exit 0 ;;
|
||||
i*:UWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-uwin
|
||||
exit 0 ;;
|
||||
p*:CYGWIN*:*)
|
||||
echo powerpcle-unknown-cygwin32
|
||||
echo powerpcle-unknown-cygwin
|
||||
exit 0 ;;
|
||||
prep*:SunOS:5.*:*)
|
||||
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
@@ -541,12 +621,14 @@ EOF
|
||||
# uname on the ARM produces all sorts of strangeness, and we need to
|
||||
# filter it out.
|
||||
case "$UNAME_MACHINE" in
|
||||
armv*) UNAME_MACHINE=$UNAME_MACHINE ;;
|
||||
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`
|
||||
# first see if it will tell us. cd to the root directory to prevent
|
||||
# problems with other programs or directories called `ld' in the path.
|
||||
ld_help_string=`cd /; ld --help 2>&1`
|
||||
ld_supported_emulations=`echo $ld_help_string \
|
||||
| sed -ne '/supported emulations:/!d
|
||||
s/[ ][ ]*/ /g
|
||||
@@ -559,11 +641,40 @@ EOF
|
||||
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 ;;
|
||||
elf32ppc)
|
||||
# Determine Lib Version
|
||||
cat >$dummy.c <<EOF
|
||||
#include <features.h>
|
||||
#if defined(__GLIBC__)
|
||||
extern char __libc_version[];
|
||||
extern char __libc_release[];
|
||||
#endif
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
#if defined(__GLIBC__)
|
||||
printf("%s %s\n", __libc_version, __libc_release);
|
||||
#else
|
||||
printf("unkown\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
LIBC=""
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
./$dummy | grep 1\.99 > /dev/null
|
||||
if test "$?" = 0 ; then
|
||||
LIBC="libc1"
|
||||
fi
|
||||
fi
|
||||
rm -f $dummy.c $dummy
|
||||
echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
|
||||
esac
|
||||
|
||||
if test "${UNAME_MACHINE}" = "alpha" ; then
|
||||
sed 's/^ //' <<EOF >dummy.s
|
||||
sed 's/^ //' <<EOF >$dummy.s
|
||||
.globl main
|
||||
.ent main
|
||||
main:
|
||||
@@ -581,9 +692,9 @@ EOF
|
||||
.end main
|
||||
EOF
|
||||
LIBC=""
|
||||
${CC-cc} dummy.s -o dummy 2>/dev/null
|
||||
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
./dummy
|
||||
./$dummy
|
||||
case "$?" in
|
||||
7)
|
||||
UNAME_MACHINE="alpha"
|
||||
@@ -600,22 +711,23 @@ EOF
|
||||
16)
|
||||
UNAME_MACHINE="alphaev6"
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
|
||||
objdump --private-headers dummy | \
|
||||
objdump --private-headers $dummy | \
|
||||
grep ld.so.1 > /dev/null
|
||||
if test "$?" = 0 ; then
|
||||
LIBC="libc1"
|
||||
fi
|
||||
fi
|
||||
rm -f dummy.s dummy
|
||||
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[];
|
||||
{
|
||||
cat >$dummy.c <<EOF
|
||||
#ifdef __cplusplus
|
||||
int main (int argc, char *argv[]) {
|
||||
#else
|
||||
int main (argc, argv) int argc; char *argv[]; {
|
||||
#endif
|
||||
#ifdef __MIPSEB__
|
||||
printf ("%s-unknown-linux-gnu\n", argv[1]);
|
||||
#endif
|
||||
@@ -625,8 +737,8 @@ main(argc, argv)
|
||||
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
|
||||
$CC_FOR_BUILD $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.
|
||||
@@ -645,12 +757,13 @@ EOF
|
||||
;;
|
||||
esac
|
||||
# Determine whether the default compiler is a.out or elf
|
||||
cat >dummy.c <<EOF
|
||||
cat >$dummy.c <<EOF
|
||||
#include <features.h>
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
#ifdef __cplusplus
|
||||
int main (int argc, char *argv[]) {
|
||||
#else
|
||||
int main (argc, argv) int argc; char *argv[]; {
|
||||
#endif
|
||||
#ifdef __ELF__
|
||||
# ifdef __GLIBC__
|
||||
# if __GLIBC__ >= 2
|
||||
@@ -667,8 +780,8 @@ main(argc, argv)
|
||||
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
|
||||
$CC_FOR_BUILD $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.
|
||||
@@ -690,6 +803,14 @@ EOF
|
||||
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
i?86:*:5:7*)
|
||||
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
|
||||
(/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585
|
||||
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
|
||||
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`
|
||||
@@ -699,18 +820,15 @@ EOF
|
||||
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
|
||||
&& UNAME_MACHINE=i586
|
||||
(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
|
||||
&& UNAME_MACHINE=i686
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
|
||||
&& UNAME_MACHINE=i686
|
||||
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.
|
||||
@@ -752,7 +870,7 @@ EOF
|
||||
mc68030:UNIX_System_V:4.*:*)
|
||||
echo m68k-atari-sysv4
|
||||
exit 0 ;;
|
||||
i?86:LynxOS:2.*:*)
|
||||
i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
|
||||
echo i386-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
TSUNAMI:LynxOS:2.*:*)
|
||||
@@ -764,6 +882,9 @@ EOF
|
||||
SM[BE]S:UNIX_SV:*:*)
|
||||
echo mips-dde-sysv${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
RM*:ReliantUNIX-*:*:*)
|
||||
echo mips-sni-sysv4
|
||||
exit 0 ;;
|
||||
RM*:SINIX-*:*:*)
|
||||
echo mips-sni-sysv4
|
||||
exit 0 ;;
|
||||
@@ -794,7 +915,7 @@ EOF
|
||||
news*:NEWS-OS:*:6*)
|
||||
echo mips-sony-newsos6
|
||||
exit 0 ;;
|
||||
R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*)
|
||||
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
|
||||
if [ -d /usr/nec ]; then
|
||||
echo mips-nec-sysv${UNAME_RELEASE}
|
||||
else
|
||||
@@ -810,12 +931,24 @@ EOF
|
||||
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
|
||||
echo i586-pc-beos
|
||||
exit 0 ;;
|
||||
SX-4:SUPER-UX:*:*)
|
||||
echo sx4-nec-superux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
SX-5:SUPER-UX:*:*)
|
||||
echo sx5-nec-superux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
Power*:Rhapsody:*:*)
|
||||
echo powerpc-apple-rhapsody${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:Rhapsody:*:*)
|
||||
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
|
||||
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
|
||||
cat >$dummy.c <<EOF
|
||||
#ifdef _SEQUENT_
|
||||
# include <sys/types.h>
|
||||
# include <sys/utsname.h>
|
||||
@@ -853,7 +986,10 @@ main ()
|
||||
#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);
|
||||
if (version < 4)
|
||||
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
|
||||
else
|
||||
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
|
||||
exit (0);
|
||||
#endif
|
||||
|
||||
@@ -913,8 +1049,8 @@ main ()
|
||||
}
|
||||
EOF
|
||||
|
||||
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
$CC_FOR_BUILD $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.
|
||||
|
||||
|
308
config.sub
vendored
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script, version 1.1.
|
||||
# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 92-97, 1998, 1999 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.
|
||||
@@ -98,11 +98,21 @@ case $os in
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
-sim | -cisco | -oki | -wec | -winbond)
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
-scout)
|
||||
;;
|
||||
-wrs)
|
||||
os=vxworks
|
||||
basic_machine=$1
|
||||
;;
|
||||
-hiux*)
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
-sco5)
|
||||
os=sco3.2v5
|
||||
os=-sco3.2v5
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco4)
|
||||
@@ -121,6 +131,9 @@ case $os in
|
||||
os=-sco3.2v2
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-udk*)
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-isc)
|
||||
os=-isc2.2
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
@@ -151,14 +164,21 @@ case $basic_machine in
|
||||
# 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)
|
||||
| 580 | i960 | h8300 \
|
||||
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
|
||||
| alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \
|
||||
| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
|
||||
| 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
|
||||
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
|
||||
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
|
||||
| mips64vr5000 | miprs64vr5000el \
|
||||
| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
|
||||
| thumb | d10v)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65)
|
||||
;;
|
||||
|
||||
# We use `pc' rather than `unknown'
|
||||
# because (1) that's what they normally are, and
|
||||
# (2) the word "unknown" tends to confuse beginning users.
|
||||
@@ -174,24 +194,41 @@ case $basic_machine in
|
||||
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-* \
|
||||
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
|
||||
| xmp-* | ymp-* \
|
||||
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
|
||||
| alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \
|
||||
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
|
||||
| clipper-* | orion-* \
|
||||
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
|
||||
| sparc64-* | mips64-* | mipsel-* \
|
||||
| mips64el-* | mips64orion-* | mips64orionel-* \
|
||||
| sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
|
||||
| mips64el-* | mips64orion-* | mips64orionel-* \
|
||||
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
|
||||
| mipstx39-* | mipstx39el-* \
|
||||
| f301-*)
|
||||
| f301-* | armv*-* | t3e-* \
|
||||
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
|
||||
| thumb-* | v850-* | d30v-* | tic30-* | c30-* )
|
||||
;;
|
||||
# Recognize the various machine names and aliases which stand
|
||||
# for a CPU type and a company and sometimes even an OS.
|
||||
386bsd)
|
||||
basic_machine=i386-unknown
|
||||
os=-bsd
|
||||
;;
|
||||
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
|
||||
basic_machine=m68000-att
|
||||
;;
|
||||
3b*)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
a29khif)
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
adobe68k)
|
||||
basic_machine=m68010-adobe
|
||||
os=-scout
|
||||
;;
|
||||
alliant | fx80)
|
||||
basic_machine=fx80-alliant
|
||||
;;
|
||||
@@ -221,6 +258,10 @@ case $basic_machine in
|
||||
basic_machine=m68k-apollo
|
||||
os=-sysv
|
||||
;;
|
||||
apollo68bsd)
|
||||
basic_machine=m68k-apollo
|
||||
os=-bsd
|
||||
;;
|
||||
aux)
|
||||
basic_machine=m68k-apple
|
||||
os=-aux
|
||||
@@ -297,6 +338,10 @@ case $basic_machine in
|
||||
encore | umax | mmax)
|
||||
basic_machine=ns32k-encore
|
||||
;;
|
||||
es1800 | OSE68k | ose68k | ose | OSE)
|
||||
basic_machine=m68k-ericsson
|
||||
os=-ose
|
||||
;;
|
||||
fx2800)
|
||||
basic_machine=i860-alliant
|
||||
;;
|
||||
@@ -315,6 +360,14 @@ case $basic_machine in
|
||||
basic_machine=h8300-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
h8300xray)
|
||||
basic_machine=h8300-hitachi
|
||||
os=-xray
|
||||
;;
|
||||
h8500hms)
|
||||
basic_machine=h8500-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
harris)
|
||||
basic_machine=m88k-harris
|
||||
os=-sysv3
|
||||
@@ -330,13 +383,30 @@ case $basic_machine in
|
||||
basic_machine=m68k-hp
|
||||
os=-hpux
|
||||
;;
|
||||
hp3k9[0-9][0-9] | hp9[0-9][0-9])
|
||||
basic_machine=hppa1.0-hp
|
||||
;;
|
||||
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)
|
||||
hp9k6[0-9][0-9] | hp6[0-9][0-9])
|
||||
basic_machine=hppa1.0-hp
|
||||
;;
|
||||
hp9k7[0-79][0-9] | hp7[0-79][0-9])
|
||||
basic_machine=hppa1.1-hp
|
||||
;;
|
||||
hp9k78[0-9] | hp78[0-9])
|
||||
# FIXME: really hppa2.0-hp
|
||||
basic_machine=hppa1.1-hp
|
||||
;;
|
||||
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
|
||||
# FIXME: really hppa2.0-hp
|
||||
basic_machine=hppa1.1-hp
|
||||
;;
|
||||
hp9k8[0-9][13679] | hp8[0-9][13679])
|
||||
basic_machine=hppa1.1-hp
|
||||
;;
|
||||
hp9k8[0-9][0-9] | hp8[0-9][0-9])
|
||||
@@ -345,6 +415,14 @@ case $basic_machine in
|
||||
hppa-next)
|
||||
os=-nextstep3
|
||||
;;
|
||||
hppaosf)
|
||||
basic_machine=hppa1.1-hp
|
||||
os=-osf
|
||||
;;
|
||||
hppro)
|
||||
basic_machine=hppa1.1-hp
|
||||
os=-proelf
|
||||
;;
|
||||
i370-ibm* | ibm*)
|
||||
basic_machine=i370-ibm
|
||||
os=-mvs
|
||||
@@ -366,6 +444,22 @@ case $basic_machine in
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-solaris2
|
||||
;;
|
||||
i386mach)
|
||||
basic_machine=i386-mach
|
||||
os=-mach
|
||||
;;
|
||||
i386-vsta | vsta)
|
||||
basic_machine=i386-unknown
|
||||
os=-vsta
|
||||
;;
|
||||
i386-go32 | go32)
|
||||
basic_machine=i386-unknown
|
||||
os=-go32
|
||||
;;
|
||||
i386-mingw32 | mingw32)
|
||||
basic_machine=i386-unknown
|
||||
os=-mingw32
|
||||
;;
|
||||
iris | iris4d)
|
||||
basic_machine=mips-sgi
|
||||
case $os in
|
||||
@@ -394,6 +488,10 @@ case $basic_machine in
|
||||
miniframe)
|
||||
basic_machine=m68000-convergent
|
||||
;;
|
||||
*mint | *MiNT)
|
||||
basic_machine=m68k-atari
|
||||
os=-mint
|
||||
;;
|
||||
mipsel*-linux*)
|
||||
basic_machine=mipsel-unknown
|
||||
os=-linux-gnu
|
||||
@@ -408,10 +506,26 @@ case $basic_machine in
|
||||
mips3*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
|
||||
;;
|
||||
monitor)
|
||||
basic_machine=m68k-rom68k
|
||||
os=-coff
|
||||
;;
|
||||
msdos)
|
||||
basic_machine=i386-unknown
|
||||
os=-msdos
|
||||
;;
|
||||
ncr3000)
|
||||
basic_machine=i486-ncr
|
||||
os=-sysv4
|
||||
;;
|
||||
netbsd386)
|
||||
basic_machine=i386-unknown
|
||||
os=-netbsd
|
||||
;;
|
||||
netwinder)
|
||||
basic_machine=armv4l-corel
|
||||
os=-linux
|
||||
;;
|
||||
news | news700 | news800 | news900)
|
||||
basic_machine=m68k-sony
|
||||
os=-newsos
|
||||
@@ -424,6 +538,10 @@ case $basic_machine in
|
||||
basic_machine=mips-sony
|
||||
os=-newsos
|
||||
;;
|
||||
necv70)
|
||||
basic_machine=v70-nec
|
||||
os=-sysv
|
||||
;;
|
||||
next | m*-next )
|
||||
basic_machine=m68k-next
|
||||
case $os in
|
||||
@@ -449,9 +567,25 @@ case $basic_machine in
|
||||
basic_machine=i960-intel
|
||||
os=-nindy
|
||||
;;
|
||||
mon960)
|
||||
basic_machine=i960-intel
|
||||
os=-mon960
|
||||
;;
|
||||
np1)
|
||||
basic_machine=np1-gould
|
||||
;;
|
||||
op50n-* | op60c-*)
|
||||
basic_machine=hppa1.1-oki
|
||||
os=-proelf
|
||||
;;
|
||||
OSE68000 | ose68000)
|
||||
basic_machine=m68000-ericsson
|
||||
os=-ose
|
||||
;;
|
||||
os68k)
|
||||
basic_machine=m68k-none
|
||||
os=-os68k
|
||||
;;
|
||||
pa-hitachi)
|
||||
basic_machine=hppa1.1-hitachi
|
||||
os=-hiuxwe2
|
||||
@@ -469,19 +603,19 @@ case $basic_machine in
|
||||
pc532 | pc532-*)
|
||||
basic_machine=ns32k-pc532
|
||||
;;
|
||||
pentium | p5 | k5 | nexen)
|
||||
pentium | p5 | k5 | k6 | nexen)
|
||||
basic_machine=i586-pc
|
||||
;;
|
||||
pentiumpro | p6 | k6 | 6x86)
|
||||
pentiumpro | p6 | 6x86)
|
||||
basic_machine=i686-pc
|
||||
;;
|
||||
pentiumii | pentium2)
|
||||
basic_machine=i786-pc
|
||||
;;
|
||||
pentium-* | p5-* | k5-* | nexen-*)
|
||||
pentium-* | p5-* | k5-* | k6-* | nexen-*)
|
||||
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumpro-* | p6-* | k6-* | 6x86-*)
|
||||
pentiumpro-* | p6-* | 6x86-*)
|
||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumii-* | pentium2-*)
|
||||
@@ -505,12 +639,20 @@ case $basic_machine in
|
||||
ps2)
|
||||
basic_machine=i386-ibm
|
||||
;;
|
||||
rom68k)
|
||||
basic_machine=m68k-rom68k
|
||||
os=-coff
|
||||
;;
|
||||
rm[46]00)
|
||||
basic_machine=mips-siemens
|
||||
;;
|
||||
rtpc | rtpc-*)
|
||||
basic_machine=romp-ibm
|
||||
;;
|
||||
sa29200)
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
sequent)
|
||||
basic_machine=i386-sequent
|
||||
;;
|
||||
@@ -518,6 +660,10 @@ case $basic_machine in
|
||||
basic_machine=sh-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
sparclite-wrs)
|
||||
basic_machine=sparclite-wrs
|
||||
os=-vxworks
|
||||
;;
|
||||
sps7)
|
||||
basic_machine=m68k-bull
|
||||
os=-sysv2
|
||||
@@ -525,6 +671,13 @@ case $basic_machine in
|
||||
spur)
|
||||
basic_machine=spur-unknown
|
||||
;;
|
||||
st2000)
|
||||
basic_machine=m68k-tandem
|
||||
;;
|
||||
stratus)
|
||||
basic_machine=i860-stratus
|
||||
os=-sysv4
|
||||
;;
|
||||
sun2)
|
||||
basic_machine=m68000-sun
|
||||
;;
|
||||
@@ -569,6 +722,10 @@ case $basic_machine in
|
||||
basic_machine=i386-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
t3e)
|
||||
basic_machine=t3e-cray
|
||||
os=-unicos
|
||||
;;
|
||||
tx39)
|
||||
basic_machine=mipstx39-unknown
|
||||
;;
|
||||
@@ -586,6 +743,10 @@ case $basic_machine in
|
||||
basic_machine=a29k-nyu
|
||||
os=-sym1
|
||||
;;
|
||||
v810 | necv810)
|
||||
basic_machine=v810-nec
|
||||
os=-none
|
||||
;;
|
||||
vaxv)
|
||||
basic_machine=vax-dec
|
||||
os=-sysv
|
||||
@@ -609,6 +770,14 @@ case $basic_machine in
|
||||
basic_machine=a29k-wrs
|
||||
os=-vxworks
|
||||
;;
|
||||
w65*)
|
||||
basic_machine=w65-wdc
|
||||
os=-none
|
||||
;;
|
||||
w89k-*)
|
||||
basic_machine=hppa1.1-winbond
|
||||
os=-proelf
|
||||
;;
|
||||
xmp)
|
||||
basic_machine=xmp-cray
|
||||
os=-unicos
|
||||
@@ -616,6 +785,10 @@ case $basic_machine in
|
||||
xps | xps100)
|
||||
basic_machine=xps100-honeywell
|
||||
;;
|
||||
z8k-*-coff)
|
||||
basic_machine=z8k-unknown
|
||||
os=-sim
|
||||
;;
|
||||
none)
|
||||
basic_machine=none-none
|
||||
os=-none
|
||||
@@ -623,6 +796,15 @@ case $basic_machine in
|
||||
|
||||
# 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.
|
||||
w89k)
|
||||
basic_machine=hppa1.1-winbond
|
||||
;;
|
||||
op50n)
|
||||
basic_machine=hppa1.1-oki
|
||||
;;
|
||||
op60c)
|
||||
basic_machine=hppa1.1-oki
|
||||
;;
|
||||
mips)
|
||||
if [ x$os = x-linux-gnu ]; then
|
||||
basic_machine=mips-unknown
|
||||
@@ -645,7 +827,7 @@ case $basic_machine in
|
||||
we32k)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
sparc)
|
||||
sparc | sparcv9)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
cydra)
|
||||
@@ -657,6 +839,16 @@ case $basic_machine in
|
||||
orion105)
|
||||
basic_machine=clipper-highlevel
|
||||
;;
|
||||
mac | mpw | mac-mpw)
|
||||
basic_machine=m68k-apple
|
||||
;;
|
||||
pmac | pmac-mpw)
|
||||
basic_machine=powerpc-apple
|
||||
;;
|
||||
c4x*)
|
||||
basic_machine=c4x-none
|
||||
os=-coff
|
||||
;;
|
||||
*)
|
||||
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
|
||||
exit 1
|
||||
@@ -710,13 +902,21 @@ case $os in
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
|
||||
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
|
||||
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -uxpv* | -beos*)
|
||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
|
||||
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
|
||||
| -macos* | -mpw* | -magic* | -mon960* | -lnews*)
|
||||
;;
|
||||
-mac*)
|
||||
os=`echo $os | sed -e 's|mac|macos|'`
|
||||
;;
|
||||
-linux*)
|
||||
os=`echo $os | sed -e 's|linux|linux-gnu|'`
|
||||
;;
|
||||
@@ -741,6 +941,9 @@ case $os in
|
||||
-acis*)
|
||||
os=-aos
|
||||
;;
|
||||
-386bsd)
|
||||
os=-bsd
|
||||
;;
|
||||
-ctix* | -uts*)
|
||||
os=-sysv
|
||||
;;
|
||||
@@ -772,9 +975,18 @@ case $os in
|
||||
# This must come after -sysvr4.
|
||||
-sysv*)
|
||||
;;
|
||||
-ose*)
|
||||
os=-ose
|
||||
;;
|
||||
-es1800*)
|
||||
os=-ose
|
||||
;;
|
||||
-xenix)
|
||||
os=-xenix
|
||||
;;
|
||||
-*mint | -*MiNT)
|
||||
os=-mint
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
*)
|
||||
@@ -800,6 +1012,9 @@ case $basic_machine in
|
||||
*-acorn)
|
||||
os=-riscix1.2
|
||||
;;
|
||||
arm*-corel)
|
||||
os=-linux
|
||||
;;
|
||||
arm*-semi)
|
||||
os=-aout
|
||||
;;
|
||||
@@ -821,6 +1036,15 @@ case $basic_machine in
|
||||
# default.
|
||||
# os=-sunos4
|
||||
;;
|
||||
m68*-cisco)
|
||||
os=-aout
|
||||
;;
|
||||
mips*-cisco)
|
||||
os=-elf
|
||||
;;
|
||||
mips*-*)
|
||||
os=-elf
|
||||
;;
|
||||
*-tti) # must be before sparc entry or we get the wrong os.
|
||||
os=-sysv3
|
||||
;;
|
||||
@@ -833,6 +1057,15 @@ case $basic_machine in
|
||||
*-ibm)
|
||||
os=-aix
|
||||
;;
|
||||
*-wec)
|
||||
os=-proelf
|
||||
;;
|
||||
*-winbond)
|
||||
os=-proelf
|
||||
;;
|
||||
*-oki)
|
||||
os=-proelf
|
||||
;;
|
||||
*-hp)
|
||||
os=-hpux
|
||||
;;
|
||||
@@ -896,6 +1129,18 @@ case $basic_machine in
|
||||
f301-fujitsu)
|
||||
os=-uxpv
|
||||
;;
|
||||
*-rom68k)
|
||||
os=-coff
|
||||
;;
|
||||
*-*bug)
|
||||
os=-coff
|
||||
;;
|
||||
*-apple)
|
||||
os=-macos
|
||||
;;
|
||||
*-atari*)
|
||||
os=-mint
|
||||
;;
|
||||
*)
|
||||
os=-none
|
||||
;;
|
||||
@@ -917,9 +1162,15 @@ case $basic_machine in
|
||||
-aix*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-beos*)
|
||||
vendor=be
|
||||
;;
|
||||
-hpux*)
|
||||
vendor=hp
|
||||
;;
|
||||
-mpeix*)
|
||||
vendor=hp
|
||||
;;
|
||||
-hiux*)
|
||||
vendor=hitachi
|
||||
;;
|
||||
@@ -947,6 +1198,15 @@ case $basic_machine in
|
||||
-aux*)
|
||||
vendor=apple
|
||||
;;
|
||||
-hms*)
|
||||
vendor=hitachi
|
||||
;;
|
||||
-mpw* | -macos*)
|
||||
vendor=apple
|
||||
;;
|
||||
-*mint | -*MiNT)
|
||||
vendor=atari
|
||||
;;
|
||||
esac
|
||||
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
|
||||
;;
|
||||
|
370
configure.in
@@ -456,11 +456,11 @@ dnl
|
||||
dnl WX_INTERFACE_AGE = 0
|
||||
|
||||
WX_MAJOR_VERSION_NUMBER=2
|
||||
WX_MINOR_VERSION_NUMBER=1
|
||||
WX_RELEASE_NUMBER=14
|
||||
WX_MINOR_VERSION_NUMBER=3
|
||||
WX_RELEASE_NUMBER=0
|
||||
|
||||
WX_INTERFACE_AGE=0
|
||||
WX_BINARY_AGE=0
|
||||
WX_BINARY_AGE=1
|
||||
|
||||
WX_VERSION=$WX_MAJOR_VERSION_NUMBER.$WX_MINOR_VERSION_NUMBER.$WX_RELEASE_NUMBER
|
||||
|
||||
@@ -492,6 +492,7 @@ USE_ALPHA=
|
||||
USE_OSF=
|
||||
USE_BSD=
|
||||
USE_FREEBSD=
|
||||
USE_NETBSD=
|
||||
USE_VMS=
|
||||
USE_ULTRIX=
|
||||
USE_CYGWIN=
|
||||
@@ -572,19 +573,27 @@ case "${host}" in
|
||||
AC_DEFINE(__BSD__)
|
||||
DEFAULT_DEFAULT_wxUSE_MOTIF=1
|
||||
;;
|
||||
*-*-freebsd* | *-*-netbsd*)
|
||||
*-*-freebsd*)
|
||||
USE_BSD=1
|
||||
USE_FREEBSD=1
|
||||
AC_DEFINE(__FREEBSD__)
|
||||
AC_DEFINE(__BSD__)
|
||||
DEFAULT_DEFAULT_wxUSE_GTK=1
|
||||
;;
|
||||
*-*-netbsd*)
|
||||
USE_BSD=1
|
||||
USE_NETBSD=1
|
||||
AC_DEFINE(__FREEBSD__)
|
||||
AC_DEFINE(__NETBSD__)
|
||||
DEFAULT_DEFAULT_wxUSE_GTK=1
|
||||
;;
|
||||
*-*-osf* )
|
||||
USE_ALPHA=1
|
||||
USE_OSF=1
|
||||
AC_DEFINE(__ALPHA__)
|
||||
AC_DEFINE(__OSF__)
|
||||
DEFAULT_DEFAULT_wxUSE_MOTIF=1
|
||||
NEEDS_D_REENTRANT_FOR_R_FUNCS=1
|
||||
;;
|
||||
*-*-dgux5* )
|
||||
USE_ALPHA=1
|
||||
@@ -1028,7 +1037,6 @@ WX_ARG_ENABLE(textfile, [ --enable-textfile use wxTextFile classes],
|
||||
WX_ARG_ENABLE(unicode, [ --enable-unicode compile wxString with Unicode support], wxUSE_UNICODE)
|
||||
WX_ARG_ENABLE(wcsrtombs, [ --enable-wcsrtombs use wcsrtombs instead of buggy (GNU libc1/Linux libc5) wcstombs], wxUSE_WCSRTOMBS)
|
||||
WX_ARG_ENABLE(wxprintfv, [ --enable-wxprintfv use wxWindows implementation of vprintf()], wxUSE_EXPERIMENTAL_PRINTF)
|
||||
WX_ARG_ENABLE(joystick, [ --enable-joystick compile in joystick support (Linux only)], wxUSE_JOYSTICK)
|
||||
WX_ARG_ENABLE(std_iostreams, [ --enable-std_iostreams use standard C++ stream classes], wxUSE_STD_IOSTREAM)
|
||||
WX_ARG_ENABLE(filesystem, [ --enable-filesystem use virtual file systems classes], wxUSE_FILESYSTEM)
|
||||
WX_ARG_ENABLE(fs_inet, [ --enable-fs_inet use virtual HTTP/FTP filesystems], wxUSE_FS_INET)
|
||||
@@ -1208,6 +1216,7 @@ WX_ARG_ENABLE(splines, [ --enable-splines use spline drawing code],
|
||||
WX_ARG_ENABLE(validators, [ --enable-validators use wxValidator and derived classes], wxUSE_VALIDATORS)
|
||||
WX_ARG_ENABLE(busyinfo, [ --enable-busyinfo use wxBusyInfo], wxUSE_BUSYINFO)
|
||||
WX_ARG_ENABLE(plot, [ --enable-plot use wxPlot], wxUSE_PLOT)
|
||||
WX_ARG_ENABLE(joystick, [ --enable-joystick compile in joystick support (Linux only)], wxUSE_JOYSTICK)
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl support for image formats that do not rely on external library
|
||||
@@ -1389,7 +1398,7 @@ if test ! -d sub ; then
|
||||
mkdir sub
|
||||
fi
|
||||
echo dummy > sub/file
|
||||
${MAKE-make} -f confMake VPATH=sub 2> config.log > /dev/null
|
||||
${MAKE-make} -f confMake VPATH=sub 2>&5 > /dev/null
|
||||
RESULT=$?
|
||||
rm -f sub/file check final_file confMake
|
||||
rmdir sub
|
||||
@@ -1531,7 +1540,8 @@ GUI_TK_LIBRARY=
|
||||
GUI_TK_LINK=
|
||||
|
||||
WXGTK12=
|
||||
WXGTK13=
|
||||
WXGTK127=
|
||||
WXGTK20=
|
||||
|
||||
WXWINE=
|
||||
|
||||
@@ -1556,11 +1566,11 @@ if test "$wxUSE_CYGWIN" = 1 || test "$wxUSE_MINGW" = 1 ; then
|
||||
dnl --- This will bloat the executable, but it'll work for now...
|
||||
LIBS="$LIBS -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -lcrtdll -ladvapi32 -lwsock32"
|
||||
|
||||
dnl add extra odbc libs if we have compiled in odbc
|
||||
if test "$wxUSE_ODBC" = "yes" ; then
|
||||
LIBS="$LIBS -lodbc32 -lole32 -loleaut32"
|
||||
fi
|
||||
|
||||
dnl add extra odbc libs if we have compiled in odbc
|
||||
if test "$wxUSE_ODBC" = "yes" ; then
|
||||
LIBS="$LIBS -lodbc32 -lole32 -loleaut32"
|
||||
fi
|
||||
|
||||
dnl -mwindows is needed to avoid that spawning of a console window
|
||||
if test "$wxUSE_MINGW" = 1; then
|
||||
LDFLAGS="$LDFLAGS -mwindows"
|
||||
@@ -1591,9 +1601,12 @@ fi
|
||||
if test "$wxUSE_GTK" = 1; then
|
||||
dnl avoid calling AM_PATH_GTK twice, so check first for the newer version
|
||||
dnl and only then, if it wasn't found, for an older one
|
||||
AM_PATH_GTK(1.2.3, WXGTK12=1)
|
||||
AM_PATH_GTK_2_0(1.3.1, WXGTK20=1,[
|
||||
AM_PATH_GTK(1.2.7, WXGTK127=1)
|
||||
AM_PATH_GTK(1.2.3, WXGTK12=1)
|
||||
], gthread)
|
||||
|
||||
if test "$WXGTK12" != 1; then
|
||||
if test "$WXGTK12" != 1 -a "$WXGTK20" != 1; then
|
||||
AC_MSG_ERROR([
|
||||
Please check that gtk-config is in path, the directory
|
||||
where GTK+ libraries are installed (returned by
|
||||
@@ -1602,15 +1615,6 @@ if test "$wxUSE_GTK" = 1; then
|
||||
])
|
||||
fi
|
||||
|
||||
dnl it doesn't really work with 1.3.0 now...
|
||||
dnl AM_PATH_GTK(1.3.0,
|
||||
dnl WXGTK13=1,
|
||||
dnl AM_PATH_GTK(1.2.1,
|
||||
dnl WXGTK12=1,
|
||||
dnl AC_MSG_ERROR(Is gtk-config in path and GTK+ is version 1.2.1 or above?)
|
||||
dnl )
|
||||
dnl )
|
||||
|
||||
TOOLKIT_INCLUDE="$GTK_CFLAGS"
|
||||
|
||||
dnl Appending gthreads as it was done here is not portable, instead
|
||||
@@ -1697,13 +1701,18 @@ if test "$wxUSE_WINE" = 1; then
|
||||
GUIDIST=MSW_DIST
|
||||
fi
|
||||
|
||||
if test "$wxUSE_MOTIF" = 1; then
|
||||
dnl use standard macros to check for X headers/libs, this brings support
|
||||
dnl for the standard configure options --x-includes and --x-libraries
|
||||
AC_PATH_XTRA
|
||||
dnl use standard macros to check for X headers/libs, this brings support
|
||||
dnl for the standard configure options --x-includes and --x-libraries;
|
||||
dnl the path to the X headers/libs is not only needed for motif, but also
|
||||
dnl by the OpenGL and XKBlib.h checks further down
|
||||
|
||||
AC_PATH_XTRA
|
||||
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
|
||||
LDFLAGS="$LDFLAGS $X_LIBS"
|
||||
|
||||
if test "$wxUSE_MOTIF" = 1; then
|
||||
if test "$no_x" = "yes"; then
|
||||
AC_MSG_ERROR(X11 not found, please use --x-includes and/or --x-libraries options)
|
||||
AC_MSG_ERROR(X11 not found, please use --x-includes and/or --x-libraries options)
|
||||
fi
|
||||
|
||||
GUI_TK_LIBRARY="$X_LIBS"
|
||||
@@ -1850,8 +1859,8 @@ if test "$wxUSE_MOTIF" = 1; then
|
||||
version = XpmLibraryVersion();
|
||||
],
|
||||
[
|
||||
XPM_LINK="-lXpm "
|
||||
AC_DEFINE(wxHAVE_LIB_XPM)
|
||||
XPM_LINK="-lXpm "
|
||||
AC_DEFINE(wxHAVE_LIB_XPM)
|
||||
AC_MSG_RESULT(found in default search path)
|
||||
COMPILED_X_PROGRAM=0
|
||||
],
|
||||
@@ -1900,11 +1909,18 @@ else
|
||||
TOOLKIT_DIR="os2"
|
||||
fi
|
||||
|
||||
dnl the (base) name of the library and support files for this toolkit
|
||||
if test "$wxUSE_DEBUG_FLAG" = "yes"; then
|
||||
TOOLKIT_NAME="${TOOLKIT_DIR}d"
|
||||
else
|
||||
TOOLKIT_NAME="${TOOLKIT_DIR}"
|
||||
fi
|
||||
|
||||
dnl the symbol which allows conditional compilation for the given toolkit
|
||||
TOOLKIT_DEF="-D__WX${TOOLKIT}__"
|
||||
|
||||
dnl the name of the (libtool) library
|
||||
WX_LIBRARY="wx_${TOOLKIT_DIR}"
|
||||
WX_LIBRARY="wx_${TOOLKIT_NAME}"
|
||||
|
||||
dnl the sources, their dependenices and the headers
|
||||
ALL_OBJECTS="\$(GUIOBJS) \$(COMMONOBJS) \$(GENERICOBJS) \$(UNIXOBJS) \$(HTMLOBJS) \$(OGLOBJS)"
|
||||
@@ -1940,7 +1956,16 @@ fi
|
||||
else
|
||||
USE_GUI=0
|
||||
|
||||
dnl this may be (almost) unneccesary for wxBase now we use TOOLKIT_NAME
|
||||
TOOLKIT_DIR="base"
|
||||
|
||||
dnl the base name of the library and wxXXX-config files
|
||||
if test "$wxUSE_DEBUG_FLAG" = "yes"; then
|
||||
TOOLKIT_NAME="${TOOLKIT_DIR}d"
|
||||
else
|
||||
TOOLKIT_NAME="${TOOLKIT_DIR}"
|
||||
fi
|
||||
|
||||
TOOLKIT_DEF="-D__WXBASE__"
|
||||
|
||||
dnl the sources, their dependenices and the headers
|
||||
@@ -1952,7 +1977,7 @@ else
|
||||
fi
|
||||
|
||||
dnl building wxBase only
|
||||
WX_LIBRARY="wxbase"
|
||||
WX_LIBRARY="wx_${TOOLKIT_NAME}"
|
||||
|
||||
PORT_FILES="src/files.lst"
|
||||
RPM_FILES="src/rpmfiles.lst"
|
||||
@@ -1989,6 +2014,7 @@ PIC_FLAG=
|
||||
WX_ALL=
|
||||
WX_ALL_INSTALLED=
|
||||
BURNT_LIBRARY_NAME=
|
||||
WX_TARGET_LIBRARY_SONAME=
|
||||
|
||||
dnl --- the marker for quick search, leave it here: SHARED_LIB_SETUP ---
|
||||
|
||||
@@ -1999,12 +2025,16 @@ if test "$wxUSE_SHARED" = "yes"; then
|
||||
SHARED_LD="${CC} -shared -fPIC -o"
|
||||
PIC_FLAG="-fPIC"
|
||||
else
|
||||
dnl no idea why it wants it, but it does
|
||||
LDFLAGS="-L/usr/lib"
|
||||
|
||||
SHARED_LD="${CXX} -b -o"
|
||||
PIC_FLAG="+Z"
|
||||
fi
|
||||
WX_LIBRARY_NAME_SHARED="libwx_${TOOLKIT_DIR}.sl"
|
||||
WX_LIBRARY_NAME_SHARED_GL="libwx_${TOOLKIT_DIR}_gl.sl"
|
||||
WX_LIBRARY_NAME_SHARED="libwx_${TOOLKIT_NAME}.sl"
|
||||
WX_LIBRARY_NAME_SHARED_GL="libwx_${TOOLKIT_NAME}_gl.sl"
|
||||
if test "$wxUSE_OPENGL" = "yes"; then
|
||||
WX_ALL_INSTALLED="preinstall_gl"
|
||||
WX_ALL="${WX_LIBRARY_NAME_SHARED} ${WX_LIBRARY_NAME_SHARED_GL}"
|
||||
else
|
||||
WX_ALL="${WX_LIBRARY_NAME_SHARED}"
|
||||
@@ -2018,6 +2048,8 @@ if test "$wxUSE_SHARED" = "yes"; then
|
||||
if test "$wxUSE_BURNT_NAME" = "yes" ; then
|
||||
BURNT_LIBRARY_NAME="-Wl,-soname,${WX_LIBRARY_LINK1}"
|
||||
BURNT_LIBRARY_NAME_GL="-Wl,-soname,${WX_LIBRARY_LINK1_GL}"
|
||||
dnl substitute this in makelib.env for the contrib libs
|
||||
WX_TARGET_LIBRARY_SONAME="-Wl,-soname,\$(TARGETLIB_LINK1)"
|
||||
fi
|
||||
if test "$wxUSE_OPENGL" = "yes"; then
|
||||
WX_ALL_INSTALLED="CREATE_INSTALLED_LINKS CREATE_INSTALLED_LINKS_GL"
|
||||
@@ -2046,6 +2078,10 @@ if test "$wxUSE_SHARED" = "yes"; then
|
||||
if test "$GCC" = yes ; then
|
||||
SHARED_LD="${CC} -shared -o"
|
||||
PIC_FLAG="-fPIC"
|
||||
|
||||
dnl newer versions of gcc need -isystem to compile X headers on
|
||||
dnl Solaris (which use old style C syntax)
|
||||
CPPFLAGS="$CPPFLAGS -isystem /usr/openwin/include"
|
||||
else
|
||||
SHARED_LD="${CXX} -G -o"
|
||||
PIC_FLAG="-KPIC"
|
||||
@@ -2067,8 +2103,13 @@ if test "$wxUSE_SHARED" = "yes"; then
|
||||
*-*-freebsd* | *-*-netbsd*)
|
||||
SHARED_LD="${CC} -shared -o"
|
||||
PIC_FLAG="-fPIC"
|
||||
WX_ALL_INSTALLED="CREATE_INSTALLED_LINKS"
|
||||
WX_ALL="CREATE_LINKS"
|
||||
if test "$wxUSE_OPENGL" = "yes"; then
|
||||
WX_ALL_INSTALLED="CREATE_INSTALLED_LINKS CREATE_INSTALLED_LINKS_GL"
|
||||
WX_ALL="CREATE_LINKS CREATE_LINKS_GL"
|
||||
else
|
||||
WX_ALL_INSTALLED="CREATE_INSTALLED_LINKS"
|
||||
WX_ALL="CREATE_LINKS"
|
||||
fi
|
||||
;;
|
||||
*-*-osf* )
|
||||
SHARED_LD="${CXX} -shared -o"
|
||||
@@ -2096,13 +2137,23 @@ if test "$wxUSE_SHARED" = "yes"; then
|
||||
dnl only static for now
|
||||
WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_STATIC}"
|
||||
WX_TARGET_LIBRARY_GL="${WX_LIBRARY_NAME_STATIC_GL}"
|
||||
WX_ALL="${WX_LIBRARY_NAME_STATIC}"
|
||||
if test "$wxUSE_OPENGL" = "yes"; then
|
||||
WX_ALL_INSTALLED="preinstall_gl"
|
||||
WX_ALL="${WX_LIBRARY_NAME_STATIC} ${WX_LIBRARY_NAME_STATIC_GL}"
|
||||
else
|
||||
WX_ALL="${WX_LIBRARY_NAME_STATIC}"
|
||||
fi
|
||||
;;
|
||||
*-*-mingw32* )
|
||||
dnl only static for now
|
||||
WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_STATIC}"
|
||||
WX_TARGET_LIBRARY_GL="${WX_LIBRARY_NAME_STATIC_GL}"
|
||||
WX_ALL="${WX_LIBRARY_NAME_STATIC}"
|
||||
if test "$wxUSE_OPENGL" = "yes"; then
|
||||
WX_ALL_INSTALLED="preinstall_gl"
|
||||
WX_ALL="${WX_LIBRARY_NAME_STATIC} ${WX_LIBRARY_NAME_STATIC_GL}"
|
||||
else
|
||||
WX_ALL="${WX_LIBRARY_NAME_STATIC}"
|
||||
fi
|
||||
;;
|
||||
*-pc-os2_emx )
|
||||
dnl only static for now
|
||||
@@ -2132,7 +2183,20 @@ else
|
||||
dnl set target to static
|
||||
WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_STATIC}"
|
||||
WX_TARGET_LIBRARY_GL="${WX_LIBRARY_NAME_STATIC_GL}"
|
||||
WX_ALL="${WX_LIBRARY_NAME_STATIC}"
|
||||
|
||||
if test "$wxUSE_OPENGL" = "yes"; then
|
||||
WX_ALL_INSTALLED="preinstall_gl"
|
||||
WX_ALL="${WX_LIBRARY_NAME_STATIC} ${WX_LIBRARY_NAME_STATIC_GL}"
|
||||
else
|
||||
WX_ALL="${WX_LIBRARY_NAME_STATIC}"
|
||||
fi
|
||||
|
||||
dnl give static wxBase build a working install target
|
||||
if test "$wxUSE_GUI" = "no"; then
|
||||
dnl we're here because WX_ALL_INSTALLED is empty, but play safe anyway
|
||||
WX_ALL_INSTALLED="${WX_ALL_INSTALLED} preinstall"
|
||||
fi
|
||||
|
||||
WX_TARGET_LIBRARY_TYPE="a"
|
||||
fi
|
||||
|
||||
@@ -2150,6 +2214,10 @@ dnl defines HAVE_WCSTR_H
|
||||
AC_CHECK_HEADERS(wcstr.h)
|
||||
dnl defines HAVE_FNMATCH_H
|
||||
AC_CHECK_HEADERS(fnmatch.h)
|
||||
dnl defines HAVE_ICONV_H (Unix98 encoding conversion routines)
|
||||
AC_CHECK_HEADERS(iconv.h)
|
||||
dnl defines HAVE_LANGINFO_H (GNU libc locale parameters)
|
||||
AC_CHECK_HEADERS(langinfo.h)
|
||||
|
||||
if test "$wxUSE_GUI" = "yes"; then
|
||||
if test "$wxUSE_UNIX" = "yes"; then
|
||||
@@ -2213,6 +2281,7 @@ dnl check the sizes of integral types (give some reasonable default values for
|
||||
dnl cross-compiling)
|
||||
dnl defines the size of certain types of variables in SIZEOF_<TYPE>
|
||||
AC_CHECK_SIZEOF(char, 1)
|
||||
AC_CHECK_SIZEOF(wchar_t, 4)
|
||||
AC_CHECK_SIZEOF(short, 2)
|
||||
AC_CHECK_SIZEOF(int *, 4)
|
||||
AC_CHECK_SIZEOF(int, 4)
|
||||
@@ -2249,53 +2318,81 @@ AC_CHECK_LIB(c, wcslen, [
|
||||
dnl check for vprintf/vsprintf() which are GNU extensions
|
||||
AC_FUNC_VPRINTF
|
||||
|
||||
dnl check for vsnprintf() - a safe version of vsprintf()
|
||||
AC_CHECK_FUNCS(vsnprintf,
|
||||
AC_DEFINE(HAVE_VSNPRINTF),
|
||||
AC_MSG_WARN(unsafe function sprintf will be used instead of snprintf)
|
||||
)
|
||||
|
||||
dnl check for vsscanf() - on some platforms (Linux, glibc 2.1.1) it's
|
||||
dnl available in the library but the prototype is missing, so we can't use
|
||||
dnl AC_CHECK_FUNCS here, do it manually
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
|
||||
dnl check for vsscanf() and vsnprintf() - on some platforms (Linux, glibc
|
||||
dnl 2.1.1 for the first one, HP-UX for the second) it's available in the
|
||||
dnl library but the prototype is missing, so we can't use AC_CHECK_FUNCS here,
|
||||
dnl do it manually
|
||||
|
||||
dnl we use AC_TRY_COMPILE() here instead of AC_TRY_RUN() to make the checks
|
||||
dnl work for cross-compilation, but AC_TRY_COMPILE() normally only compiles
|
||||
dnl one function while we need at least 2 - hence the ugly hack below. To
|
||||
dnl understand why it works, remember that AC_TRY_COMPILE() just prepends
|
||||
dnl "int main() {" in the beginning of the code and "; return 0; }" at the
|
||||
dnl end...
|
||||
|
||||
dnl check for vsnprintf() - a safe version of vsprintf()
|
||||
AC_CACHE_CHECK([for vsnprintf], wx_cv_func_vsnprintf,
|
||||
[
|
||||
AC_TRY_COMPILE([
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
], [
|
||||
int wx_test_vsnprintf(const char *, ...);
|
||||
|
||||
wx_test_vsnprintf("%s");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wx_test_vsnprintf(const char *fmt, ...)
|
||||
{
|
||||
char *s;
|
||||
|
||||
va_list argp;
|
||||
va_start(argp, fmt);
|
||||
vsnprintf(s, 42, fmt, argp);
|
||||
va_end(argp);
|
||||
], [
|
||||
AC_DEFINE(HAVE_VSNPRINTF)
|
||||
wx_cv_func_vsnprintf=yes
|
||||
], [
|
||||
AC_MSG_WARN(unsafe function sprintf will be used instead of snprintf)
|
||||
wx_cv_func_vsnprintf=no
|
||||
])
|
||||
])
|
||||
|
||||
dnl check for vsscanf()
|
||||
AC_CACHE_CHECK([for vsscanf], wx_cv_func_vsscanf,
|
||||
[
|
||||
AC_TRY_RUN(
|
||||
[
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
AC_TRY_COMPILE([
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
], [
|
||||
int wx_test_vsscanf(const char *, ...);
|
||||
|
||||
int try_vsscanf(const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
|
||||
vsscanf("17", format, ap);
|
||||
|
||||
va_end(ap);
|
||||
wx_test_vsscanf("%d");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main()
|
||||
int wx_test_vsscanf(const char *fmt, ...)
|
||||
{
|
||||
int i;
|
||||
try_vsscanf("%d", &i);
|
||||
return i == 17 ? 0 : 1;
|
||||
}
|
||||
], [
|
||||
AC_DEFINE(HAVE_VSSCANF)
|
||||
wx_cv_func_vsscanf=yes
|
||||
],
|
||||
wx_cv_func_vsscanf=no,
|
||||
wx_cv_func_vsscanf=no
|
||||
)
|
||||
va_list argp;
|
||||
va_start(argp, fmt);
|
||||
vsscanf("42", fmt, argp);
|
||||
va_end(argp);
|
||||
], [
|
||||
AC_DEFINE(HAVE_VSSCANF)
|
||||
wx_cv_func_vsscanf=yes
|
||||
], [
|
||||
wx_cv_func_vsscanf=no
|
||||
])
|
||||
])
|
||||
|
||||
AC_LANG_RESTORE
|
||||
|
||||
dnl under MSW we always have Sleep()
|
||||
dnl the following tests are for Unix(like) systems only
|
||||
if test "$TOOLKIT" != "MSW"; then
|
||||
|
||||
dnl check for POSIX signals if we need them
|
||||
@@ -2306,6 +2403,30 @@ if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes" -a "$wxUSE_UNIX" = "yes"; then
|
||||
AC_MSG_WARN([No POSIX signal functions on this system, wxApp::OnFatalException will not be called])
|
||||
wxUSE_ON_FATAL_EXCEPTION=no
|
||||
fi
|
||||
|
||||
if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
|
||||
AC_CACHE_CHECK([for sa_handler type], wx_cv_type_sa_handler,
|
||||
[
|
||||
AC_TRY_COMPILE([#include <signal.h>],
|
||||
[
|
||||
extern void testSigHandler(int);
|
||||
|
||||
struct sigaction sa;
|
||||
sa.sa_handler = testSigHandler;
|
||||
], [
|
||||
wx_cv_type_sa_handler=int
|
||||
], [
|
||||
wx_cv_type_sa_handler=void
|
||||
])
|
||||
])
|
||||
|
||||
AC_LANG_RESTORE
|
||||
|
||||
AC_DEFINE_UNQUOTED(wxTYPE_SA_HANDLER, $wx_cv_type_sa_handler)
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl check for vfork() (even if it's the same as fork() in modern Unices)
|
||||
@@ -2419,12 +2540,19 @@ fi
|
||||
if test "$wxUSE_THREADS" = "yes" ; then
|
||||
dnl find if POSIX threads are available
|
||||
|
||||
dnl AIX calls the library libpthreads - thanks IBM!
|
||||
if test "$wxUSE_AIX" = 1; then
|
||||
THREADS_LIB=pthreads
|
||||
else
|
||||
THREADS_LIB=pthread
|
||||
fi
|
||||
|
||||
dnl standard lib name is pthread
|
||||
dnl We no longer test for pthread-0.7 as it breaks compilation on some
|
||||
dnl glibc2 systems, especially for static linkage.
|
||||
AC_CHECK_LIB(pthread, pthread_create, [
|
||||
AC_CHECK_LIB($THREADS_LIB, pthread_create, [
|
||||
THREADS_OBJ="threadpsx.lo"
|
||||
THREADS_LINK="pthread"
|
||||
THREADS_LINK=$THREADS_LIB
|
||||
], [
|
||||
dnl thread functions are in libc_r under FreeBSD
|
||||
AC_CHECK_LIB(c_r, pthread_create, [
|
||||
@@ -2473,21 +2601,33 @@ if test "$wxUSE_THREADS" = "yes" ; then
|
||||
)]
|
||||
)
|
||||
|
||||
dnl VZ: we should be checking for all of the following functions instead:
|
||||
dnl to be able to set the thread priority, we need to have all of the
|
||||
dnl following functions:
|
||||
dnl 1. pthread_attr_getschedpolicy
|
||||
dnl 2. sched_get_priority_min and sched_get_priority_max
|
||||
dnl (this one can be in either libpthread or libposix4 (under Solaris))
|
||||
dnl 3. pthread_attr_getschedparam and pthread_attr_setschedparam
|
||||
dnl but it seems that if the first one is there, the other ones are too (of
|
||||
dnl course the proper solution would be to implement AC_FUNC_THREAD above
|
||||
dnl and do test for them all - anyone?)
|
||||
HAVE_PRIOR_FUNCS=0
|
||||
AC_CHECK_LIB($THREADS_LINK, pthread_attr_getschedpolicy,
|
||||
AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS),
|
||||
[AC_CHECK_LIB("posix4", pthread_attr_getschedpolicy,
|
||||
[AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS) POSIX4_LINK="-lposix4"],
|
||||
AC_MSG_WARN(Setting thread priority will not work)
|
||||
)]
|
||||
AC_CHECK_LIB($THREADS_LINK, pthread_attr_setschedparam,
|
||||
AC_CHECK_LIB($THREADS_LINK, sched_get_priority_max,
|
||||
HAVE_PRIOR_FUNCS=1,
|
||||
AC_CHECK_LIB("posix4", sched_get_priority_max,
|
||||
[
|
||||
HAVE_PRIOR_FUNCS=1
|
||||
POSIX4_LINK="-lposix4"
|
||||
],
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
if test "$HAVE_PRIOR_FUNCS" = 1; then
|
||||
AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS)
|
||||
else
|
||||
AC_MSG_WARN(Setting thread priority will not work)
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB($THREADS_LINK, pthread_cancel,
|
||||
AC_DEFINE(HAVE_PTHREAD_CANCEL),
|
||||
AC_MSG_WARN([wxThread::Kill() will not work properly]))
|
||||
@@ -2535,8 +2675,8 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$WXGTK13" = 1 ; then
|
||||
AC_DEFINE_UNQUOTED(__WXGTK13__,$WXGTK13)
|
||||
if test "$WXGTK20" = 1 ; then
|
||||
AC_DEFINE_UNQUOTED(__WXGTK20__,$WXGTK20)
|
||||
WXGTK12=1
|
||||
fi
|
||||
|
||||
@@ -2544,6 +2684,10 @@ if test "$WXGTK12" = 1 ; then
|
||||
AC_DEFINE_UNQUOTED(__WXGTK12__,$WXGTK12)
|
||||
fi
|
||||
|
||||
if test "$WXGTK127" = 1 ; then
|
||||
AC_DEFINE_UNQUOTED(__WXGTK127__,$WXGTK127)
|
||||
fi
|
||||
|
||||
if test "$WXWINE" = 1 ; then
|
||||
TOOLKIT_DEF="${TOOLKIT_DEF} -D__WXWINE__"
|
||||
fi
|
||||
@@ -2706,10 +2850,10 @@ if test "$wxUSE_OPENGL" = "yes"; then
|
||||
AC_DEFINE(wxUSE_OPENGL)
|
||||
AC_DEFINE(wxUSE_GLCANVAS)
|
||||
AC_CHECK_LIB(GL, glFlush, [
|
||||
OPENGL_LINK="-lGL"
|
||||
OPENGL_LINK="-lGL -lGLU"
|
||||
],[
|
||||
AC_CHECK_LIB(MesaGL, glFlush, [
|
||||
OPENGL_LINK="-lMesaGL"
|
||||
OPENGL_LINK="-lMesaGL -lMesaGLU"
|
||||
],)
|
||||
],)
|
||||
],wxUSE_OPENGL=0)
|
||||
@@ -2812,6 +2956,7 @@ if test "$wxUSE_INTL" = "yes" ; then
|
||||
else
|
||||
AC_DEFINE(wxUSE_INTL)
|
||||
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS internat"
|
||||
GUIDIST="$GUIDIST INTL_DIST"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -3109,10 +3254,24 @@ if test "$wxUSE_DYNLIB_CLASS" = "yes"; then
|
||||
[
|
||||
AC_DEFINE(HAVE_SHL_LOAD)
|
||||
HAVE_SHL_FUNCS=1
|
||||
],
|
||||
[
|
||||
AC_CHECK_LIB(shl_load, dld,
|
||||
[
|
||||
HAVE_SHL_FUNCS=1
|
||||
LIBS="$LIBS -ldld"
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
dnl check also for dlerror()
|
||||
if test "$HAVE_DL_FUNCS" = 1; then
|
||||
AC_CHECK_FUNCS(dlerror,
|
||||
AC_DEFINE(HAVE_DLERROR),
|
||||
AC_CHECK_LIB(dl, dlerror, AC_DEFINE(HAVE_DLERROR)))
|
||||
fi
|
||||
|
||||
if test "$HAVE_DL_FUNCS" = 0; then
|
||||
if test "$HAVE_SHL_FUNCS" = 0; then
|
||||
if test "$USE_UNIX" = 1; then
|
||||
@@ -3554,15 +3713,16 @@ dnl ---------------------------------------------------------------------------
|
||||
dnl Output the makefiles and such from the results found above
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
GUILIBS="$GUI_TK_LIBRARY $OPENGL_LINK $TOOLKIT_LINK"
|
||||
GUILIBS="$GUI_TK_LIBRARY $TOOLKIT_LINK"
|
||||
OPENGL_LIBS="$OPENGL_LINK"
|
||||
|
||||
dnl all additional libraries (except wxWindows itself) we link with
|
||||
dnl
|
||||
dnl note that we always link with -lm - extended.c uses floor() and is always
|
||||
dnl linked in
|
||||
EXTRA_LIBS="-lm $LIBS $ZLIB_LINK $POSIX4_LINK $INET_LINK $WCHAR_LINK $THREADS_LINK $DMALLOC_LINK $DL_LINK"
|
||||
EXTRA_LIBS="$LIBS $POSIX4_LINK $INET_LINK $WCHAR_LINK $THREADS_LINK $DMALLOC_LINK $DL_LINK $ZLIB_LINK -lm"
|
||||
if test "$wxUSE_GUI" = "yes"; then
|
||||
EXTRA_LIBS="$EXTRA_LIBS $GUILIBS $PNG_LINK $JPEG_LINK $TIFF_LINK"
|
||||
EXTRA_LIBS="$GUILIBS $PNG_LINK $JPEG_LINK $TIFF_LINK $EXTRA_LIBS"
|
||||
fi
|
||||
|
||||
dnl all the libraries needed to link wxWindows programs when using the
|
||||
@@ -3572,6 +3732,13 @@ LD_LIBS="\${top_builddir}/lib/${WX_LIBRARY_NAME_STATIC} $EXTRA_LIBS"
|
||||
dnl all -I options we must pass to the compiler
|
||||
INCLUDES="-I. -I\${top_builddir}/include -I\${top_srcdir}/include $ZLIB_INCLUDE $PNG_INCLUDE $JPEG_INCLUDE $TIFF_INCLUDE $TOOLKIT_INCLUDE"
|
||||
|
||||
dnl wxGTK does not need TOOLKIT includes in wx-config
|
||||
if test "$wxUSE_GTK" = 1; then
|
||||
WXCONFIG_INCLUDE=""
|
||||
else
|
||||
WXCONFIG_INCLUDE="$TOOLKIT_INCLUDE"
|
||||
fi
|
||||
|
||||
dnl C/C++ compiler options used to compile wxWindows
|
||||
if test "$GXX" = yes ; then
|
||||
dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror"
|
||||
@@ -3581,7 +3748,7 @@ if test "$GXX" = yes ; then
|
||||
fi
|
||||
EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE $INCLUDES"
|
||||
|
||||
CFLAGS=`echo $CFLAGS $EXTRA_CFLAGS | sed 's/ \\+/ /g'`
|
||||
CFLAGS=`echo $CFLAGS $EXTRA_CFLAGS $CXXWARNINGS | sed 's/ \\+/ /g'`
|
||||
CXXFLAGS=`echo $CXXFLAGS $EXTRA_CFLAGS $CXXWARNINGS | sed 's/ \+/ /g'`
|
||||
|
||||
LDFLAGS="$LDFLAGS $PROFILE"
|
||||
@@ -3649,6 +3816,7 @@ AC_SUBST(DEP_INFO_FLAGS)
|
||||
AC_SUBST(CODE_GEN_FLAGS)
|
||||
AC_SUBST(BURNT_LIBRARY_NAME)
|
||||
AC_SUBST(BURNT_LIBRARY_NAME_GL)
|
||||
AC_SUBST(WX_TARGET_LIBRARY_SONAME)
|
||||
AC_SUBST(WX_TARGET_LIBRARY_TYPE)
|
||||
|
||||
dnl debugging options
|
||||
@@ -3660,7 +3828,9 @@ AC_SUBST(AFMINSTALL)
|
||||
AC_SUBST(TOOLKIT)
|
||||
AC_SUBST(TOOLKIT_DEF)
|
||||
AC_SUBST(TOOLKIT_DIR)
|
||||
AC_SUBST(TOOLKIT_NAME)
|
||||
AC_SUBST(TOOLKIT_INCLUDE)
|
||||
AC_SUBST(WXCONFIG_INCLUDE)
|
||||
|
||||
dnl what to compile
|
||||
AC_SUBST(GUIHEADERS)
|
||||
@@ -3694,6 +3864,7 @@ AC_SUBST(USER_SUBDIRS)
|
||||
dnl additional libraries and linker settings
|
||||
AC_SUBST(LDFLAGS)
|
||||
AC_SUBST(EXTRA_LIBS)
|
||||
AC_SUBST(OPENGL_LIBS)
|
||||
AC_SUBST(EXTRADEFS)
|
||||
AC_SUBST(LIBS)
|
||||
AC_SUBST(LD_LIBS)
|
||||
@@ -3756,11 +3927,11 @@ AC_OUTPUT([
|
||||
],
|
||||
[
|
||||
chmod +x wx-config
|
||||
mv wx-config wx${TOOLKIT_DIR}-config
|
||||
${LN_S} wx${TOOLKIT_DIR}-config wx-config
|
||||
mv wx-config wx${TOOLKIT_NAME}-config
|
||||
${LN_S} wx${TOOLKIT_NAME}-config wx-config
|
||||
|
||||
dnl the debian installer wants setup.h to be in the lib subdir
|
||||
dnl so we *copy* it there
|
||||
dnl the debian build process wants setup.h in the lib subdir so we
|
||||
dnl can pretend wxWin is already installed, so we *copy* it there
|
||||
|
||||
if test ! -d lib; then
|
||||
mkdir lib
|
||||
@@ -3774,11 +3945,11 @@ AC_OUTPUT([
|
||||
if test ! -d lib/wx/include/wx; then
|
||||
mkdir lib/wx/include/wx
|
||||
fi
|
||||
if test ! -d lib/wx/include/wx/${TOOLKIT_DIR}; then
|
||||
mkdir lib/wx/include/wx/${TOOLKIT_DIR}
|
||||
if test ! -d lib/wx/include/wx/${TOOLKIT_NAME}; then
|
||||
mkdir lib/wx/include/wx/${TOOLKIT_NAME}
|
||||
fi
|
||||
if test -f setup.h; then
|
||||
cp -f setup.h lib/wx/include/wx/${TOOLKIT_DIR}/setup.h
|
||||
cp -f setup.h lib/wx/include/wx/${TOOLKIT_NAME}/setup.h
|
||||
fi
|
||||
|
||||
dnl *move* setup.h to its final place
|
||||
@@ -3799,6 +3970,7 @@ AC_OUTPUT([
|
||||
],
|
||||
[
|
||||
TOOLKIT_DIR="${TOOLKIT_DIR}"
|
||||
TOOLKIT_NAME="${TOOLKIT_NAME}"
|
||||
LN_S="${LN_S}"
|
||||
]
|
||||
)
|
||||
|
@@ -8,6 +8,8 @@ all:
|
||||
clean:
|
||||
cd src; make clean
|
||||
cd samples; make clean
|
||||
cd utils; make clean
|
||||
|
||||
|
||||
samples:
|
||||
cd samples; make
|
||||
|
14
contrib/configure
vendored
@@ -817,9 +817,16 @@ trap 'rm -fr `echo "
|
||||
src/ogl/Makefile
|
||||
src/mmedia/Makefile
|
||||
src/stc/Makefile
|
||||
src/xml/Makefile
|
||||
samples/Makefile
|
||||
samples/mmedia/Makefile
|
||||
samples/ogl/Makefile
|
||||
samples/ogl/ogledit/Makefile
|
||||
samples/ogl/studio/Makefile
|
||||
samples/stc/Makefile
|
||||
utils/Makefile
|
||||
utils/wxrc/Makefile
|
||||
utils/wxrcedit/Makefile
|
||||
" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
|
||||
EOF
|
||||
cat >> $CONFIG_STATUS <<EOF
|
||||
@@ -903,9 +910,16 @@ CONFIG_FILES=\${CONFIG_FILES-"Makefile
|
||||
src/ogl/Makefile
|
||||
src/mmedia/Makefile
|
||||
src/stc/Makefile
|
||||
src/xml/Makefile
|
||||
samples/Makefile
|
||||
samples/mmedia/Makefile
|
||||
samples/ogl/Makefile
|
||||
samples/ogl/ogledit/Makefile
|
||||
samples/ogl/studio/Makefile
|
||||
samples/stc/Makefile
|
||||
utils/Makefile
|
||||
utils/wxrc/Makefile
|
||||
utils/wxrcedit/Makefile
|
||||
"}
|
||||
EOF
|
||||
cat >> $CONFIG_STATUS <<\EOF
|
||||
|
@@ -42,7 +42,14 @@ AC_OUTPUT([
|
||||
src/ogl/Makefile
|
||||
src/mmedia/Makefile
|
||||
src/stc/Makefile
|
||||
src/xml/Makefile
|
||||
samples/Makefile
|
||||
samples/mmedia/Makefile
|
||||
samples/ogl/Makefile
|
||||
samples/ogl/ogledit/Makefile
|
||||
samples/ogl/studio/Makefile
|
||||
samples/stc/Makefile
|
||||
utils/Makefile
|
||||
utils/wxrc/Makefile
|
||||
utils/wxrcedit/Makefile
|
||||
])
|
||||
|
@@ -214,15 +214,30 @@ been set. In all other cases, you must return FALSE.
|
||||
\membersection{wxSoundFileStream::RepositionStream}\label{wxsoundfilestreamrepositionstream}
|
||||
\func{bool}{RepositionStream}{\param{wxUint32 }{position}}
|
||||
|
||||
This is called by wxSoundFileStream::SetPosition to seek the input stream
|
||||
to the right position. This must be overidden by the file codec class.
|
||||
The position is relative to the beginning of the samples.
|
||||
If it is impossible (as for a piped input stream), you must return FALSE.
|
||||
|
||||
\membersection{wxSoundFileStream::FinishPreparation}\label{wxsoundfilestreamfinishpreparation}
|
||||
\func{void}{FinishPreparation}{\param{wxUint32 }{len}}
|
||||
|
||||
This is an internal function but it must called by the file codec class when
|
||||
the "playing" preparation is finished and you know the size of the stream.
|
||||
If it is an {\it infinite} stream, you should set this to wxSOUND\_INFINITE\_TIME.
|
||||
|
||||
\membersection{wxSoundFileStream::GetData}\label{wxsoundfilestreamgetdata}
|
||||
\func{wxUint32}{GetData}{\param{void* }{buffer}, \param{wxUint32 }{len}}
|
||||
|
||||
This is called by wxSoundFileStream when it needs to get new sound data to
|
||||
send to the device driver (or to a conversion codec). This must be eventually
|
||||
overidden by the file codec class. The default behaviour is simply to read from
|
||||
the input stream.
|
||||
|
||||
\membersection{wxSoundFileStream::PutData}\label{wxsoundfilestreamputdata}
|
||||
\func{wxUint32}{PutData}{\param{const void* }{buffer}, \param{wxUint32 }{len}}
|
||||
|
||||
This is called by wxSoundFileStream when it needs to put new sound data received
|
||||
from the device driver (or from a conversion codec). This must be eventually
|
||||
overidden by the file codec class. The default behaviour is simply to write to
|
||||
the input stream.
|
||||
|
@@ -6,8 +6,8 @@
|
||||
|
||||
\section{\class{wxSoundRouterStream}}\label{wxsoundrouterstream}
|
||||
|
||||
|
||||
Codec router class
|
||||
This is the router "codec" class. It should do codec routing when the device
|
||||
driver does not deal with a format.
|
||||
|
||||
\wxheading{Derived from}
|
||||
|
||||
@@ -17,43 +17,21 @@ Codec router class
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
|
||||
|
||||
\membersection{wxSoundRouterStream::wxSoundRouterStream}\label{wxsoundrouterstreamwxsoundrouterstream}
|
||||
|
||||
\func{}{wxSoundRouterStream}{\param{wxSoundStream\& }{sndio}}
|
||||
|
||||
\helpref{wxSoundCodec}{wxsoundcodec}
|
||||
|
||||
|
||||
\membersection{wxSoundRouterStream::\destruct{wxSoundRouterStream}}\label{wxsoundrouterstreamdtor}
|
||||
|
||||
\func{}{\destruct{wxSoundRouterStream}}{\void}
|
||||
|
||||
|
||||
\membersection{wxSoundRouterStream::Read}\label{wxsoundrouterstreamread}
|
||||
|
||||
\func{wxSoundStream\&}{Read}{\param{void* }{buffer}, \param{wxUint32 }{len}}
|
||||
|
||||
|
||||
\membersection{wxSoundRouterStream::Write}\label{wxsoundrouterstreamwrite}
|
||||
|
||||
\func{wxSoundStream\&}{Write}{\param{const void* }{buffer}, \param{wxUint32 }{len}}
|
||||
|
||||
Destructor.
|
||||
|
||||
\membersection{wxSoundRouterStream::SetSoundFormat}\label{wxsoundrouterstreamsetsoundformat}
|
||||
|
||||
\func{bool}{SetSoundFormat}{\param{const wxSoundFormatBase\& }{format}}
|
||||
|
||||
|
||||
\membersection{wxSoundRouterStream::StartProduction}\label{wxsoundrouterstreamstartproduction}
|
||||
|
||||
\func{bool}{StartProduction}{\param{int }{evt}}
|
||||
|
||||
|
||||
\membersection{wxSoundRouterStream::StopProduction}\label{wxsoundrouterstreamstopproduction}
|
||||
|
||||
\func{bool}{StopProduction}{\void}
|
||||
|
||||
|
||||
\membersection{wxSoundRouterStream::GetBestSize}\label{wxsoundrouterstreamgetbestsize}
|
||||
|
||||
\constfunc{wxUint32}{GetBestSize}{\void}
|
||||
|
||||
SetSoundFormat will first try to setup the device driver with the specified
|
||||
format. If this fails, it will try to find a codec which will convert the
|
||||
input format to a valid format for the device driver. It uses an internal
|
||||
codec database.
|
||||
|
Before Width: | Height: | Size: 225 B After Width: | Height: | Size: 978 B |
Before Width: | Height: | Size: 231 B After Width: | Height: | Size: 996 B |
Before Width: | Height: | Size: 164 B After Width: | Height: | Size: 959 B |
@@ -1,5 +1,5 @@
|
||||
[OPTIONS]
|
||||
BMROOT=d:\wx2\wxwind~1\docs\latex\ogl ; Assume that bitmaps are where the source is
|
||||
BMROOT=d:\wx2\wxwind~1\contrib\docs\latex\ogl ; Assume that bitmaps are where the source is
|
||||
TITLE=OGL Manual
|
||||
CONTENTS=Contents
|
||||
COMPRESS=HIGH
|
||||
|
Before Width: | Height: | Size: 137 B After Width: | Height: | Size: 998 B |
@@ -27,7 +27,7 @@ class WXDLLEXPORT wxCDAudio : public wxObject {
|
||||
public:
|
||||
typedef enum { PLAYING, PAUSED, STOPPED } CDstatus;
|
||||
// Table of contents manager
|
||||
class CDtoc {
|
||||
class WXDLLEXPORT CDtoc {
|
||||
protected:
|
||||
wxCDtime *tracks_time, *tracks_pos;
|
||||
wxCDtime total_time;
|
||||
|
@@ -22,7 +22,7 @@
|
||||
// AIFF codec
|
||||
//
|
||||
|
||||
class wxSoundAiff: public wxSoundFileStream {
|
||||
class WXDLLEXPORT wxSoundAiff: public wxSoundFileStream {
|
||||
public:
|
||||
wxSoundAiff(wxInputStream& stream, wxSoundStream& io_sound);
|
||||
wxSoundAiff(wxOutputStream& stream, wxSoundStream& io_sound);
|
||||
|
@@ -112,7 +112,7 @@ class WXDLLEXPORT wxSoundFormatBase {
|
||||
// Base class for sound streams
|
||||
//
|
||||
|
||||
class wxSoundStream {
|
||||
class WXDLLEXPORT wxSoundStream {
|
||||
public:
|
||||
wxSoundStream();
|
||||
virtual ~wxSoundStream();
|
||||
|
@@ -15,7 +15,7 @@
|
||||
#include "wx/defs.h"
|
||||
#include "wx/mmedia/sndbase.h"
|
||||
|
||||
class wxSoundStreamCodec: public wxSoundStream {
|
||||
class WXDLLEXPORT wxSoundStreamCodec: public wxSoundStream {
|
||||
public:
|
||||
wxSoundStreamCodec(wxSoundStream& snd_io);
|
||||
~wxSoundStreamCodec();
|
||||
|
@@ -20,7 +20,7 @@
|
||||
// PCM converter class
|
||||
//
|
||||
|
||||
class wxSoundStreamPcm: public wxSoundStreamCodec {
|
||||
class WXDLLEXPORT wxSoundStreamPcm: public wxSoundStreamCodec {
|
||||
public:
|
||||
typedef void (*ConverterType)(const void *buf_in, void *buf_out,
|
||||
wxUint32 len);
|
||||
|
@@ -5,8 +5,8 @@
|
||||
// Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 2000
|
||||
// CVSID: $Id$
|
||||
// --------------------------------------------------------------------------
|
||||
#ifndef _WX_SNDULAW_H
|
||||
#define _WX_SNDULAW_H
|
||||
#ifndef _WX_SNDMSAD_H
|
||||
#define _WX_SNDMSAD_H
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "sndmsad.h"
|
||||
@@ -17,46 +17,52 @@
|
||||
#include "wx/mmedia/sndcodec.h"
|
||||
#include "wx/mmedia/sndbase.h"
|
||||
|
||||
WX_DEFINE_EXPORTED_ARRAY(wxUint16, wxMSAdpcmCoeffs);
|
||||
WX_DEFINE_EXPORTED_ARRAY(wxInt16, wxMSAdpcmCoeffs);
|
||||
|
||||
//
|
||||
// MSADPCM format
|
||||
//
|
||||
class WXDLLEXPORT wxSoundFormatMSAdpcm: public wxSoundFormatBase {
|
||||
public:
|
||||
wxSoundFormatMSAdpcm();
|
||||
~wxSoundFormatMSAdpcm();
|
||||
public:
|
||||
wxSoundFormatMSAdpcm();
|
||||
~wxSoundFormatMSAdpcm();
|
||||
|
||||
void SetSampleRate(wxUint32 srate);
|
||||
wxUint32 GetSampleRate() const;
|
||||
|
||||
void SetCoefs(wxInt16 **coefs, wxUint16 ncoefs, wxUint16 coefs_len);
|
||||
void GetCoefs(wxInt16 **&coefs, wxUint16& ncoefs,
|
||||
wxUint16& coefs_len) const;
|
||||
|
||||
void SetSampleRate(wxUint32 srate);
|
||||
wxUint32 GetSampleRate() const;
|
||||
void SetBlockSize(wxUint16 block_size);
|
||||
wxUint16 GetBlockSize() const;
|
||||
|
||||
void SetChannels(wxUint16 channels);
|
||||
wxUint16 GetChannels() const;
|
||||
|
||||
wxSoundFormatType GetType() const { return wxSOUND_MSADPCM; }
|
||||
wxSoundFormatBase *Clone() const;
|
||||
|
||||
wxUint32 GetTimeFromBytes(wxUint32 bytes) const;
|
||||
wxUint32 GetBytesFromTime(wxUint32 time) const;
|
||||
|
||||
bool operator !=(const wxSoundFormatBase& frmt2) const;
|
||||
|
||||
void SetSamplesBlock(wxUint16 sampblock);
|
||||
wxUint16 GetSamplesBlock() const;
|
||||
|
||||
void SetCoefs(wxMSAdpcmCoefs& coefs);
|
||||
wxMSAdpcmCoefs& GetCoefs() const;
|
||||
|
||||
wxSoundFormatType GetType() const { return wxSOUND_ULAW; }
|
||||
wxSoundFormatBase *Clone() const;
|
||||
|
||||
wxUint32 GetTimeFromBytes(wxUint32 bytes) const;
|
||||
wxUint32 GetBytesFromTime(wxUint32 time) const;
|
||||
|
||||
bool operator !=(const wxSoundFormatBase& frmt2) const;
|
||||
|
||||
protected:
|
||||
wxUint32 m_srate;
|
||||
wxMSAdpcmCoefs *m_coefs;
|
||||
protected:
|
||||
wxUint32 m_srate, m_nchannels;
|
||||
wxInt16 **m_coefs;
|
||||
wxUint16 m_ncoefs, m_coefs_len;
|
||||
wxUint16 m_block_size;
|
||||
};
|
||||
|
||||
//
|
||||
// MS ADPCM converter class
|
||||
//
|
||||
class WXDLLEXPORT wxSoundRouterStream;
|
||||
class WXDLLEXPORT wxSoundStreamAdpcm: public wxSoundStreamCodec {
|
||||
class WXDLLEXPORT wxSoundStreamMSAdpcm: public wxSoundStreamCodec {
|
||||
public:
|
||||
wxSoundStreamAdpcm(wxSoundStream& sndio);
|
||||
~wxSoundStreamAdpcm();
|
||||
wxSoundStreamMSAdpcm(wxSoundStream& sndio);
|
||||
~wxSoundStreamMSAdpcm();
|
||||
|
||||
wxSoundStream& Read(void *buffer, wxUint32 len);
|
||||
wxSoundStream& Write(const void *buffer, wxUint32 len);
|
||||
@@ -67,6 +73,32 @@ public:
|
||||
|
||||
protected:
|
||||
wxSoundRouterStream *m_router;
|
||||
|
||||
typedef struct {
|
||||
wxInt32 predictor;
|
||||
wxInt16 samp1;
|
||||
wxInt16 samp2;
|
||||
wxInt16 coeff[2];
|
||||
wxInt32 iDelta;
|
||||
} AdpcmState;
|
||||
|
||||
AdpcmState m_state[1];
|
||||
|
||||
bool m_got_header;
|
||||
bool m_stereo;
|
||||
wxInt16 **m_coefs;
|
||||
wxUint16 m_block_size;
|
||||
wxUint16 m_ncoefs;
|
||||
wxUint16 m_next_block;
|
||||
|
||||
protected:
|
||||
wxUint32 DecodeMonoADPCM(const void *in_buffer, void *out_buffer,
|
||||
wxUint32 in_len);
|
||||
wxUint32 DecodeStereoADPCM(const void *in_buffer, void *out_buffer,
|
||||
wxUint32 in_len);
|
||||
void Nibble(wxInt8 nyb,
|
||||
AdpcmState *state,
|
||||
wxInt16 **out_buffer);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -21,7 +21,7 @@
|
||||
// OSS output class
|
||||
//
|
||||
|
||||
class wxSoundStreamOSS : public wxSoundStream {
|
||||
class WXDLLEXPORT wxSoundStreamOSS : public wxSoundStream {
|
||||
public:
|
||||
wxSoundStreamOSS(const wxString& dev_name = wxT("/dev/dsp"));
|
||||
~wxSoundStreamOSS();
|
||||
|
@@ -42,12 +42,18 @@ protected:
|
||||
wxUint32 GetData(void *buffer, wxUint32 len);
|
||||
wxUint32 PutData(const void *buffer, wxUint32 len);
|
||||
|
||||
bool HandleOutputPCM(wxDataInputStream& data, wxUint16 channels,
|
||||
wxUint32 sample_fq, wxUint32 byte_p_sec,
|
||||
wxUint16 byte_p_spl, wxUint16 bits_p_spl);
|
||||
bool HandleOutputG721(wxDataInputStream& data, wxUint16 channels,
|
||||
wxUint32 sample_fq, wxUint32 byte_p_sec,
|
||||
wxUint16 byte_p_spl, wxUint16 bits_p_spl);
|
||||
bool HandleOutputPCM(wxDataInputStream& data, wxUint32 len,
|
||||
wxUint16 channels, wxUint32 sample_fq,
|
||||
wxUint32 byte_p_sec, wxUint16 byte_p_spl,
|
||||
wxUint16 bits_p_spl);
|
||||
bool HandleOutputMSADPCM(wxDataInputStream& data, wxUint32 len,
|
||||
wxUint16 channels, wxUint32 sample_fq,
|
||||
wxUint32 byte_p_sec, wxUint16 byte_p_spl,
|
||||
wxUint16 bits_p_spl);
|
||||
bool HandleOutputG721(wxDataInputStream& data, wxUint32 len,
|
||||
wxUint16 channels, wxUint32 sample_fq,
|
||||
wxUint32 byte_p_sec, wxUint16 byte_p_spl,
|
||||
wxUint16 bits_p_spl);
|
||||
wxSoundFormatBase *HandleInputPCM(wxDataOutputStream& data);
|
||||
wxSoundFormatBase *HandleInputG72X(wxDataOutputStream& data);
|
||||
|
||||
|
181
contrib/include/wx/stc/SciLexer.h
Normal file
@@ -0,0 +1,181 @@
|
||||
// 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.
|
||||
|
||||
#ifndef SCILEXER_H
|
||||
#define SCILEXER_H
|
||||
|
||||
// SciLexer features - not in standard Scintilla
|
||||
|
||||
#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
|
||||
|
||||
// Lexical states for SCLEX_PYTHON
|
||||
#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
|
||||
|
||||
// Lexical states for SCLEX_CPP, SCLEX_VB
|
||||
#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
|
||||
|
||||
// Lexical states for SCLEX_HTML, SCLEX_xML
|
||||
#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
|
||||
// XML and ASP
|
||||
#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
|
||||
// Embedded Javascript
|
||||
#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
|
||||
// ASP Javascript
|
||||
#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
|
||||
// Embedded VBScript
|
||||
#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
|
||||
// ASP VBScript
|
||||
#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
|
||||
// Embedded Python
|
||||
#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
|
||||
// ASP Python
|
||||
#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
|
||||
|
||||
// Lexical states for SCLEX_PERL
|
||||
#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
|
||||
|
||||
// Lexical states for SCLEX_LATEX
|
||||
#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
|
||||
|
||||
#endif
|
@@ -22,7 +22,7 @@
|
||||
|
||||
|
||||
#include <wx/wx.h>
|
||||
|
||||
#include "SciLexer.h"
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// constants and stuff
|
||||
@@ -53,7 +53,7 @@ const int wxSTC_STYLE_LINENUMBER = 33;
|
||||
const int wxSTC_STYLE_BRACELIGHT = 34;
|
||||
const int wxSTC_STYLE_BRACEBAD = 35;
|
||||
const int wxSTC_STYLE_CONTROLCHAR = 36;
|
||||
const int wxSTC_STYLE_MAX = 63;
|
||||
const int wxSTC_STYLE_MAX = 127;
|
||||
const int wxSTC_STYLE_MASK = 31;
|
||||
|
||||
const int wxSTC_MARKER_MAX = 31;
|
||||
@@ -63,16 +63,32 @@ const int wxSTC_MARK_ARROW = 2;
|
||||
const int wxSTC_MARK_SMALLRECT = 3;
|
||||
const int wxSTC_MARK_SHORTARROW = 4;
|
||||
const int wxSTC_MARK_EMPTY = 5;
|
||||
const int wxSTC_MARK_ARROWDOWN = 6;
|
||||
const int wxSTC_MARK_MINUS = 7;
|
||||
const int wxSTC_MARK_PLUS = 8;
|
||||
|
||||
const int wxSTC_MARKNUM_FOLDER = 30;
|
||||
const int wxSTC_MARKNUM_FOLDEROPEN= 31;
|
||||
const int wxSTC_MASK_FOLDERS = ((1 << wxSTC_MARKNUM_FOLDER) | (1 << wxSTC_MARKNUM_FOLDEROPEN));
|
||||
|
||||
const int wxSTC_INDIC_MAX = 7;
|
||||
const int wxSTC_INDIC_PLAIN = 0;
|
||||
const int wxSTC_INDIC_SQUIGGLE = 1;
|
||||
const int wxSTC_INDIC_TT = 2;
|
||||
const int wxSTC_INDIC_DIAGONAL = 3;
|
||||
const int wxSTC_INDIC_STRIKE = 4;
|
||||
const int wxSTC_INDIC0_MASK = 32;
|
||||
const int wxSTC_INDIC1_MASK = 64;
|
||||
const int wxSTC_INDIC2_MASK = 128;
|
||||
const int wxSTC_INDICS_MASK = (wxSTC_INDIC0_MASK | wxSTC_INDIC1_MASK | wxSTC_INDIC2_MASK);
|
||||
|
||||
|
||||
const int wxSTC_FOLDLEVELBASE = 0x0400;
|
||||
const int wxSTC_FOLDLEVELWHITEFLAG = 0x1000;
|
||||
const int wxSTC_FOLDLEVELHEADERFLAG = 0x2000;
|
||||
const int wxSTC_FOLDLEVELNUMBERMASK = 0x0FFF;
|
||||
|
||||
|
||||
// key commands
|
||||
enum {
|
||||
wxSTC_CMD_LINEDOWN = 2300,
|
||||
@@ -111,7 +127,14 @@ enum {
|
||||
wxSTC_CMD_ZOOMIN,
|
||||
wxSTC_CMD_ZOOMOUT,
|
||||
wxSTC_CMD_DELWORDLEFT,
|
||||
wxSTC_CMD_DELWORDRIGHT
|
||||
wxSTC_CMD_DELWORDRIGHT,
|
||||
wxSTC_CMD_LINECUT,
|
||||
wxSTC_CMD_LINEDELETE,
|
||||
wxSTC_CMD_LINETRANSPOSE,
|
||||
wxSTC_CMD_LOWERCASE,
|
||||
wxSTC_CMD_UPPERCASE,
|
||||
wxSTC_CMD_LINESCROLLDOWN,
|
||||
wxSTC_CMD_LINESCROLLUP
|
||||
};
|
||||
|
||||
|
||||
@@ -129,6 +152,8 @@ enum wxSTC_LEX {
|
||||
wxSTC_LEX_ERRORLIST,
|
||||
wxSTC_LEX_MAKEFILE,
|
||||
wxSTC_LEX_BATCH,
|
||||
wxSTC_LEX_XCODE,
|
||||
wxSTC_LEX_LATEX
|
||||
};
|
||||
|
||||
|
||||
@@ -153,13 +178,23 @@ 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);
|
||||
~wxStyledTextCtrl();
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef SWIG
|
||||
~wxStyledTextCtrl();
|
||||
#endif
|
||||
|
||||
|
||||
// Text retrieval and modification
|
||||
wxString GetText();
|
||||
@@ -170,8 +205,10 @@ public:
|
||||
bool GetReadOnly();
|
||||
wxString GetTextRange(int startPos, int endPos);
|
||||
wxString GetStyledTextRange(int startPos, int endPos);
|
||||
#ifndef SWIG
|
||||
void GetTextRange(int startPos, int endPos, char* buff);
|
||||
void GetStyledTextRange(int startPos, int endPos, char* buff);
|
||||
#endif
|
||||
void AddText(const wxString& text);
|
||||
void AddStyledText(const wxString& text);
|
||||
void InsertText(int pos, const wxString& text);
|
||||
@@ -203,7 +240,11 @@ public:
|
||||
|
||||
|
||||
// Selection and information
|
||||
#ifdef SWIG
|
||||
void GetSelection(int* OUTPUT, int* OUTPUT);
|
||||
#else
|
||||
void GetSelection(int* startPos, int* endPos);
|
||||
#endif
|
||||
void SetSelection(int startPos, int endPos);
|
||||
wxString GetSelectedText();
|
||||
void HideSelection(bool hide);
|
||||
@@ -218,7 +259,11 @@ public:
|
||||
int GetLineStartPos(int line);
|
||||
int GetLineLengthAtPos(int pos);
|
||||
int GetLineLength(int line);
|
||||
wxString GetCurrentLineText(int* linePos=NULL);
|
||||
#ifdef SWIG
|
||||
wxString GetCurrentLineText(int* OUTPUT);
|
||||
#else
|
||||
wxString GetCurrentLineText(int* linePos);
|
||||
#endif
|
||||
int GetCurrentLine();
|
||||
int PositionFromPoint(wxPoint pt);
|
||||
int LineFromPoint(wxPoint pt);
|
||||
@@ -239,7 +284,10 @@ public:
|
||||
void EnsureCaretVisible();
|
||||
void SetCaretPolicy(int policy, int slop=0);
|
||||
int GetSelectionType();
|
||||
|
||||
int GetLinesOnScreen();
|
||||
bool IsSelectionRectangle();
|
||||
void SetUseHorizontalScrollBar(bool use);
|
||||
bool GetUseHorizontalScrollBar();
|
||||
|
||||
|
||||
// Searching
|
||||
@@ -268,6 +316,8 @@ public:
|
||||
void StartStyling(int pos, int mask);
|
||||
void SetStyleFor(int length, int style);
|
||||
void SetStyleBytes(int length, char* styleBytes);
|
||||
void SetLineState(int line, int value);
|
||||
int GetLineState(int line);
|
||||
|
||||
|
||||
// Style Definition
|
||||
@@ -277,12 +327,13 @@ public:
|
||||
void StyleSetForeground(int styleNum, const wxColour& colour);
|
||||
void StyleSetBackground(int styleNum, const wxColour& colour);
|
||||
void StyleSetFont(int styleNum, wxFont& font);
|
||||
void StyleSetFontAttr(int styleNum, int size, const wxString& faceName, bool bold, bool italic);
|
||||
void StyleSetFontAttr(int styleNum, int size, const wxString& faceName, bool bold=FALSE, bool italic=FALSE, bool underline=FALSE);
|
||||
void StyleSetBold(int styleNum, bool bold);
|
||||
void StyleSetItalic(int styleNum, bool italic);
|
||||
void StyleSetFaceName(int styleNum, const wxString& faceName);
|
||||
void StyleSetSize(int styleNum, int pointSize);
|
||||
void StyleSetEOLFilled(int styleNum, bool fillEOL);
|
||||
void StyleSetUnderline(int styleNum, bool underline);
|
||||
|
||||
|
||||
// Margins in the edit area
|
||||
@@ -313,8 +364,15 @@ public:
|
||||
// Other settings
|
||||
void SetBufferedDraw(bool isBuffered);
|
||||
void SetTabWidth(int numChars);
|
||||
void SetIndent(int numChars);
|
||||
void SetUseTabs(bool usetabs);
|
||||
void SetLineIndentation(int line, int indentation);
|
||||
int GetLineIndentation(int line);
|
||||
int GetLineIndentationPos(int line);
|
||||
void SetWordChars(const wxString& wordChars);
|
||||
|
||||
void SetUsePop(bool usepopup);
|
||||
|
||||
|
||||
// Brace highlighting
|
||||
void BraceHighlight(int pos1, int pos2);
|
||||
@@ -352,7 +410,9 @@ public:
|
||||
int AutoCompPosAtStart();
|
||||
void AutoCompComplete();
|
||||
void AutoCompStopChars(const wxString& stopChars);
|
||||
|
||||
void AutoCompSetSeparator(char separator);
|
||||
char AutoCompGetSeparator();
|
||||
void AutoCompSelect(const wxString& stringtoselect);
|
||||
|
||||
// Call tips
|
||||
void CallTipShow(int pos, const wxString& text);
|
||||
@@ -391,15 +451,23 @@ public:
|
||||
int DocLineFromVisible(int displayLine);
|
||||
int SetFoldLevel(int line, int level);
|
||||
int GetFoldLevel(int line);
|
||||
int GetLastChild(int line);
|
||||
int GetLastChild(int line, int level);
|
||||
int GetFoldParent(int line);
|
||||
void ShowLines(int lineStart, int lineEnd);
|
||||
void HideLines(int lineStart, int lineEnd);
|
||||
bool GetLineVisible(int line);
|
||||
void SetFoldExpanded(int line);
|
||||
void SetFoldExpanded(int line, bool expanded);
|
||||
bool GetFoldExpanded(int line);
|
||||
void ToggleFold(int line);
|
||||
void EnsureVisible(int line);
|
||||
void SetFoldFlags(int flags);
|
||||
|
||||
|
||||
// Zooming
|
||||
void ZoomIn();
|
||||
void ZoomOut();
|
||||
void SetZoom(int zoom);
|
||||
int GetZoom();
|
||||
|
||||
|
||||
// Long Lines
|
||||
@@ -419,7 +487,11 @@ public:
|
||||
void SetKeywords(int keywordSet, const wxString& keywordList);
|
||||
|
||||
|
||||
// Event mask for Modified Event
|
||||
void SetModEventMask(int mask);
|
||||
//int GetModEventMask();
|
||||
|
||||
#ifndef SWIG
|
||||
private:
|
||||
// Event handlers
|
||||
void OnPaint(wxPaintEvent& evt);
|
||||
@@ -430,11 +502,13 @@ private:
|
||||
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
|
||||
@@ -445,6 +519,7 @@ private:
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_CLASS(wxStyledTextCtrl)
|
||||
|
||||
ScintillaWX* m_swx;
|
||||
wxStopWatch m_stopWatch;
|
||||
@@ -454,13 +529,14 @@ private:
|
||||
|
||||
friend class ScintillaWX;
|
||||
friend class Platform;
|
||||
#endif
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class wxStyledTextEvent : public wxCommandEvent {
|
||||
public:
|
||||
wxStyledTextEvent(wxEventType commandType, int id);
|
||||
wxStyledTextEvent(wxEventType commandType=0, int id=0);
|
||||
~wxStyledTextEvent() {}
|
||||
|
||||
void SetPosition(int pos) { m_position = pos; }
|
||||
@@ -499,7 +575,10 @@ public:
|
||||
|
||||
void CopyObject(wxObject& obj) const;
|
||||
|
||||
#ifndef SWIG
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxStyledTextEvent)
|
||||
|
||||
int m_position;
|
||||
int m_key;
|
||||
int m_modifiers;
|
||||
@@ -517,11 +596,11 @@ private:
|
||||
int m_message; // wxEVT_STC_MACRORECORD
|
||||
int m_wParam;
|
||||
int m_lParam;
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Event types
|
||||
enum {
|
||||
wxEVT_STC_CHANGE = 1650,
|
||||
wxEVT_STC_STYLENEEDED,
|
||||
@@ -538,6 +617,21 @@ enum {
|
||||
wxEVT_STC_NEEDSHOWN
|
||||
};
|
||||
|
||||
// Modification and action types
|
||||
const int wxSTC_MOD_INSERTTEXT = 0x1;
|
||||
const int wxSTC_MOD_DELETETEXT = 0x2;
|
||||
const int wxSTC_MOD_CHANGESTYLE = 0x4;
|
||||
const int wxSTC_MOD_CHANGEFOLD = 0x8;
|
||||
const int wxSTC_PERFORMED_USER = 0x10;
|
||||
const int wxSTC_PERFORMED_UNDO = 0x20;
|
||||
const int wxSTC_PERFORMED_REDO = 0x40;
|
||||
const int wxSTC_LASTSTEPINUNDOREDO = 0x100;
|
||||
const int wxSTC_MOD_CHANGEMARKER = 0x200;
|
||||
const int wxSTC_MOD_BEFOREINSERT = 0x400;
|
||||
const int wxSTC_MOD_BEFOREDELETE = 0x800;
|
||||
|
||||
|
||||
#ifndef SWIG
|
||||
typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
|
||||
|
||||
#define EVT_STC_CHANGE(id, fn) { wxEVT_STC_CHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
|
||||
@@ -549,9 +643,12 @@ typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
|
||||
#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_CMDKEY(id, fn) { wxEVT_STC_CMDKEY, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
|
||||
#define EVT_STC_UNKNOWNCMDKEY(id, fn) { wxEVT_STC_UNKNOWNCMDKEY, 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 },
|
||||
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
|
38
contrib/include/wx/xml/xh_all.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_all.h
|
||||
// Purpose: includes all xh_*.h files
|
||||
// Author: Vaclav Slavik
|
||||
// Created: 2000/03/05
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_ALL_H_
|
||||
#define _WX_XH_ALL_H_
|
||||
|
||||
|
||||
// Existing handlers:
|
||||
|
||||
#include "wx/xml/xh_menu.h"
|
||||
#include "wx/xml/xh_panel.h"
|
||||
#include "wx/xml/xh_dlg.h"
|
||||
#include "wx/xml/xh_bttn.h"
|
||||
#include "wx/xml/xh_chckb.h"
|
||||
#include "wx/xml/xh_gauge.h"
|
||||
#include "wx/xml/xh_html.h"
|
||||
#include "wx/xml/xh_spin.h"
|
||||
#include "wx/xml/xh_sttxt.h"
|
||||
#include "wx/xml/xh_slidr.h"
|
||||
#include "wx/xml/xh_radbt.h"
|
||||
#include "wx/xml/xh_radbx.h"
|
||||
#include "wx/xml/xh_combo.h"
|
||||
#include "wx/xml/xh_chckl.h"
|
||||
#include "wx/xml/xh_choic.h"
|
||||
#include "wx/xml/xh_sizer.h"
|
||||
#include "wx/xml/xh_stbmp.h"
|
||||
#include "wx/xml/xh_notbk.h"
|
||||
#include "wx/xml/xh_text.h"
|
||||
#include "wx/xml/xh_listb.h"
|
||||
|
||||
#endif // _WX_XMLRES_H_
|
29
contrib/include/wx/xml/xh_bttn.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_bttn.h
|
||||
// Purpose: XML resource handler for buttons
|
||||
// Author: Vaclav Slavik
|
||||
// Created: 2000/03/05
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_BTTN_H_
|
||||
#define _WX_XH_BTTN_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xh_bttn.h"
|
||||
#endif
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
class WXDLLEXPORT wxButtonXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxButtonXmlHandler() : wxXmlResourceHandler() {}
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
};
|
||||
|
||||
|
||||
#endif // _WX_XH_BTTN_H_
|
35
contrib/include/wx/xml/xh_chckb.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_chckb.h
|
||||
// Purpose: XML resource handler for wxCheckBox
|
||||
// Author: Bob Mitchell
|
||||
// Created: 2000/03/21
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Bob Mitchell and Verant Interactive
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_CHCKB_H_
|
||||
#define _WX_XH_CHCKB_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xh_chckb.h"
|
||||
#endif
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_CHECKBOX
|
||||
|
||||
class WXDLLEXPORT wxCheckBoxXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxCheckBoxXmlHandler();
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif // _WX_XH_CHECKBOX_H_
|
||||
|
33
contrib/include/wx/xml/xh_chckl.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_chckl.h
|
||||
// Purpose: XML resource handler for wxCheckListBox
|
||||
// Author: Bob Mitchell
|
||||
// Created: 2000/03/21
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Bob Mitchell and Verant Interactive
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_CHCKL_H_
|
||||
#define _WX_XH_CHCKL_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xh_chckl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
class WXDLLEXPORT wxCheckListXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxCheckListXmlHandler();
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
private:
|
||||
bool m_InsideBox;
|
||||
wxArrayString strList;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // _WX_XH_CHECKLIST_H_
|
32
contrib/include/wx/xml/xh_choic.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_choic.h
|
||||
// Purpose: XML resource handler for wxChoice
|
||||
// Author: Bob Mitchell
|
||||
// Created: 2000/03/21
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Bob Mitchell and Verant Interactive
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_CHOIC_H_
|
||||
#define _WX_XH_CHOIC_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xh_choic.h"
|
||||
#endif
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
class WXDLLEXPORT wxChoiceXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxChoiceXmlHandler();
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
private:
|
||||
bool m_InsideBox;
|
||||
wxArrayString strList;
|
||||
};
|
||||
|
||||
|
||||
#endif // _WX_XH_CHOIC_H_
|
35
contrib/include/wx/xml/xh_combo.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_combo.h
|
||||
// Purpose: XML resource handler for wxComboBox
|
||||
// Author: Bob Mitchell
|
||||
// Created: 2000/03/21
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Bob Mitchell and Verant Interactive
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_COMBO_H_
|
||||
#define _WX_XH_COMBO_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xh_combo.h"
|
||||
#endif
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
#if wxUSE_COMBOBOX
|
||||
|
||||
class WXDLLEXPORT wxComboBoxXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxComboBoxXmlHandler();
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
private:
|
||||
bool m_InsideBox;
|
||||
wxArrayString strList;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // _WX_XH_COMBO_H_
|
29
contrib/include/wx/xml/xh_dlg.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_dlg.h
|
||||
// Purpose: XML resource handler for dialogs
|
||||
// Author: Vaclav Slavik
|
||||
// Created: 2000/03/05
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_DLG_H_
|
||||
#define _WX_XH_DLG_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xh_dlg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
class WXDLLEXPORT wxDialogXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxDialogXmlHandler();
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
};
|
||||
|
||||
|
||||
#endif // _WX_XH_DLG_H_
|
40
contrib/include/wx/xml/xh_gauge.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_gauge.h
|
||||
// Purpose: XML resource handler for wxGauge
|
||||
// Author: Bob Mitchell
|
||||
// Created: 2000/03/21
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Bob Mitchell and Verant Interactive
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_GAUGE_H_
|
||||
#define _WX_XH_GAUGE_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xh_gauge.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_GAUGE
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
|
||||
class WXDLLEXPORT wxGaugeXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
enum
|
||||
{
|
||||
wxGAUGE_DEFAULT_RANGE = 100
|
||||
};
|
||||
|
||||
public:
|
||||
wxGaugeXmlHandler();
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // _WX_XH_GAUGE_H_
|
34
contrib/include/wx/xml/xh_html.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_html.h
|
||||
// Purpose: XML resource handler for wxHtmlWindow
|
||||
// Author: Bob Mitchell
|
||||
// Created: 2000/03/21
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Bob Mitchell and Verant Interactive
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_HTML_H_
|
||||
#define _WX_XH_HTML_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xh_html.h"
|
||||
#endif
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_HTML
|
||||
|
||||
class WXDLLEXPORT wxHtmlWindowXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxHtmlWindowXmlHandler();
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // _WX_XH_SLIDER_H_
|
35
contrib/include/wx/xml/xh_listb.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_listb.h
|
||||
// Purpose: XML resource handler for wxListbox
|
||||
// Author: Bob Mitchell & Vaclav Slavik
|
||||
// Created: 2000/07/29
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Bob Mitchell & Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_LISTB_H_
|
||||
#define _WX_XH_LISTB_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xh_listb.h"
|
||||
#endif
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
#if wxUSE_LISTBOX
|
||||
|
||||
class WXDLLEXPORT wxListBoxXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxListBoxXmlHandler();
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
private:
|
||||
bool m_InsideBox;
|
||||
wxArrayString strList;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // _WX_XH_LISTB_H_
|
40
contrib/include/wx/xml/xh_menu.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_menu.h
|
||||
// Purpose: XML resource handler for menus/menubars
|
||||
// Author: Vaclav Slavik
|
||||
// Created: 2000/03/05
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_MENU_H_
|
||||
#define _WX_XH_MENU_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xh_menu.h"
|
||||
#endif
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
class WXDLLEXPORT wxMenuXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxMenuXmlHandler();
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
|
||||
private:
|
||||
bool m_InsideMenu;
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxMenuBarXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxMenuBarXmlHandler();
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
};
|
||||
|
||||
|
||||
#endif // _WX_XH_MENU_H_
|
37
contrib/include/wx/xml/xh_notbk.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_notbk.h
|
||||
// Purpose: XML resource handler for wxNotebook
|
||||
// Author: Vaclav Slavik
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_NOTBK_H_
|
||||
#define _WX_XH_NOTBK_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xh_notbk.h"
|
||||
#endif
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
#if wxUSE_NOTEBOOK
|
||||
|
||||
class WXDLLEXPORT wxNotebook;
|
||||
|
||||
class WXDLLEXPORT wxNotebookXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxNotebookXmlHandler();
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
|
||||
private:
|
||||
bool m_IsInside;
|
||||
wxNotebook *m_Notebook;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // _WX_XH_NOTBK_H_
|
29
contrib/include/wx/xml/xh_panel.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_panel.h
|
||||
// Purpose: XML resource handler for panels
|
||||
// Author: Vaclav Slavik
|
||||
// Created: 2000/03/05
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_PANEL_H_
|
||||
#define _WX_XH_PANEL_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xh_panel.h"
|
||||
#endif
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
class WXDLLEXPORT wxPanelXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxPanelXmlHandler();
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
};
|
||||
|
||||
|
||||
#endif // _WX_XH_PANEL_H_
|
33
contrib/include/wx/xml/xh_radbt.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_radbt.h
|
||||
// Purpose: XML resource handler for radio buttons
|
||||
// Author: Bob Mitchell
|
||||
// Created: 2000/03/21
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Bob Mitchell and Verant Interactive
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_RADBT_H_
|
||||
#define _WX_XH_RADBT_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xh_radbt.h"
|
||||
#endif
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_RADIOBOX
|
||||
|
||||
class WXDLLEXPORT wxRadioButtonXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxRadioButtonXmlHandler();
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // _WX_XH_RADIOBUTTON_H_
|
35
contrib/include/wx/xml/xh_radbx.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_radbx.h
|
||||
// Purpose: XML resource handler for radio box
|
||||
// Author: Bob Mitchell
|
||||
// Created: 2000/03/21
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Bob Mitchell and Verant Interactive
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_RADBX_H_
|
||||
#define _WX_XH_RADBX_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xh_radbx.h"
|
||||
#endif
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
#if wxUSE_RADIOBOX
|
||||
|
||||
class WXDLLEXPORT wxRadioBoxXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxRadioBoxXmlHandler();
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
private:
|
||||
bool m_InsideBox;
|
||||
wxArrayString strList;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // _WX_XH_RADBX_H_
|
36
contrib/include/wx/xml/xh_sizer.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_sizer.h
|
||||
// Purpose: XML resource handler for wxBoxSizer
|
||||
// Author: Vaclav Slavik
|
||||
// Created: 2000/04/24
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_SIZER_H_
|
||||
#define _WX_XH_SIZER_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xh_sizer.h"
|
||||
#endif
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
|
||||
class WXDLLEXPORT wxSizer;
|
||||
|
||||
class WXDLLEXPORT wxSizerXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxSizerXmlHandler();
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
|
||||
private:
|
||||
bool m_IsInside;
|
||||
wxSizer *m_ParentSizer;
|
||||
};
|
||||
|
||||
|
||||
#endif // _WX_XH_BOXSIZER_H_
|
40
contrib/include/wx/xml/xh_slidr.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_slidr.h
|
||||
// Purpose: XML resource handler for wxSlider
|
||||
// Author: Bob Mitchell
|
||||
// Created: 2000/03/21
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Bob Mitchell and Verant Interactive
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_SLIDR_H_
|
||||
#define _WX_XH_SLIDR_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xh_slidr.h"
|
||||
#endif
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_SLIDER
|
||||
|
||||
class WXDLLEXPORT wxSliderXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
enum
|
||||
{
|
||||
wxSL_DEFAULT_VALUE = 0,
|
||||
wxSL_DEFAULT_MIN = 0,
|
||||
wxSL_DEFAULT_MAX = 100
|
||||
};
|
||||
|
||||
public:
|
||||
wxSliderXmlHandler();
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // _WX_XH_SLIDER_H_
|
55
contrib/include/wx/xml/xh_spin.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_spin.h
|
||||
// Purpose: XML resource handler for wxSpinButton
|
||||
// Author: Bob Mitchell
|
||||
// Created: 2000/03/21
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Bob Mitchell and Verant Interactive
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_SPIN_H_
|
||||
#define _WX_XH_SPIN_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xh_spin.h"
|
||||
#endif
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_SPINBTN
|
||||
class WXDLLEXPORT wxSpinButtonXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
enum
|
||||
{
|
||||
wxSP_DEFAULT_VALUE = 0,
|
||||
wxSP_DEFAULT_MIN = 0,
|
||||
wxSP_DEFAULT_MAX = 100
|
||||
};
|
||||
|
||||
public:
|
||||
wxSpinButtonXmlHandler();
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
};
|
||||
#endif
|
||||
|
||||
#if wxUSE_SPINCTRL
|
||||
class WXDLLEXPORT wxSpinCtrlXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
enum
|
||||
{
|
||||
wxSP_DEFAULT_VALUE = 0,
|
||||
wxSP_DEFAULT_MIN = 0,
|
||||
wxSP_DEFAULT_MAX = 100
|
||||
};
|
||||
|
||||
public:
|
||||
wxSpinCtrlXmlHandler();
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // _WX_XH_SPIN_H_
|
30
contrib/include/wx/xml/xh_stbmp.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_stbmp.h
|
||||
// Purpose: XML resource handler for wxStaticBitmap
|
||||
// Author: Vaclav Slavik
|
||||
// Created: 2000/04/22
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_STBMP_H_
|
||||
#define _WX_XH_STBMP_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xh_stbmp.h"
|
||||
#endif
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
|
||||
class WXDLLEXPORT wxStaticBitmapXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxStaticBitmapXmlHandler();
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
};
|
||||
|
||||
|
||||
#endif // _WX_XH_STBMP_H_
|
30
contrib/include/wx/xml/xh_sttxt.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_sttxt.h
|
||||
// Purpose: XML resource handler for wxStaticBitmap
|
||||
// Author: Bob Mitchell
|
||||
// Created: 2000/03/21
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Bob Mitchell
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_STTXT_H_
|
||||
#define _WX_XH_STTXT_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xh_sttxt.h"
|
||||
#endif
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
|
||||
class WXDLLEXPORT wxStaticTextXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxStaticTextXmlHandler();
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
};
|
||||
|
||||
|
||||
#endif // _WX_XH_STBMP_H_
|
30
contrib/include/wx/xml/xh_text.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xh_text.h
|
||||
// Purpose: XML resource handler for wxTextCtrl
|
||||
// Author: Aleksandras Gluchovas
|
||||
// Created: 2000/03/21
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Aleksandras Gluchovas
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_TEXT_H_
|
||||
#define _WX_XH_TEXT_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xh_text.h"
|
||||
#endif
|
||||
|
||||
#include "wx/xml/xmlres.h"
|
||||
|
||||
|
||||
class WXDLLEXPORT wxTextCtrlXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxTextCtrlXmlHandler();
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
};
|
||||
|
||||
|
||||
#endif // _WX_XH_TEXT_H_
|
239
contrib/include/wx/xml/xml.h
Normal file
@@ -0,0 +1,239 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xml.h
|
||||
// Purpose: wxXmlDocument - XML parser & data holder class
|
||||
// Author: Vaclav Slavik
|
||||
// Created: 2000/03/05
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XML_H_
|
||||
#define _WX_XML_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xml.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
|
||||
|
||||
class WXDLLEXPORT wxXmlNode;
|
||||
class WXDLLEXPORT wxXmlProperty;
|
||||
class WXDLLEXPORT wxXmlDocument;
|
||||
class WXDLLEXPORT wxXmlIOHandler;
|
||||
class WXDLLEXPORT wxInputStream;
|
||||
class WXDLLEXPORT wxOutputStream;
|
||||
|
||||
|
||||
// Represents XML node type.
|
||||
enum wxXmlNodeType
|
||||
{
|
||||
// note: values are synchronized with xmlElementType from libxml
|
||||
wxXML_ELEMENT_NODE = 1,
|
||||
wxXML_ATTRIBUTE_NODE = 2,
|
||||
wxXML_TEXT_NODE = 3,
|
||||
wxXML_CDATA_SECTION_NODE = 4,
|
||||
wxXML_ENTITY_REF_NODE = 5,
|
||||
wxXML_ENTITY_NODE = 6,
|
||||
wxXML_PI_NODE = 7,
|
||||
wxXML_COMMENT_NODE = 8,
|
||||
wxXML_DOCUMENT_NODE = 9,
|
||||
wxXML_DOCUMENT_TYPE_NODE = 10,
|
||||
wxXML_DOCUMENT_FRAG_NODE = 11,
|
||||
wxXML_NOTATION_NODE = 12,
|
||||
wxXML_HTML_DOCUMENT_NODE = 13
|
||||
};
|
||||
|
||||
|
||||
// Types of XML files:
|
||||
|
||||
enum wxXmlIOType
|
||||
{
|
||||
wxXML_IO_AUTO = 0, // detect it automatically
|
||||
wxXML_IO_LIBXML, // use libxml2 to parse/save XML document
|
||||
wxXML_IO_BIN, // save in binary uncompressed proprietary format
|
||||
wxXML_IO_BINZ // svae in binary zlib-compressed proprietary format
|
||||
};
|
||||
|
||||
|
||||
// Represents node property(ies).
|
||||
// Example: in <img src="hello.gif" id="3"/> "src" is property with value
|
||||
// "hello.gif" and "id" is prop. with value "3".
|
||||
|
||||
class WXDLLEXPORT wxXmlProperty
|
||||
{
|
||||
public:
|
||||
wxXmlProperty() : m_Next(NULL) {}
|
||||
wxXmlProperty(const wxString& name, const wxString& value, wxXmlProperty *next)
|
||||
: m_Name(name), m_Value(value), m_Next(next) {}
|
||||
~wxXmlProperty() { delete m_Next; }
|
||||
|
||||
wxString GetName() const { return m_Name; }
|
||||
wxString GetValue() const { return m_Value; }
|
||||
wxXmlProperty *GetNext() const { return m_Next; }
|
||||
|
||||
void SetName(const wxString& name) { m_Name = name; }
|
||||
void SetValue(const wxString& value) { m_Value = value; }
|
||||
void SetNext(wxXmlProperty *next) { m_Next = next; }
|
||||
|
||||
private:
|
||||
wxString m_Name;
|
||||
wxString m_Value;
|
||||
wxXmlProperty *m_Next;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Represents node in XML document. Node has name and may have content
|
||||
// and properties. Most common node types are wxXML_TEXT_NODE (name and props
|
||||
// are irrelevant) and wxXML_ELEMENT_NODE (e.g. in <title>hi</title> there is
|
||||
// element with name="title", irrelevant content and one child (wxXML_TEXT_NODE
|
||||
// with content="hi").
|
||||
|
||||
class WXDLLEXPORT wxXmlNode
|
||||
{
|
||||
public:
|
||||
wxXmlNode() : m_Properties(NULL), m_Parent(NULL),
|
||||
m_Children(NULL), m_Next(NULL) {}
|
||||
wxXmlNode(wxXmlNode *parent,wxXmlNodeType type,
|
||||
const wxString& name, const wxString& content,
|
||||
wxXmlProperty *props, wxXmlNode *next);
|
||||
~wxXmlNode() { delete m_Properties; delete m_Next; delete m_Children; }
|
||||
|
||||
// copy ctor & operator=. Note that this does NOT copy syblings
|
||||
// and parent pointer, i.e. m_Parent and m_Next will be NULL
|
||||
// after using copy ctor and are never unmodified by operator=.
|
||||
// On the other hand, it DOES copy children and properties.
|
||||
wxXmlNode(const wxXmlNode& node);
|
||||
wxXmlNode& operator=(const wxXmlNode& node);
|
||||
|
||||
// user-friendly creation:
|
||||
wxXmlNode(wxXmlNodeType type, const wxString& name,
|
||||
const wxString& content = wxEmptyString);
|
||||
void AddChild(wxXmlNode *child);
|
||||
void InsertChild(wxXmlNode *child, wxXmlNode *before_node);
|
||||
bool RemoveChild(wxXmlNode *child);
|
||||
void AddProperty(const wxString& name, const wxString& value);
|
||||
bool DeleteProperty(const wxString& name);
|
||||
|
||||
// access methods:
|
||||
wxXmlNodeType GetType() const { return m_Type; }
|
||||
wxString GetName() const { return m_Name; }
|
||||
wxString GetContent() const { return m_Content; }
|
||||
|
||||
wxXmlNode *GetParent() const { return m_Parent; }
|
||||
wxXmlNode *GetNext() const { return m_Next; }
|
||||
wxXmlNode *GetChildren() const { return m_Children; }
|
||||
|
||||
wxXmlProperty *GetProperties() const { return m_Properties; }
|
||||
bool GetPropVal(const wxString& propName, wxString *value) const;
|
||||
wxString GetPropVal(const wxString& propName, const wxString& defaultVal) const;
|
||||
bool HasProp(const wxString& propName) const;
|
||||
|
||||
void SetType(wxXmlNodeType type) { m_Type = type; }
|
||||
void SetName(const wxString& name) { m_Name = name; }
|
||||
void SetContent(const wxString& con) { m_Content = con; }
|
||||
|
||||
void SetParent(wxXmlNode *parent) { m_Parent = parent; }
|
||||
void SetNext(wxXmlNode *next) { m_Next = next; }
|
||||
void SetChildren(wxXmlNode *child) { m_Children = child; }
|
||||
|
||||
void SetProperties(wxXmlProperty *prop) { m_Properties = prop; }
|
||||
void AddProperty(wxXmlProperty *prop);
|
||||
|
||||
private:
|
||||
wxXmlNodeType m_Type;
|
||||
wxString m_Name;
|
||||
wxString m_Content;
|
||||
wxXmlProperty *m_Properties;
|
||||
wxXmlNode *m_Parent, *m_Children, *m_Next;
|
||||
|
||||
void DoCopy(const wxXmlNode& node);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// This class holds XML data/document as parsed by libxml. Note that
|
||||
// internal representation is independant on libxml and you can use
|
||||
// it without libxml (see Load/SaveBinary).
|
||||
|
||||
class WXDLLEXPORT wxXmlDocument : public wxObject
|
||||
{
|
||||
public:
|
||||
wxXmlDocument() : wxObject(), m_Version(_T("1.0")), m_Root(NULL) {}
|
||||
wxXmlDocument(const wxString& filename, wxXmlIOType io_type = wxXML_IO_AUTO);
|
||||
wxXmlDocument(wxInputStream& stream, wxXmlIOType io_type = wxXML_IO_AUTO);
|
||||
~wxXmlDocument() { delete m_Root; }
|
||||
|
||||
wxXmlDocument(const wxXmlDocument& doc);
|
||||
wxXmlDocument& operator=(const wxXmlDocument& doc);
|
||||
|
||||
// Parses .xml file and loads data. Returns TRUE on success, FALSE
|
||||
// otherwise.
|
||||
// NOTE: Any call to this method will result into linking against libxml
|
||||
// and app's binary size will grow by ca. 250kB
|
||||
bool Load(const wxString& filename, wxXmlIOType io_type = wxXML_IO_AUTO);
|
||||
bool Load(wxInputStream& stream, wxXmlIOType io_type = wxXML_IO_AUTO);
|
||||
|
||||
// Saves document as .xml file.
|
||||
bool Save(const wxString& filename, wxXmlIOType io_type) const;
|
||||
bool Save(wxOutputStream& stream, wxXmlIOType io_type) const;
|
||||
|
||||
// Returns root node of the document.
|
||||
wxXmlNode *GetRoot() const { return m_Root; }
|
||||
|
||||
// Returns version of document (may be empty).
|
||||
wxString GetVersion() const { return m_Version; }
|
||||
// Returns encoding of document (may be empty).
|
||||
wxString GetEncoding() const { return m_Encoding; }
|
||||
|
||||
// Write-access methods:
|
||||
void SetRoot(wxXmlNode *node) { delete m_Root ; m_Root = node; }
|
||||
void SetVersion(const wxString& version) { m_Version = version; }
|
||||
void SetEncoding(const wxString& encoding) { m_Encoding = encoding; }
|
||||
|
||||
static void AddHandler(wxXmlIOHandler *handler);
|
||||
static void CleanUpHandlers();
|
||||
static void InitStandardHandlers();
|
||||
|
||||
protected:
|
||||
static wxList *sm_Handlers;
|
||||
|
||||
private:
|
||||
wxString m_Version, m_Encoding;
|
||||
wxXmlNode *m_Root;
|
||||
|
||||
void DoCopy(const wxXmlDocument& doc);
|
||||
};
|
||||
|
||||
|
||||
|
||||
// wxXmlIOHandler takes care of loading and/or saving XML data.
|
||||
// see xmlio.h for available handlers
|
||||
|
||||
class WXDLLEXPORT wxXmlIOHandler : public wxObject
|
||||
{
|
||||
public:
|
||||
wxXmlIOHandler() {}
|
||||
|
||||
virtual wxXmlIOType GetType() = 0;
|
||||
virtual bool CanLoad(wxInputStream& stream) = 0;
|
||||
virtual bool CanSave() = 0;
|
||||
|
||||
virtual bool Load(wxInputStream& stream, wxXmlDocument& doc) = 0;
|
||||
virtual bool Save(wxOutputStream& stream, const wxXmlDocument& doc) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _WX_XML_H_
|
72
contrib/include/wx/xml/xmlio.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xmlio.h
|
||||
// Purpose: wxXmlIOHandler - XML I/O classes
|
||||
// Author: Vaclav Slavik
|
||||
// Created: 2000/07/24
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XMLIO_H_
|
||||
#define _WX_XMLIO_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xmlio.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/xml/xml.h"
|
||||
|
||||
|
||||
class WXDLLEXPORT wxXmlIOHandlerBin : public wxXmlIOHandler
|
||||
{
|
||||
public:
|
||||
wxXmlIOHandlerBin() {}
|
||||
|
||||
virtual wxXmlIOType GetType() { return wxXML_IO_BIN; }
|
||||
virtual bool CanLoad(wxInputStream& stream);
|
||||
virtual bool CanSave() { return TRUE; }
|
||||
|
||||
virtual bool Load(wxInputStream& stream, wxXmlDocument& doc);
|
||||
virtual bool Save(wxOutputStream& stream, const wxXmlDocument& doc);
|
||||
|
||||
protected:
|
||||
wxString ReadHeader(wxInputStream& stream);
|
||||
void WriteHeader(wxOutputStream& stream, const wxString& header);
|
||||
};
|
||||
|
||||
|
||||
|
||||
#if wxUSE_ZLIB
|
||||
|
||||
class WXDLLEXPORT wxXmlIOHandlerBinZ : public wxXmlIOHandlerBin
|
||||
{
|
||||
public:
|
||||
wxXmlIOHandlerBinZ() {}
|
||||
|
||||
virtual wxXmlIOType GetType() { return wxXML_IO_BINZ; }
|
||||
virtual bool CanLoad(wxInputStream& stream);
|
||||
|
||||
virtual bool Load(wxInputStream& stream, wxXmlDocument& doc);
|
||||
virtual bool Save(wxOutputStream& stream, const wxXmlDocument& doc);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
class WXDLLEXPORT wxXmlIOHandlerLibxml : public wxXmlIOHandler
|
||||
{
|
||||
public:
|
||||
virtual wxXmlIOType GetType() { return wxXML_IO_LIBXML; }
|
||||
virtual bool CanLoad(wxInputStream& stream);
|
||||
virtual bool CanSave();
|
||||
|
||||
virtual bool Load(wxInputStream& stream, wxXmlDocument& doc);
|
||||
virtual bool Save(wxOutputStream& stream, const wxXmlDocument& doc);
|
||||
};
|
||||
|
||||
|
||||
#endif // _WX_XMLIO_H_
|
256
contrib/include/wx/xml/xmlres.h
Normal file
@@ -0,0 +1,256 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: xmlres.h
|
||||
// Purpose: XML resources
|
||||
// Author: Vaclav Slavik
|
||||
// Created: 2000/03/05
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XMLRES_H_
|
||||
#define _WX_XMLRES_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "xmlres.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/dynarray.h"
|
||||
#include "wx/datetime.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/gdicmn.h"
|
||||
|
||||
class WXDLLEXPORT wxMenu;
|
||||
class WXDLLEXPORT wxMenuBar;
|
||||
class WXDLLEXPORT wxDialog;
|
||||
class WXDLLEXPORT wxPanel;
|
||||
class WXDLLEXPORT wxWindow;
|
||||
|
||||
class WXDLLEXPORT wxXmlResourceHandler;
|
||||
|
||||
#include "wx/xml/xml.h"
|
||||
|
||||
|
||||
class WXDLLEXPORT wxXmlResourceDataRecord
|
||||
{
|
||||
public:
|
||||
wxXmlResourceDataRecord() : Doc(NULL), Time(wxDateTime::Now()) {}
|
||||
~wxXmlResourceDataRecord() {delete Doc;}
|
||||
|
||||
wxString File;
|
||||
wxXmlDocument *Doc;
|
||||
wxDateTime Time;
|
||||
};
|
||||
|
||||
WX_DECLARE_EXPORTED_OBJARRAY(wxXmlResourceDataRecord, wxXmlResourceDataRecords);
|
||||
|
||||
// This class holds XML resources from one or more .xml files
|
||||
// (or derived forms, either binary or zipped -- see manual for
|
||||
// details).
|
||||
|
||||
class WXDLLEXPORT wxXmlResource : public wxObject
|
||||
{
|
||||
public:
|
||||
wxXmlResource();
|
||||
wxXmlResource(const wxString& filemask);
|
||||
~wxXmlResource();
|
||||
|
||||
// Loads resources from XML files that match given filemask.
|
||||
// This method understands VFS (see filesys.h).
|
||||
bool Load(const wxString& filemask);
|
||||
|
||||
// Initialize handlers for all supported controls/windows. This will
|
||||
// make the executable quite big because it forces linking against
|
||||
// most of wxWin library
|
||||
void InitAllHandlers();
|
||||
|
||||
// Initialize only specific handler (or custom handler). Convention says
|
||||
// that handler name is equal to control's name plus 'XmlHandler', e.g.
|
||||
// wxTextCtrlXmlHandler, wxHtmlWindowXmlHandler. XML resource compiler
|
||||
// (xmlres) can create include file that contains initialization code for
|
||||
// all controls used within the resource.
|
||||
void AddHandler(wxXmlResourceHandler *handler);
|
||||
|
||||
// Removes all handlers
|
||||
void ClearHandlers();
|
||||
|
||||
// Loads menu from resource. Returns NULL on failure.
|
||||
wxMenu *LoadMenu(const wxString& name);
|
||||
|
||||
// Loads menubar from resource. Returns NULL on failure.
|
||||
wxMenuBar *LoadMenuBar(const wxString& name);
|
||||
|
||||
// Loads dialog. dlg points to parent window (if any). Second form
|
||||
// is used to finish creation of already existing instance (main reason
|
||||
// for this is that you may want to use derived class with new event table)
|
||||
// Example (typical usage):
|
||||
// MyDialog dlg;
|
||||
// wxTheXmlResource->LoadDialog(&dlg, mainFrame, "my_dialog");
|
||||
// dlg->ShowModal();
|
||||
wxDialog *LoadDialog(wxWindow *parent, const wxString& name);
|
||||
bool LoadDialog(wxDialog *dlg, wxWindow *parent, const wxString& name);
|
||||
|
||||
// Loads panel. panel points to parent window (if any). Second form
|
||||
// is used to finish creation of already existing instance.
|
||||
wxPanel *LoadPanel(wxWindow *parent, const wxString& name);
|
||||
bool LoadPanel(wxPanel *panel, wxWindow *parent, const wxString& name);
|
||||
|
||||
// Returns numeric ID that is equivalent to string id used in XML
|
||||
// resource. To be used in event tables
|
||||
// Macro XMLID is provided for convenience
|
||||
static int GetXMLID(const char *str_id);
|
||||
|
||||
protected:
|
||||
// Scans resources list for unloaded files and loads them. Also reloads
|
||||
// files that have been modified since last loading.
|
||||
void UpdateResources();
|
||||
|
||||
// Finds resource (calls UpdateResources) and returns node containing it
|
||||
wxXmlNode *FindResource(const wxString& name, const wxString& type);
|
||||
|
||||
// Creates resource from info in given node:
|
||||
wxObject *CreateResFromNode(wxXmlNode *node, wxObject *parent, wxObject *instance = NULL);
|
||||
|
||||
// Remove nodes with property "platform" that does not
|
||||
// match current platform
|
||||
void ProcessPlatformProperty(wxXmlNode *node);
|
||||
|
||||
private:
|
||||
wxList m_Handlers;
|
||||
wxXmlResourceDataRecords m_Data;
|
||||
|
||||
friend class wxXmlResourceHandler;
|
||||
};
|
||||
|
||||
|
||||
// Global instance of resource class. For your convenience.
|
||||
extern wxXmlResource *wxTheXmlResource;
|
||||
|
||||
// This macro translates string identifier (as used in XML resource,
|
||||
// e.g. <menuitem id="my_menu">...</menuitem>) to integer id that is needed by
|
||||
// wxWindows event tables.
|
||||
// Example:
|
||||
// BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
// EVT_MENU(XMLID("quit"), MyFrame::OnQuit)
|
||||
// EVT_MENU(XMLID("about"), MyFrame::OnAbout)
|
||||
// EVT_MENU(XMLID("new"), MyFrame::OnNew)
|
||||
// EVT_MENU(XMLID("open"), MyFrame::OnOpen)
|
||||
// END_EVENT_TABLE()
|
||||
|
||||
#define XMLID(str_id) \
|
||||
wxXmlResource::GetXMLID(_T(str_id))
|
||||
|
||||
|
||||
|
||||
// This macro returns pointer to particular control in dialog
|
||||
// created using XML resources. You can use it to set/get values from
|
||||
// controls.
|
||||
// Example:
|
||||
// wxDialog dlg;
|
||||
// wxTheXmlResource->LoadDialog(&dlg, mainFrame, "my_dialog");
|
||||
// XMLCTRL(dlg, "my_textctrl", wxTextCtrl)->SetValue(_T("default value"));
|
||||
|
||||
#define XMLCTRL(window, id, type) \
|
||||
((type*)((window).FindWindow(XMLID(id))))
|
||||
|
||||
|
||||
|
||||
class WXDLLEXPORT wxXmlResourceHandler : public wxObject
|
||||
{
|
||||
public:
|
||||
wxXmlResourceHandler();
|
||||
virtual ~wxXmlResourceHandler() {}
|
||||
|
||||
// Creates object (menu, dialog, control, ...) from XML node.
|
||||
// Should check for validity.
|
||||
// parent is higher-level object (usually window, dialog or panel)
|
||||
// that is often neccessary to create resource
|
||||
// if instance != NULL it should not create new instance via 'new' but
|
||||
// rather use this one and call its Create method
|
||||
wxObject *CreateResource(wxXmlNode *node, wxObject *parent, wxObject *instance);
|
||||
|
||||
// This one is called from CreateResource after variables
|
||||
// were filled
|
||||
virtual wxObject *DoCreateResource() = 0;
|
||||
|
||||
// Returns TRUE if it understands this node and can create
|
||||
// resource from it, FALSE otherwise.
|
||||
virtual bool CanHandle(wxXmlNode *node) = 0;
|
||||
|
||||
void SetParentResource(wxXmlResource *res) { m_Resource = res; }
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
wxXmlResource *m_Resource;
|
||||
wxArrayString m_StyleNames;
|
||||
wxArrayInt m_StyleValues;
|
||||
|
||||
// Variables (filled by CreateResource)
|
||||
wxXmlNode *m_Node;
|
||||
wxObject *m_Parent, *m_Instance;
|
||||
wxWindow *m_ParentAsWindow, *m_InstanceAsWindow;
|
||||
|
||||
// --- Handy methods:
|
||||
|
||||
// Gets node content from wxXML_ENTITY_NODE
|
||||
// (the problem is, <tag>content<tag> is represented as
|
||||
// wxXML_ENTITY_NODE name="tag", content=""
|
||||
// |-- wxXML_TEXT_NODE or
|
||||
// wxXML_CDATA_SECTION_NODE name="" content="content"
|
||||
wxString GetNodeContent(wxXmlNode *node);
|
||||
|
||||
// Check to see if a param exists
|
||||
bool HasParam(const wxString& param);
|
||||
|
||||
// Finds the node or returns NULL
|
||||
wxXmlNode *GetParamNode(const wxString& param);
|
||||
wxString GetParamValue(const wxString& param);
|
||||
|
||||
// Add style flag (e.g. wxMB_DOCKABLE) to list of flags
|
||||
// understood by this handler
|
||||
void AddStyle(const wxString& name, int value);
|
||||
|
||||
// Gets style flags from text in form "flag | flag2| flag3 |..."
|
||||
// Only understads flags added with AddStyle
|
||||
int GetStyle(const wxString& param = _T("style"), int defaults = 0);
|
||||
|
||||
// Gets text from param and does some convertions:
|
||||
// - replaces \n, \r, \t by respective chars (according to C syntax)
|
||||
// - replaces $ by & and $$ by $ (needed for $File => &File because of XML)
|
||||
// - converts encodings if neccessary
|
||||
wxString GetText(const wxString& param);
|
||||
|
||||
// Return XMLID
|
||||
int GetID();
|
||||
wxString GetName();
|
||||
|
||||
// Get bool flag (1,t,yes,on,true are TRUE, everything else is FALSE)
|
||||
bool GetBool(const wxString& param, bool defaultv = FALSE);
|
||||
|
||||
// Get integer value from param
|
||||
long GetLong( const wxString& param, long defaultv = 0 );
|
||||
|
||||
// Get colour in HTML syntax (#RRGGBB)
|
||||
wxColour GetColour(const wxString& param);
|
||||
|
||||
wxSize GetSize(const wxString& param = _T("size"));
|
||||
wxPoint GetPosition(const wxString& param = _T("pos"));
|
||||
|
||||
// Sets common window options:
|
||||
void SetupWindow(wxWindow *wnd);
|
||||
|
||||
void CreateChildren(wxObject *parent, bool only_this_handler = FALSE,
|
||||
wxXmlNode *children_node = NULL /*stands for
|
||||
GetParamNode("children")*/);
|
||||
wxObject *CreateResFromNode(wxXmlNode *node, wxObject *parent, wxObject *instance = NULL)
|
||||
{ return m_Resource->CreateResFromNode(node, parent, instance); }
|
||||
};
|
||||
|
||||
#define ADD_STYLE(style) AddStyle(_T(#style), style)
|
||||
|
||||
|
||||
|
||||
#endif // _WX_XMLRES_H_
|
@@ -1,12 +1,10 @@
|
||||
#
|
||||
# Makefile : Builds wxWindows utils for Unix.
|
||||
#
|
||||
# $Id$
|
||||
|
||||
CONTRIB_SAMPLES=mmedia ogl stc
|
||||
|
||||
all:
|
||||
cd mmedia; make
|
||||
cd stc; make
|
||||
@for d in $(CONTRIB_SAMPLES); do (cd $$d && $(MAKE)); done
|
||||
|
||||
clean:
|
||||
cd mmedia; make clean
|
||||
cd stc; make clean
|
||||
@for d in $(CONTRIB_SAMPLES); do (cd $$d && $(MAKE) clean); done
|
||||
|
||||
|
@@ -1,13 +1,5 @@
|
||||
#
|
||||
# File: makefile.unx
|
||||
# Author: Julian Smart
|
||||
# Created: 1998
|
||||
# Updated:
|
||||
# Copyright: (c) 1998 Julian Smart
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile for minimal example (UNIX).
|
||||
# Makefile for mmedia sample.
|
||||
# $Id$
|
||||
|
||||
top_srcdir = @top_srcdir@/..
|
||||
top_builddir = ../../..
|
||||
@@ -17,25 +9,8 @@ PROGRAM=mmboard
|
||||
|
||||
OBJECTS=mmboard.o mmbman.o
|
||||
|
||||
EXTRA_LIBS= $(top_builddir)/contrib/src/mmedia/libmmedia.@WX_TARGET_LIBRARY_TYPE@ @ESD_LINK@
|
||||
APPEXTRALIBS=$(top_builddir)/lib/libmmedia.@WX_TARGET_LIBRARY_TYPE@ @ESD_LINK@
|
||||
APPEXTRADEFS=-I$(top_srcdir)/contrib/include
|
||||
|
||||
# the comment at the end of the next line is needed because otherwise autoconf
|
||||
# would remove this line completely - it contains a built-in hack to remove
|
||||
# any VPATH assignment not containing ':'
|
||||
VPATH = @PATH_IFS@$(top_srcdir)/contrib/samples/mmedia # ':' for autoconf
|
||||
include $(top_builddir)/src/makeprog.env
|
||||
|
||||
include ../../../src/make.env
|
||||
|
||||
.SUFFIXES: .o .cpp .c
|
||||
|
||||
.cpp.o:
|
||||
$(CC) -c $(CPPFLAGS) $(EXTRA_CPPFLAGS) -o $@ $<
|
||||
|
||||
all: $(PROGRAM)
|
||||
|
||||
clean:
|
||||
rm -f *.o $(PROGRAM)
|
||||
|
||||
mmboard: $(OBJECTS)
|
||||
$(CC) $(LDFLAGS) -o mmboard $(OBJECTS) $(EXTRA_LIBS) $(LDLIBS) $(top_builddir)/lib/@WX_TARGET_LIBRARY@
|
||||
|
@@ -41,6 +41,7 @@
|
||||
#include "wx/mmedia/sndaiff.h"
|
||||
#include "wx/mmedia/sndpcm.h"
|
||||
#include "wx/mmedia/sndulaw.h"
|
||||
#include "wx/mmedia/sndmsad.h"
|
||||
|
||||
#ifdef __UNIX__
|
||||
#include "wx/mmedia/sndoss.h"
|
||||
@@ -310,6 +311,16 @@ wxString MMBoardSoundFile::GetStringInformation()
|
||||
|
||||
break;
|
||||
}
|
||||
case wxSOUND_MSADPCM: {
|
||||
wxSoundFormatMSAdpcm *adpcm_format = (wxSoundFormatMSAdpcm *)format;
|
||||
|
||||
info += wxString::Format(wxT("Microsoft ADPCM\n"));
|
||||
info += wxString::Format(wxT("Sampling Rate: %d\n")
|
||||
wxT("Number of channels: %d\n"),
|
||||
adpcm_format->GetSampleRate(),
|
||||
adpcm_format->GetChannels());
|
||||
break;
|
||||
}
|
||||
case wxSOUND_ULAW: {
|
||||
wxSoundFormatUlaw *ulaw_format = (wxSoundFormatUlaw *)format;
|
||||
info += wxT("ULAW\n");
|
||||
|
@@ -207,12 +207,20 @@ wxUint8 MMBoardApp::TestMultimediaCaps()
|
||||
delete dev;
|
||||
|
||||
// We test the OSS (Open Sound System) support.
|
||||
// WARNING: There is a conflict between ESD and ALSA
|
||||
|
||||
// WARNING: There is a conflict between ESD and ALSA. We may be interrested
|
||||
// in disabling the auto detection of OSS is ESD has been detected.
|
||||
#if 1
|
||||
if (!(caps & MM_SOUND_ESD)) {
|
||||
#endif
|
||||
|
||||
dev = new wxSoundStreamOSS();
|
||||
if (dev->GetError() == wxSOUND_NOERROR)
|
||||
caps |= MM_SOUND_OSS;
|
||||
delete dev;
|
||||
#if 1
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __WIN32__
|
||||
|
12
contrib/samples/ogl/Makefile.in
Normal file
@@ -0,0 +1,12 @@
|
||||
#
|
||||
# Makefile : Builds wxWindows utils for Unix.
|
||||
#
|
||||
|
||||
OGL_SAMPLES=ogledit studio
|
||||
|
||||
all:
|
||||
@for d in $(OGL_SAMPLES); do (cd $$d && $(MAKE)); done
|
||||
|
||||
clean:
|
||||
@for d in $(OGL_SAMPLES); do (cd $$d && $(MAKE) clean); done
|
||||
|
@@ -1,39 +0,0 @@
|
||||
#
|
||||
# File: Makefile
|
||||
# Author: Julian Smart
|
||||
# Created: 1999
|
||||
# Updated:
|
||||
# Copyright: (c) 2000 Julian Smart
|
||||
#
|
||||
# Makefile for OGL demo (GTK version)
|
||||
#
|
||||
# This makefile requires wxWindows/GTK to be
|
||||
# installed (possibly using "make install")
|
||||
# on your system.
|
||||
#
|
||||
|
||||
CPP = gcc -g
|
||||
CC = gcc
|
||||
WXCONFIG=../../../../wx-config
|
||||
WXINCLUDE=-I../../../../include -I../../../include
|
||||
WXLIB=-L../../../../lib -L../../../src/ogl
|
||||
|
||||
OBJECTS=ogledit.o palette.o doc.o view.o
|
||||
|
||||
ogledit: $(OBJECTS)
|
||||
$(CPP) -o ogledit $(OBJECTS) `$(WXCONFIG) --libs` $(WXLIB) -logl
|
||||
|
||||
ogledit.o: ogledit.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c ogledit.cpp
|
||||
|
||||
palette.o: palette.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c palette.cpp
|
||||
|
||||
doc.o: doc.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c doc.cpp
|
||||
|
||||
view.o: view.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c view.cpp
|
||||
|
||||
clean:
|
||||
rm -f *.o ogledit
|
16
contrib/samples/ogl/ogledit/Makefile.in
Normal file
@@ -0,0 +1,16 @@
|
||||
# Makefile for OGLEdit example.
|
||||
# $Id$
|
||||
|
||||
top_srcdir = @top_srcdir@/..
|
||||
top_builddir = ../../../..
|
||||
program_dir = contrib/samples/ogl/ogledit
|
||||
|
||||
PROGRAM=ogledit
|
||||
|
||||
OBJECTS=$(PROGRAM).o doc.o view.o palette.o
|
||||
|
||||
APPEXTRALIBS=$(top_builddir)/lib/libogl.@WX_TARGET_LIBRARY_TYPE@
|
||||
APPEXTRADEFS=-I$(top_srcdir)/contrib/include
|
||||
|
||||
include $(top_builddir)/src/makeprog.env
|
||||
|
@@ -1,20 +1,39 @@
|
||||
#
|
||||
# File: makefile.unx
|
||||
# File: Makefile
|
||||
# Author: Julian Smart
|
||||
# Created: 1998
|
||||
# Created: 1999
|
||||
# Updated:
|
||||
# Copyright: (c) 1998 Julian Smart
|
||||
# Copyright: (c) 2000 Julian Smart
|
||||
#
|
||||
# "%W% %G%"
|
||||
# Makefile for OGL demo (GTK version)
|
||||
#
|
||||
# This makefile requires wxWindows/GTK to be
|
||||
# installed (possibly using "make install")
|
||||
# on your system.
|
||||
#
|
||||
# Makefile for OGLEdit example (UNIX).
|
||||
|
||||
PROGRAM=ogledit
|
||||
CPP = gcc -g
|
||||
CC = gcc
|
||||
WXCONFIG=../../../../wx-config
|
||||
WXINCLUDE=-I../../../../include -I../../../include
|
||||
WXLIB=-L../../../../lib -L../../../src/ogl
|
||||
|
||||
OBJECTS=$(PROGRAM).o doc.o view.o palette.o
|
||||
OBJECTS=ogledit.o palette.o doc.o view.o
|
||||
|
||||
# EXTRACPPFLAGS=-I$(WXDIR)/contrib/include
|
||||
EXTRALDLIBS=-logl$(GUISUFFIX)
|
||||
ogledit: $(OBJECTS)
|
||||
$(CPP) -o ogledit $(OBJECTS) `$(WXCONFIG) --libs` $(WXLIB) -logl
|
||||
|
||||
include ../../../../src/makeprog.env
|
||||
ogledit.o: ogledit.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c ogledit.cpp
|
||||
|
||||
palette.o: palette.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c palette.cpp
|
||||
|
||||
doc.o: doc.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c doc.cpp
|
||||
|
||||
view.o: view.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c view.cpp
|
||||
|
||||
clean:
|
||||
rm -f *.o ogledit
|
||||
|
@@ -1,57 +0,0 @@
|
||||
#
|
||||
# File: Makefile
|
||||
# Author: Julian Smart
|
||||
# Created: 1999
|
||||
# Updated:
|
||||
# Copyright: (c) 2000 Julian Smart
|
||||
#
|
||||
# Makefile for OGL demo (GTK version)
|
||||
#
|
||||
# This makefile requires wxWindows/GTK to be
|
||||
# installed (possibly using "make install")
|
||||
# on your system.
|
||||
#
|
||||
|
||||
CPP = gcc -g
|
||||
CC = gcc
|
||||
WXCONFIG=../../../../wx-config
|
||||
WXINCLUDE=-I../../../../include -I../../../include
|
||||
WXLIB=-L../../../../lib -L../../../src/ogl
|
||||
|
||||
OBJECTS=studio.o cspalette.o csprint.o dialogs.o doc.o mainfrm.o project.o shapes.o symbols.o view.o
|
||||
|
||||
studio: $(OBJECTS)
|
||||
$(CPP) -o studio $(OBJECTS) `$(WXCONFIG) --libs` $(WXLIB) -logl
|
||||
|
||||
studio.o: studio.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c studio.cpp
|
||||
|
||||
cspalette.o: cspalette.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c cspalette.cpp
|
||||
|
||||
doc.o: doc.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c doc.cpp
|
||||
|
||||
view.o: view.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c view.cpp
|
||||
|
||||
dialogs.o: dialogs.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c dialogs.cpp
|
||||
|
||||
mainfrm.o: mainfrm.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c mainfrm.cpp
|
||||
|
||||
project.o: project.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c project.cpp
|
||||
|
||||
shapes.o: shapes.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c shapes.cpp
|
||||
|
||||
symbols.o: symbols.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c symbols.cpp
|
||||
|
||||
csprint.o: csprint.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c csprint.cpp
|
||||
|
||||
clean:
|
||||
rm -f *.o studio
|
19
contrib/samples/ogl/studio/Makefile.in
Normal file
@@ -0,0 +1,19 @@
|
||||
# Makefile for OGL Studio.
|
||||
# $Id$
|
||||
|
||||
top_srcdir = @top_srcdir@/..
|
||||
top_builddir = ../../../..
|
||||
program_dir = contrib/samples/ogl/studio
|
||||
|
||||
PROGRAM=studio
|
||||
|
||||
DATAFILES=studio_resources.wxr
|
||||
|
||||
OBJECTS=$(PROGRAM).o doc.o shapes.o symbols.o view.o cspalette.o\
|
||||
mainfrm.o project.o dialogs.o csprint.o
|
||||
|
||||
APPEXTRALIBS=$(top_builddir)/lib/libogl.@WX_TARGET_LIBRARY_TYPE@
|
||||
APPEXTRADEFS=-I$(top_srcdir)/contrib/include -I$(top_srcdir)/$(program_dir)/bitmaps
|
||||
|
||||
include $(top_builddir)/src/makeprog.env
|
||||
|
@@ -1,39 +1,57 @@
|
||||
#
|
||||
# File: makefile.unx
|
||||
# File: Makefile
|
||||
# Author: Julian Smart
|
||||
# Created: 1998
|
||||
# Created: 1999
|
||||
# Updated:
|
||||
# Copyright: (c) 1998 Julian Smart
|
||||
# Copyright: (c) 2000 Julian Smart
|
||||
#
|
||||
# "%W% %G%"
|
||||
# Makefile for OGL demo (GTK version)
|
||||
#
|
||||
# This makefile requires wxWindows/GTK to be
|
||||
# installed (possibly using "make install")
|
||||
# on your system.
|
||||
#
|
||||
# Makefile for OGL Studio (UNIX).
|
||||
|
||||
PROGRAM=studio
|
||||
CPP = gcc -g
|
||||
CC = gcc
|
||||
WXCONFIG=../../../../wx-config
|
||||
WXINCLUDE=-I../../../../include -I../../../include
|
||||
WXLIB=-L../../../../lib -L../../../src/ogl
|
||||
|
||||
OBJECTS=$(PROGRAM).o doc.o shapes.o symbols.o view.o cspalette.o\
|
||||
mainfrm.o project.o dialogs.o csprint.o
|
||||
OBJECTS=studio.o cspalette.o csprint.o dialogs.o doc.o mainfrm.o project.o shapes.o symbols.o view.o
|
||||
|
||||
EXTRACPPFLAGS=-I$(WXDIR)/utils/ogl/src -I./bitmaps
|
||||
EXTRALDLIBS=-logl$(GUISUFFIX)
|
||||
studio: $(OBJECTS)
|
||||
$(CPP) -o studio $(OBJECTS) `$(WXCONFIG) --libs` $(WXLIB) -logl
|
||||
|
||||
#WXDIR=/home/jacs/wx2
|
||||
studio.o: studio.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c studio.cpp
|
||||
|
||||
include $(WXDIR)/src/makeprog.env
|
||||
cspalette.o: cspalette.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c cspalette.cpp
|
||||
|
||||
cleanogl:
|
||||
cd $(WXDIR)/utils/ogl/src; make -f makefile.unx cleanmotif
|
||||
doc.o: doc.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c doc.cpp
|
||||
|
||||
ogl:
|
||||
cd $(WXDIR)/utils/ogl/src; make -f makefile.unx motif
|
||||
view.o: view.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c view.cpp
|
||||
|
||||
wx:
|
||||
cd $(WXDIR)/src/motif; make -f makefile.unx motif
|
||||
dialogs.o: dialogs.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c dialogs.cpp
|
||||
|
||||
cleanwx:
|
||||
cd $(WXDIR)/src/motif; make -f makefile.unx cleanmotif
|
||||
mainfrm.o: mainfrm.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c mainfrm.cpp
|
||||
|
||||
cleanall: cleanmotif cleanogl cleanwx
|
||||
project.o: project.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c project.cpp
|
||||
|
||||
makeall: wx ogl motif
|
||||
shapes.o: shapes.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c shapes.cpp
|
||||
|
||||
symbols.o: symbols.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c symbols.cpp
|
||||
|
||||
csprint.o: csprint.cpp
|
||||
$(CPP) `$(WXCONFIG) --cflags` -I../../src $(WXINCLUDE) -c csprint.cpp
|
||||
|
||||
clean:
|
||||
rm -f *.o studio
|
||||
|
@@ -13,9 +13,9 @@ PROGRAM=stctest
|
||||
|
||||
OBJECTS=$(PROGRAM).o
|
||||
|
||||
APPEXTRALIBS=$(top_builddir)/contrib/src/stc/libstc.@WX_TARGET_LIBRARY_TYPE@
|
||||
APPEXTRALIBS=$(top_builddir)/lib/libstc.@WX_TARGET_LIBRARY_TYPE@
|
||||
APPEXTRADEFS=-I$(top_srcdir)/contrib/include
|
||||
|
||||
DATAFILES=stctest.cpp
|
||||
|
||||
include ../../../src/makeprog.env
|
||||
include $(top_builddir)/src/makeprog.env
|
||||
|
@@ -1,8 +1,6 @@
|
||||
#
|
||||
# Makefile : Builds wxWindows contrib src for Unix.
|
||||
#
|
||||
# $Id$
|
||||
|
||||
CONTRIB_SUBDIRS=ogl mmedia stc
|
||||
CONTRIB_SUBDIRS=ogl mmedia stc xml
|
||||
|
||||
all:
|
||||
@for d in $(CONTRIB_SUBDIRS); do (cd $$d && $(MAKE)); done
|
||||
|
@@ -1,7 +1,8 @@
|
||||
#
|
||||
# $Id$
|
||||
|
||||
top_srcdir = @top_srcdir@
|
||||
top_srcdir = @top_srcdir@/..
|
||||
top_builddir = ../../..
|
||||
libsrc_dir = contrib/src/mmedia
|
||||
|
||||
TARGET_LIBNAME=libmmedia
|
||||
|
||||
@@ -9,17 +10,20 @@ LIBVERSION_CURRENT=1
|
||||
LIBVERSION_REVISION=0
|
||||
LIBVERSION_AGE=0
|
||||
|
||||
HEADER_PATH=$(top_srcdir)/contrib/include/wx
|
||||
HEADER_SUBDIR=mmedia
|
||||
|
||||
HEADERS=cdbase.h cdunix.h cdwin.h sndaiff.h sndbase.h sndcodec.h \
|
||||
sndcpcm.h sndesd.h sndfile.h sndg72x.h sndmsad.h sndoss.h \
|
||||
sndpcm.h sndulaw.h sndwav.h sndwin.h vidbase.h vidwin.h \
|
||||
vidxanm.h
|
||||
|
||||
OBJECTS=cdbase.o cdwin.o g711.o g721.o g723_24.o \
|
||||
g723_40.o g72x.o sndaiff.o sndbase.o sndcodec.o \
|
||||
sndcpcm.o sndfile.o sndg72x.o sndpcm.o sndulaw.o \
|
||||
sndwav.o sndwin.o vidbase.o vidwin.o vidxanm.o sndoss.o sndesd.o
|
||||
|
||||
# the comment at the end of the next line is needed because otherwise autoconf
|
||||
# would remove this line completely - it contains a built-in hack to remove
|
||||
# any VPATH assignment not containing ':'
|
||||
VPATH = :$(top_srcdir)/src/mmedia # ':' for autoconf
|
||||
|
||||
APPEXTRADEFS=-I$(top_srcdir)/include
|
||||
APPEXTRADEFS=-I$(top_srcdir)/contrib/include
|
||||
|
||||
include $(top_builddir)/src/makelib.env
|
||||
|
||||
|
@@ -10,6 +10,13 @@
|
||||
#endif
|
||||
|
||||
#include <wx/wxprec.h>
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/defs.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/log.h"
|
||||
#endif
|
||||
|
||||
#include "wx/mmedia/sndbase.h"
|
||||
|
||||
|
||||
@@ -27,12 +34,14 @@ wxSoundFormatBase::~wxSoundFormatBase()
|
||||
|
||||
wxSoundFormatBase *wxSoundFormatBase::Clone() const
|
||||
{
|
||||
return NULL;
|
||||
wxLogFatalError(wxT("In wxSoundFormatBase::Clone() but I should"
|
||||
" not be there"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool wxSoundFormatBase::operator!=(const wxSoundFormatBase& frmt2) const
|
||||
{
|
||||
return (GetType() != frmt2.GetType());
|
||||
return (GetType() != frmt2.GetType());
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -41,21 +50,21 @@ bool wxSoundFormatBase::operator!=(const wxSoundFormatBase& frmt2) const
|
||||
|
||||
wxSoundStream::wxSoundStream()
|
||||
{
|
||||
int i;
|
||||
|
||||
// Reset all variables to their neutral value.
|
||||
m_sndformat = NULL;
|
||||
m_handler = NULL;
|
||||
m_snderror = wxSOUND_NOERROR;
|
||||
m_lastcount = 0;
|
||||
for (i=0;i<2;i++)
|
||||
m_callback[i] = NULL;
|
||||
int i;
|
||||
|
||||
// Reset all variables to their neutral value.
|
||||
m_sndformat = NULL;
|
||||
m_handler = NULL;
|
||||
m_snderror = wxSOUND_NOERROR;
|
||||
m_lastcount = 0;
|
||||
for (i=0;i<2;i++)
|
||||
m_callback[i] = NULL;
|
||||
}
|
||||
|
||||
wxSoundStream::~wxSoundStream()
|
||||
{
|
||||
if (m_sndformat)
|
||||
delete m_sndformat;
|
||||
delete m_sndformat;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
@@ -69,13 +78,13 @@ wxSoundStream::~wxSoundStream()
|
||||
// --------------------------------------------------------------------------
|
||||
bool wxSoundStream::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
{
|
||||
// delete the previous prepared format
|
||||
if (m_sndformat)
|
||||
delete m_sndformat;
|
||||
|
||||
// create a new one by cloning the format passed in parameter
|
||||
m_sndformat = format.Clone();
|
||||
return TRUE;
|
||||
// delete the previous prepared format
|
||||
if (m_sndformat)
|
||||
delete m_sndformat;
|
||||
|
||||
// create a new one by cloning the format passed in parameter
|
||||
m_sndformat = format.Clone();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -379,11 +379,15 @@ bool wxSoundStreamPcm::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
// We try to minimize the need of dynamic memory allocation by preallocating a buffer. But
|
||||
// to be sure it will be efficient we minimize the best size.
|
||||
if (m_multiplier_in < m_multiplier_out) {
|
||||
m_prebuffer_size = (wxUint32)(m_sndio->GetBestSize() * m_multiplier_out);
|
||||
m_best_size = (wxUint32)(m_sndio->GetBestSize() * m_multiplier_in);
|
||||
m_prebuffer_size = (wxUint32)(m_sndio->GetBestSize() *
|
||||
m_multiplier_out);
|
||||
m_best_size = (wxUint32)(m_sndio->GetBestSize() *
|
||||
m_multiplier_in);
|
||||
} else {
|
||||
m_prebuffer_size = (wxUint32)(m_sndio->GetBestSize() * m_multiplier_in);
|
||||
m_best_size = (wxUint32)(m_sndio->GetBestSize() * m_multiplier_out);
|
||||
m_prebuffer_size = (wxUint32)(m_sndio->GetBestSize() *
|
||||
m_multiplier_in);
|
||||
m_best_size = (wxUint32)(m_sndio->GetBestSize() *
|
||||
m_multiplier_out);
|
||||
}
|
||||
|
||||
m_prebuffer = new char[m_prebuffer_size];
|
||||
|
@@ -18,6 +18,7 @@
|
||||
#include "wx/mmedia/sndcpcm.h"
|
||||
#include "wx/mmedia/sndulaw.h"
|
||||
#include "wx/mmedia/sndg72x.h"
|
||||
#include "wx/mmedia/sndmsad.h"
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Sound codec router
|
||||
@@ -106,6 +107,10 @@ bool wxSoundRouterStream::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
m_router = new wxSoundStreamG72X(*m_sndio);
|
||||
m_router->SetSoundFormat(format);
|
||||
break;
|
||||
case wxSOUND_MSADPCM:
|
||||
m_router = new wxSoundStreamMSAdpcm(*m_sndio);
|
||||
m_router->SetSoundFormat(format);
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
|
||||
|
@@ -6,10 +6,17 @@
|
||||
// CVSID: $Id$
|
||||
// --------------------------------------------------------------------------
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "sndulaw.cpp"
|
||||
#pragma implementation "sndmsad.cpp"
|
||||
#endif
|
||||
|
||||
#include <wx/wxprec.h>
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/defs.h"
|
||||
#include "wx/memory.h"
|
||||
#include "wx/log.h"
|
||||
#endif
|
||||
|
||||
#include "wx/mmedia/sndbase.h"
|
||||
#include "wx/mmedia/sndfile.h"
|
||||
#include "wx/mmedia/sndpcm.h"
|
||||
@@ -22,12 +29,21 @@
|
||||
wxSoundFormatMSAdpcm::wxSoundFormatMSAdpcm()
|
||||
: m_srate(22050)
|
||||
{
|
||||
m_coefs = new wxMSAdpcmCoefs();
|
||||
m_ncoefs = 0;
|
||||
m_coefs_len = 0;
|
||||
m_coefs = NULL;
|
||||
}
|
||||
|
||||
wxSoundFormatMSAdpcm::~wxSoundFormatMSAdpcm()
|
||||
{
|
||||
delete m_coefs;
|
||||
if (m_ncoefs) {
|
||||
wxUint16 i;
|
||||
|
||||
for (i=0;i<m_ncoefs;i++)
|
||||
delete[] m_coefs[i];
|
||||
delete[] m_coefs;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void wxSoundFormatMSAdpcm::SetSampleRate(wxUint32 srate)
|
||||
@@ -40,34 +56,83 @@ wxUint32 wxSoundFormatMSAdpcm::GetSampleRate() const
|
||||
return m_srate;
|
||||
}
|
||||
|
||||
void wxSoundFormatMSAdpcm::SetChannels(wxUint16 nchannels)
|
||||
{
|
||||
m_nchannels = nchannels;
|
||||
}
|
||||
|
||||
wxUint16 wxSoundFormatMSAdpcm::GetChannels() const
|
||||
{
|
||||
return m_nchannels;
|
||||
}
|
||||
|
||||
void wxSoundFormatMSAdpcm::SetCoefs(wxInt16 **coefs, wxUint16 ncoefs,
|
||||
wxUint16 coefs_len)
|
||||
{
|
||||
wxUint16 i;
|
||||
|
||||
if (m_ncoefs) {
|
||||
for (i=0;i<m_ncoefs;i++)
|
||||
delete[] (m_coefs[i]);
|
||||
delete[] m_coefs;
|
||||
}
|
||||
// TODO: Add some memory checking here
|
||||
m_coefs = new (wxInt16 *)[ncoefs];
|
||||
|
||||
for (i=0;i<ncoefs;i++)
|
||||
m_coefs[i] = new wxInt16[coefs_len];
|
||||
|
||||
m_ncoefs = ncoefs;
|
||||
m_coefs_len = coefs_len;
|
||||
}
|
||||
|
||||
void wxSoundFormatMSAdpcm::GetCoefs(wxInt16 **& coefs, wxUint16& ncoefs,
|
||||
wxUint16& coefs_len) const
|
||||
{
|
||||
coefs = m_coefs;
|
||||
ncoefs = m_ncoefs;
|
||||
coefs_len = m_coefs_len;
|
||||
}
|
||||
|
||||
void wxSoundFormatMSAdpcm::SetBlockSize(wxUint16 block_size)
|
||||
{
|
||||
m_block_size = block_size;
|
||||
}
|
||||
|
||||
wxUint16 wxSoundFormatMSAdpcm::GetBlockSize() const
|
||||
{
|
||||
return m_block_size;
|
||||
}
|
||||
|
||||
wxSoundFormatBase *wxSoundFormatMSAdpcm::Clone() const
|
||||
{
|
||||
wxSoundFormatMSAdpcm *adpcm = new wxSoundFormatMSAdpcm();
|
||||
|
||||
adpcm->m_srate = m_srate;
|
||||
adpcm->m_coefs = new wxMSAdpcmCoefs();
|
||||
*(adpcm->m_coefs) = *m_coefs;
|
||||
adpcm->m_srate = m_srate;
|
||||
adpcm->SetCoefs(m_coefs, m_ncoefs, m_coefs_len);
|
||||
adpcm->m_nchannels = m_nchannels;
|
||||
adpcm->m_block_size = m_block_size;
|
||||
return adpcm;
|
||||
}
|
||||
|
||||
wxUint32 wxSoundFormatMSAdpcm::GetTimeFromBytes(wxUint32 bytes) const
|
||||
{
|
||||
return 0;
|
||||
return 2 * bytes / (m_nchannels * m_srate);
|
||||
}
|
||||
|
||||
wxUint32 wxSoundFormatMSAdpcm::GetBytesFromTime(wxUint32 time) const
|
||||
{
|
||||
return 0;
|
||||
return time * m_nchannels * m_srate / 2;
|
||||
}
|
||||
|
||||
bool wxSoundFormatMSAdpcm::operator !=(const wxSoundFormatBase& frmt2) const
|
||||
{
|
||||
wxSoundFormatUlaw *adpcm = (wxSoundFormatMSAdpcm *)&frmt2;
|
||||
const wxSoundFormatMSAdpcm *adpcm = (const wxSoundFormatMSAdpcm *)&frmt2;
|
||||
|
||||
if (frmt2.GetType() != wxSOUND_MSADPCM)
|
||||
return TRUE;
|
||||
|
||||
return (adpcm->m_srate != m_srate) && 0;
|
||||
return (adpcm->m_srate != m_srate) && (adpcm->m_nchannels != m_nchannels);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
@@ -79,6 +144,7 @@ wxSoundStreamMSAdpcm::wxSoundStreamMSAdpcm(wxSoundStream& sndio)
|
||||
// PCM converter
|
||||
m_router = new wxSoundRouterStream(sndio);
|
||||
m_got_header = FALSE;
|
||||
m_stereo = FALSE;
|
||||
}
|
||||
|
||||
wxSoundStreamMSAdpcm::~wxSoundStreamMSAdpcm()
|
||||
@@ -94,45 +160,188 @@ wxSoundStream& wxSoundStreamMSAdpcm::Read(void *buffer, wxUint32 len)
|
||||
}
|
||||
|
||||
static wxInt16 gl_ADPCMcoeff_delta[] = {
|
||||
230, 230, 230, 230, 307, 409, 512, 614, 768, 614, 512, 409, 307, 230, 230, 230
|
||||
230, 230, 230, 230, 307, 409, 512, 614, 768, 614, 512, 409, 307,
|
||||
230, 230, 230
|
||||
};
|
||||
|
||||
static wxInt16 gl_ADPCMcoeff_1[] = {
|
||||
256, 512, 0, 192, 240, 460, 392
|
||||
};
|
||||
wxUint32 wxSoundStreamMSAdpcm::DecodeMonoADPCM(const void *in_buffer,
|
||||
void *out_buffer,
|
||||
wxUint32 in_len)
|
||||
{
|
||||
wxUint8 *ADPCMdata;
|
||||
wxInt16 *PCMdata;
|
||||
AdpcmState *state;
|
||||
wxUint32 out_len;
|
||||
|
||||
ADPCMdata = (wxUint8 *)in_buffer;
|
||||
PCMdata = (wxInt16 *)out_buffer;
|
||||
state = &m_state[0];
|
||||
|
||||
#define GET_DATA_16(i) i = *ADPCMdata++, i |= ((wxUint32)(*ADPCMdata++) << 8)
|
||||
#define GET_DATA_8(i) i = (*ADPCMdata++)
|
||||
|
||||
static wxInt16 gl_ADPCMcoeff_2[] = {
|
||||
0, -256, 0, 64, 0, -208, -232
|
||||
};
|
||||
out_len = 0;
|
||||
while (in_len != 0) {
|
||||
if (m_next_block == 0) {
|
||||
GET_DATA_8(state->predictor);
|
||||
GET_DATA_16(state->iDelta);
|
||||
|
||||
GET_DATA_16(state->samp1);
|
||||
GET_DATA_16(state->samp2);
|
||||
|
||||
state->coeff[0] = state->coeff[1] = m_coefs[0][ state->predictor ];
|
||||
|
||||
*PCMdata++ = state->samp2;
|
||||
*PCMdata++ = state->samp1;
|
||||
in_len -= 7;
|
||||
out_len += 4;
|
||||
m_next_block = m_block_size;
|
||||
continue;
|
||||
}
|
||||
|
||||
while (in_len != 0 && m_next_block != 0) {
|
||||
wxUint8 nib[2];
|
||||
|
||||
GET_DATA_8(nib[0]);
|
||||
nib[1] = (nib[0] >> 4) & 0x0f;
|
||||
nib[0] &= 0x0f;
|
||||
|
||||
Nibble(nib[0], state, &PCMdata);
|
||||
Nibble(nib[1], state, &PCMdata);
|
||||
|
||||
in_len -= 4;
|
||||
out_len += 4;
|
||||
m_next_block -= 4;
|
||||
}
|
||||
}
|
||||
|
||||
return out_len;
|
||||
|
||||
#undef GET_DATA_16
|
||||
#undef GET_DATA_8
|
||||
}
|
||||
|
||||
wxUint32 wxSoundStreamMSAdpcm::DecodeStereoADPCM(const void *in_buffer,
|
||||
void *out_buffer,
|
||||
wxUint32 in_len)
|
||||
{
|
||||
wxUint8 *ADPCMdata;
|
||||
wxInt16 *PCMdata;
|
||||
AdpcmState *state0, *state1;
|
||||
wxUint32 out_len;
|
||||
|
||||
ADPCMdata = (wxUint8 *)in_buffer;
|
||||
PCMdata = (wxInt16 *)out_buffer;
|
||||
|
||||
state0 = &m_state[0];
|
||||
state1 = &m_state[1];
|
||||
|
||||
#define GET_DATA_16(i) i = *ADPCMdata++, i |= ((wxUint32)(*ADPCMdata++) << 8)
|
||||
#define GET_DATA_8(i) i = (*ADPCMdata++)
|
||||
|
||||
out_len = 0;
|
||||
while (in_len != 0) {
|
||||
if (!m_next_block) {
|
||||
GET_DATA_8(state0->predictor);
|
||||
GET_DATA_8(state1->predictor);
|
||||
|
||||
GET_DATA_16(state0->iDelta);
|
||||
GET_DATA_16(state1->iDelta);
|
||||
|
||||
GET_DATA_16(state0->samp1);
|
||||
GET_DATA_16(state1->samp1);
|
||||
GET_DATA_16(state0->samp2);
|
||||
GET_DATA_16(state1->samp2);
|
||||
|
||||
*PCMdata++ = state0->samp2;
|
||||
*PCMdata++ = state1->samp2;
|
||||
*PCMdata++ = state0->samp1;
|
||||
*PCMdata++ = state1->samp1;
|
||||
|
||||
in_len -= 14;
|
||||
out_len += 8;
|
||||
m_next_block = m_block_size;
|
||||
continue;
|
||||
}
|
||||
|
||||
while (in_len != 0 && m_next_block > 0) {
|
||||
wxUint8 nib[2];
|
||||
|
||||
GET_DATA_8(nib[0]);
|
||||
nib[1] = (nib[0] >> 4) & 0x0f;
|
||||
nib[0] &= 0x0f;
|
||||
|
||||
Nibble(nib[0], state0, &PCMdata);
|
||||
Nibble(nib[1], state1, &PCMdata);
|
||||
|
||||
in_len -= 4;
|
||||
out_len += 4;
|
||||
m_next_block -= 4;
|
||||
}
|
||||
}
|
||||
|
||||
return out_len;
|
||||
|
||||
#undef GET_DATA_16
|
||||
#undef GET_DATA_8
|
||||
}
|
||||
|
||||
void wxSoundStreamMSAdpcm::Nibble(wxInt8 nyb,
|
||||
AdpcmState *state,
|
||||
wxInt16 **out_buffer)
|
||||
{
|
||||
wxUint32 new_delta;
|
||||
wxInt32 new_sample;
|
||||
|
||||
// First: compute the next delta value
|
||||
new_delta = (state->iDelta * gl_ADPCMcoeff_delta[nyb]) >> 8;
|
||||
// If null, minor it by 16
|
||||
if (!new_delta)
|
||||
new_delta = 16;
|
||||
|
||||
// Barycentre
|
||||
new_sample = (state->samp1 * state->coeff[0] +
|
||||
state->samp2 * state->coeff[1]) / 256;
|
||||
|
||||
// Regenerate the sign
|
||||
if (nyb & 0x08)
|
||||
nyb -= 0x10;
|
||||
|
||||
new_sample += state->iDelta * nyb;
|
||||
|
||||
// Samples must be in [-32767, 32768]
|
||||
if (new_sample < -32768)
|
||||
new_sample = -32768;
|
||||
else if (new_sample > 32767)
|
||||
new_sample = 32767;
|
||||
|
||||
state->iDelta = new_delta;
|
||||
state->samp2 = state->samp1;
|
||||
state->samp1 = new_sample;
|
||||
|
||||
*(*out_buffer)++ = new_sample;
|
||||
}
|
||||
|
||||
wxSoundStream& wxSoundStreamMSAdpcm::Write(const void *buffer, wxUint32 len)
|
||||
{
|
||||
wxInt16 delta;
|
||||
wxUint8 ADPCMdata;
|
||||
wxUint16 *PCMdata;
|
||||
wxInt16 coeff1, coeff2;
|
||||
wxUint8 *out_buf;
|
||||
wxUint32 new_len;
|
||||
|
||||
#define GET_DATA_16 (*ADPCMdata++ | ((wxUint32)(*ADPCMdata++) << 8);
|
||||
#define GET_DATA_8 (*ADPCMdata++)
|
||||
|
||||
if (!m_got_header) {
|
||||
i_predict = GET_DATA_8;
|
||||
delta = GET_DATA_16;
|
||||
samp1 = GET_DATA_16;
|
||||
PCMdata = GET_DATA_16;
|
||||
len -= 3*2 + 1;
|
||||
m_got_header = TRUE;
|
||||
// TODO: prealloc the output buffer
|
||||
out_buf = new wxUint8[len*2];
|
||||
|
||||
coeff1 = gl_ADPCMcoeff_1[i_predict];
|
||||
coeff2 = gl_ADPCMcoeff_2[i_predict];
|
||||
}
|
||||
if (!m_stereo)
|
||||
new_len = DecodeMonoADPCM(buffer, out_buf, len);
|
||||
else
|
||||
new_len = DecodeStereoADPCM(buffer, out_buf, len);
|
||||
|
||||
m_router->Write(out_buf, new_len);
|
||||
|
||||
m_lastcount = len;
|
||||
m_snderror = wxSOUND_NOERROR;
|
||||
|
||||
delete[] out_buf;
|
||||
|
||||
while (len > 0) {
|
||||
nyb1 = GET_DATA_8;
|
||||
nyb0 = (nyb1 & 0xf0) >> 4;
|
||||
nyb1 &= 0x0f;
|
||||
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -143,23 +352,36 @@ wxUint32 wxSoundStreamMSAdpcm::GetBestSize() const
|
||||
|
||||
bool wxSoundStreamMSAdpcm::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
{
|
||||
if (format.GetType() != wxSOUND_ULAW) {
|
||||
if (format.GetType() != wxSOUND_MSADPCM) {
|
||||
m_snderror = wxSOUND_INVFRMT;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
wxSoundFormatPcm pcm;
|
||||
wxSoundFormatUlaw *ulaw;
|
||||
wxSoundFormatMSAdpcm *adpcm;
|
||||
wxUint16 ncoefs, coefs_len;
|
||||
|
||||
wxSoundStreamCodec::SetSoundFormat(format);
|
||||
|
||||
ulaw = (wxSoundFormatMSAdpcm *)m_sndformat;
|
||||
adpcm = (wxSoundFormatMSAdpcm *)m_sndformat;
|
||||
|
||||
adpcm->GetCoefs(m_coefs, ncoefs, coefs_len);
|
||||
|
||||
if (!ncoefs) {
|
||||
wxLogError(__FILE__ ":%d: Number of ADPCM coefficients"
|
||||
" must be non null", __LINE__);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pcm.SetSampleRate(adpcm->GetSampleRate());
|
||||
pcm.SetBPS(16);
|
||||
pcm.SetChannels(adpcm->GetChannels());
|
||||
pcm.Signed(TRUE);
|
||||
pcm.SetOrder(wxBYTE_ORDER);
|
||||
|
||||
m_stereo = (adpcm->GetChannels() == 2);
|
||||
m_block_size = adpcm->GetBlockSize();
|
||||
m_next_block = 0;
|
||||
|
||||
m_router->SetSoundFormat(pcm);
|
||||
|
||||
|
@@ -163,8 +163,9 @@ bool wxSoundStreamUlaw::SetSoundFormat(const wxSoundFormatBase& format)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// As the codec only support 16 bits, Mono we must use a wxSoundRouter to filter the data and
|
||||
// to translate them to a format supported by the sound card.
|
||||
// As the codec only support 16 bits, Mono we must use a wxSoundRouter
|
||||
// to filter the data and to translate them to a format supported
|
||||
// by the sound card.
|
||||
|
||||
wxSoundFormatPcm pcm;
|
||||
wxSoundFormatUlaw *ulaw;
|
||||
|
@@ -29,6 +29,7 @@
|
||||
#include "wx/mmedia/sndfile.h"
|
||||
#include "wx/mmedia/sndpcm.h"
|
||||
#include "wx/mmedia/sndg72x.h"
|
||||
#include "wx/mmedia/sndmsad.h"
|
||||
#include "wx/mmedia/sndwav.h"
|
||||
|
||||
#define BUILD_SIGNATURE(a,b,c,d) (((wxUint32)a) | (((wxUint32)b) << 8) | (((wxUint32)c) << 16) | (((wxUint32)d) << 24))
|
||||
@@ -97,7 +98,8 @@ bool wxSoundWave::CanRead()
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxSoundWave::HandleOutputPCM(wxDataInputStream& data, wxUint16 channels,
|
||||
bool wxSoundWave::HandleOutputPCM(wxDataInputStream& data, wxUint32 len,
|
||||
wxUint16 channels,
|
||||
wxUint32 sample_fq, wxUint32 byte_p_sec,
|
||||
wxUint16 byte_p_spl, wxUint16 bits_p_spl)
|
||||
{
|
||||
@@ -112,10 +114,53 @@ bool wxSoundWave::HandleOutputPCM(wxDataInputStream& data, wxUint16 channels,
|
||||
if (!SetSoundFormat(sndformat))
|
||||
return FALSE;
|
||||
|
||||
m_input->SeekI(len, wxFromCurrent);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxSoundWave::HandleOutputG721(wxDataInputStream& data, wxUint16 channels,
|
||||
bool wxSoundWave::HandleOutputMSADPCM(wxDataInputStream& data, wxUint32 len,
|
||||
wxUint16 channels,
|
||||
wxUint32 sample_fq, wxUint32 byte_p_sec,
|
||||
wxUint16 byte_p_spl, wxUint16 bits_p_spl)
|
||||
{
|
||||
wxSoundFormatMSAdpcm sndformat;
|
||||
wxInt16 *coefs[2];
|
||||
wxUint16 coefs_len, i;
|
||||
wxUint16 block_size;
|
||||
|
||||
sndformat.SetSampleRate(sample_fq);
|
||||
sndformat.SetChannels(channels);
|
||||
|
||||
block_size = data.Read16();
|
||||
coefs_len = data.Read16();
|
||||
|
||||
coefs[0] = new wxInt16[coefs_len];
|
||||
coefs[1] = new wxInt16[coefs_len];
|
||||
|
||||
for (i=0;i<coefs_len;i++) {
|
||||
coefs[0][i] = data.Read16();
|
||||
coefs[1][i] = data.Read16();
|
||||
}
|
||||
|
||||
sndformat.SetCoefs(coefs, 2, coefs_len);
|
||||
sndformat.SetBlockSize(block_size);
|
||||
|
||||
delete[] coefs[0];
|
||||
delete[] coefs[1];
|
||||
|
||||
if (!SetSoundFormat(sndformat))
|
||||
return FALSE;
|
||||
|
||||
len -= coefs_len*4 + 4;
|
||||
|
||||
m_input->SeekI(len, wxFromCurrent);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxSoundWave::HandleOutputG721(wxDataInputStream& data, wxUint32 len,
|
||||
wxUint16 channels,
|
||||
wxUint32 sample_fq, wxUint32 byte_p_sec,
|
||||
wxUint16 byte_p_spl, wxUint16 bits_p_spl)
|
||||
{
|
||||
@@ -127,6 +172,8 @@ bool wxSoundWave::HandleOutputG721(wxDataInputStream& data, wxUint16 channels,
|
||||
if (!SetSoundFormat(sndformat))
|
||||
return FALSE;
|
||||
|
||||
m_input->SeekI(len, wxFromCurrent);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -173,16 +220,27 @@ bool wxSoundWave::PrepareToPlay()
|
||||
// Get the common parameters
|
||||
data >> format >> channels >> sample_fq
|
||||
>> byte_p_sec >> byte_p_spl >> bits_p_spl;
|
||||
len -= 16;
|
||||
|
||||
switch (format) {
|
||||
case 0x01: // PCM
|
||||
if (!HandleOutputPCM(data, channels, sample_fq,
|
||||
byte_p_sec, byte_p_spl, bits_p_spl))
|
||||
if (!HandleOutputPCM(data, len, channels, sample_fq,
|
||||
byte_p_sec, byte_p_spl,
|
||||
bits_p_spl))
|
||||
return FALSE;
|
||||
break;
|
||||
case 0x02: // MS ADPCM
|
||||
if (!HandleOutputMSADPCM(data, len,
|
||||
channels, sample_fq,
|
||||
byte_p_sec, byte_p_spl,
|
||||
bits_p_spl))
|
||||
return FALSE;
|
||||
break;
|
||||
case 0x40: // G721
|
||||
if (!HandleOutputG721(data, channels, sample_fq,
|
||||
byte_p_sec, byte_p_spl, bits_p_spl))
|
||||
if (!HandleOutputG721(data, len,
|
||||
channels, sample_fq,
|
||||
byte_p_sec, byte_p_spl,
|
||||
bits_p_spl))
|
||||
return FALSE;
|
||||
break;
|
||||
default:
|
||||
|
@@ -98,8 +98,11 @@ wxSoundStreamWin::wxSoundStreamWin()
|
||||
|
||||
m_waiting_for = FALSE;
|
||||
|
||||
if (!OpenDevice(wxSOUND_OUTPUT))
|
||||
return;
|
||||
if (!OpenDevice(wxSOUND_OUTPUT)) {
|
||||
m_snderror = wxSOUND_NOERROR; //next call to OpenDevice won't do this
|
||||
if (!OpenDevice(wxSOUND_INPUT))
|
||||
return;
|
||||
}
|
||||
|
||||
CloseDevice();
|
||||
}
|
||||
|
@@ -503,7 +503,8 @@ bool wxVideoXANIM::RestartXANIM()
|
||||
m_video_output->SetSize(vibrato_size);
|
||||
vibrato_size.SetWidth(vibrato_size.GetWidth()-1);
|
||||
m_video_output->SetSize(vibrato_size);
|
||||
// Very useful ! Actually it sends a SETSIZE event to XAnim
|
||||
// Very useful ! Actually it "should" sends a SETSIZE event to XAnim
|
||||
// FIXME: This event is not sent !!
|
||||
|
||||
m_paused = FALSE;
|
||||
|
||||
|
@@ -1,7 +1,8 @@
|
||||
#
|
||||
# $Id$
|
||||
|
||||
top_srcdir = @top_srcdir@
|
||||
top_srcdir = @top_srcdir@/..
|
||||
top_builddir = ../../..
|
||||
libsrc_dir = contrib/src/ogl
|
||||
|
||||
TARGET_LIBNAME=libogl
|
||||
|
||||
@@ -9,14 +10,17 @@ LIBVERSION_CURRENT=1
|
||||
LIBVERSION_REVISION=0
|
||||
LIBVERSION_AGE=0
|
||||
|
||||
OBJECTS=basic.o bmpshape.o composit.o divided.o lines.o misc.o \
|
||||
basic2.o canvas.o constrnt.o drawn.o mfutils.o ogldiag.o
|
||||
HEADER_PATH=$(top_srcdir)/contrib/include/wx
|
||||
HEADER_SUBDIR=ogl
|
||||
|
||||
# the comment at the end of the next line is needed because otherwise autoconf
|
||||
# would remove this line completely - it contains a built-in hack to remove
|
||||
# any VPATH assignment not containing ':'
|
||||
VPATH = :$(top_srcdir)/src/ogl # ':' for autoconf
|
||||
HEADERS=basic.h basicp.h bmpshape.h canvas.h composit.h constrnt.h \
|
||||
divided.h drawn.h drawnp.h lines.h linesp.h mfutils.h misc.h \
|
||||
ogl.h ogldiag.h
|
||||
|
||||
APPEXTRADEFS=-I$(top_srcdir)/include
|
||||
OBJECTS=basic.o bmpshape.o composit.o divided.o lines.o misc.o \
|
||||
basic2.o canvas.o constrnt.o drawn.o mfutils.o ogldiag.o
|
||||
|
||||
APPEXTRADEFS=-I$(top_srcdir)/contrib/include
|
||||
|
||||
include $(top_builddir)/src/makelib.env
|
||||
|
||||
|
@@ -132,7 +132,8 @@ DOCSOURCES=$(LOCALDOCDIR)\ogl.tex \
|
||||
$(LOCALDOCDIR)\topics.tex $(LOCALDOCDIR)\sample.tex
|
||||
|
||||
html: $(DOCDIR)\html\ogl\ogl.htm
|
||||
htmlhelp: $(DOCDIR)\html\ogl\ogl.chm
|
||||
htmlhelp: $(DOCDIR)\htmlhelp\ogl.chm
|
||||
htb: $(DOCDIR)\htb\ogl.htb
|
||||
hlp: $(DOCDIR)\winhelp\ogl.hlp
|
||||
pdfrtf: $(DOCDIR)\pdf\ogl.rtf
|
||||
ps: $(DOCDIR)\ps\ogl.ps
|
||||
@@ -166,16 +167,27 @@ $(DOCDIR)\html\ogl\ogl.htm: $(DOCSOURCES)
|
||||
copy *.gif $(DOCDIR)\html\ogl
|
||||
-start $(WAITFLAG) tex2rtf $(LOCALDOCDIR)\ogl.tex $(DOCDIR)\html\ogl\ogl.htm -twice -html
|
||||
-erase $(DOCDIR)\html\ogl\*.con
|
||||
-erase *.con
|
||||
-erase *.con
|
||||
-erase $(DOCDIR)\html\ogl\*.ref
|
||||
cd $(THISDIR)
|
||||
|
||||
|
||||
$(DOCDIR)\html\ogl\ogl.chm: $(DOCDIR)\html\ogl\ogl.htm $(DOCDIR)\html\ogl\ogl.hhp
|
||||
$(DOCDIR)\htmlhelp\ogl.chm: $(DOCDIR)\html\ogl\ogl.htm $(DOCDIR)\html\ogl\ogl.hhp
|
||||
cd $(DOCDIR)\html\ogl
|
||||
-hhc ogl.hhp
|
||||
move ogl.chm $(DOCDIR)\htmlhelp\ogl.chm
|
||||
cd $(THISDIR)
|
||||
|
||||
# An htb file is a zip file containing the .htm, .gif, .hhp, .hhc and .hhk
|
||||
# files, renamed to htb.
|
||||
# This can then be used with e.g. helpview.
|
||||
# Optionally, a cached version of the .hhp file can be generated with hhp2cached.
|
||||
$(DOCDIR)\htb\ogl.htb: $(DOCDIR)\html\ogl\ogl.htm
|
||||
cd $(DOCDIR)\html\ogl
|
||||
-erase /Y ogl.zip ogl.htb
|
||||
zip32 ogl.zip *.htm *.gif *.hhp *.hhc *.hhk
|
||||
-mkdir $(DOCDIR)\htb
|
||||
move ogl.zip $(DOCDIR)\htb\ogl.htb
|
||||
cd $(THISDIR)
|
||||
|
||||
$(LOCALDOCDIR)\ogl.dvi: $(DOCSOURCES)
|
||||
cd $(LOCALDOCDIR)
|
||||
@@ -193,4 +205,3 @@ $(WXDIR)\docs\ps\ogl.ps: $(LOCALDOCDIR)\ogl.dvi
|
||||
move ogl.ps $(WXDIR)\docs\ps\ogl.ps
|
||||
cd $(THISDIR)
|
||||
|
||||
|
||||
|
@@ -5,12 +5,11 @@
|
||||
# Version: $Id$
|
||||
###############################################################################
|
||||
|
||||
top_srcdir = @top_srcdir@
|
||||
top_srcdir = @top_srcdir@/..
|
||||
top_builddir = ../../..
|
||||
|
||||
this_dir = $(top_srcdir)/src/stc
|
||||
scintilla_dir=$(this_dir)/scintilla
|
||||
VPATH=$(this_dir)@PATH_IFS@$(scintilla_dir)/src # ':' for autoconf
|
||||
scintilla_dir = $(top_srcdir)/contrib/src/stc/scintilla
|
||||
libsrc_dir = contrib/src/stc@PATH_IFS@$(scintilla_dir)/src
|
||||
|
||||
TARGET_LIBNAME=libstc
|
||||
|
||||
@@ -18,23 +17,38 @@ 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 \
|
||||
Accessor.o \
|
||||
AutoComplete.o \
|
||||
DocumentAccessor.o \
|
||||
LexCPP.o \
|
||||
LexHTML.o \
|
||||
LexOthers.o \
|
||||
LexPerl.o \
|
||||
LexPython.o \
|
||||
LexSQL.o \
|
||||
LexVB.o \
|
||||
UniConversion.o \
|
||||
WindowAccessor.o \
|
||||
AutoComplete.o \
|
||||
CallTip.o \
|
||||
CellBuffer.o \
|
||||
ContractionState.o \
|
||||
CellBuffer.o \
|
||||
ContractionState.o \
|
||||
Document.o \
|
||||
Editor.o \
|
||||
Editor.o \
|
||||
Indicator.o \
|
||||
KeyMap.o \
|
||||
KeyMap.o \
|
||||
KeyWords.o \
|
||||
LineMarker.o \
|
||||
LineMarker.o \
|
||||
PropSet.o \
|
||||
ScintillaBase.o \
|
||||
ScintillaBase.o \
|
||||
Style.o \
|
||||
ViewStyle.o
|
||||
|
||||
APPEXTRADEFS=-D__WX__ -DSCI_LEXER -I$(scintilla_dir)/src -I$(scintilla_dir)/include -I$(top_srcdir)/include
|
||||
ViewStyle.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
|
||||
|
@@ -4,12 +4,13 @@
|
||||
// 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"
|
||||
|
||||
Point Point::FromLong(long lpoint) {
|
||||
return Point(lpoint & 0xFFFF, lpoint >> 32);
|
||||
return Point(lpoint & 0xFFFF, lpoint >> 16);
|
||||
}
|
||||
|
||||
wxRect wxRectFromPRectangle(PRectangle prc) {
|
||||
@@ -105,14 +106,15 @@ Font::Font() {
|
||||
Font::~Font() {
|
||||
}
|
||||
|
||||
void Font::Create(const char *faceName, int size, bool bold, bool italic) {
|
||||
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);
|
||||
faceName,
|
||||
wxFONTENCODING_DEFAULT);
|
||||
}
|
||||
|
||||
|
||||
@@ -167,7 +169,7 @@ void Surface::InitPixMap(int width, int height, Surface *surface_) {
|
||||
Release();
|
||||
hdc = new wxMemoryDC(surface_->hdc);
|
||||
hdcOwned = true;
|
||||
bitmap = new wxBitmap(width, height);
|
||||
bitmap = new wxBitmap(width, height+1);
|
||||
((wxMemoryDC*)hdc)->SelectObject(*bitmap);
|
||||
// **** ::SetTextAlign(hdc, TA_BASELINE);
|
||||
}
|
||||
@@ -181,13 +183,26 @@ void Surface::BrushColor(Colour back) {
|
||||
}
|
||||
|
||||
void Surface::SetFont(Font &font_) {
|
||||
hdc->SetFont(*font_.GetID());
|
||||
|
||||
// I think the following check is valid.
|
||||
// It eliminates a crash for me. -- eric@sourcegear.com
|
||||
|
||||
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_;
|
||||
@@ -232,7 +247,7 @@ void Surface::FillRectangle(PRectangle rc, Surface &surfacePattern) {
|
||||
void Surface::RoundedRectangle(PRectangle rc, Colour fore, Colour back) {
|
||||
PenColour(fore);
|
||||
BrushColor(back);
|
||||
hdc->DrawRoundedRectangle(wxRectFromPRectangle(rc), 8);
|
||||
hdc->DrawRoundedRectangle(wxRectFromPRectangle(rc), 4);
|
||||
}
|
||||
|
||||
void Surface::Ellipse(PRectangle rc, Colour fore, Colour back) {
|
||||
@@ -242,7 +257,8 @@ void Surface::Ellipse(PRectangle rc, Colour fore, Colour back) {
|
||||
}
|
||||
|
||||
void Surface::Copy(PRectangle rc, Point from, Surface &surfaceSource) {
|
||||
hdc->Blit(rc.left, rc.top, rc.Width(), rc.Height(),
|
||||
wxRect r = wxRectFromPRectangle(rc);
|
||||
hdc->Blit(r.x, r.y, r.width, r.height,
|
||||
surfaceSource.hdc, from.x, from.y, wxCOPY);
|
||||
}
|
||||
|
||||
@@ -344,7 +360,11 @@ void Surface::SetClip(PRectangle rc) {
|
||||
hdc->SetClippingRegion(wxRectFromPRectangle(rc));
|
||||
}
|
||||
|
||||
|
||||
void Surface::FlushCachedState() {
|
||||
// TODO Is there anything we need to do here? eric@sourcegear.com
|
||||
// TODO I had to add this method when I merged new Scintilla code
|
||||
// TODO from Neil.
|
||||
}
|
||||
|
||||
Window::~Window() {
|
||||
}
|
||||
@@ -365,7 +385,8 @@ PRectangle Window::GetPosition() {
|
||||
}
|
||||
|
||||
void Window::SetPosition(PRectangle rc) {
|
||||
id->SetSize(rc.left, rc.top, rc.Width(), rc.Height());
|
||||
wxRect r = wxRectFromPRectangle(rc);
|
||||
id->SetSize(r);
|
||||
}
|
||||
|
||||
void Window::SetPositionRelative(PRectangle rc, Window) {
|
||||
@@ -386,7 +407,8 @@ void Window::InvalidateAll() {
|
||||
}
|
||||
|
||||
void Window::InvalidateRectangle(PRectangle rc) {
|
||||
id->Refresh(false, &wxRectFromPRectangle(rc));
|
||||
wxRect r = wxRectFromPRectangle(rc);
|
||||
id->Refresh(false, &r);
|
||||
}
|
||||
|
||||
void Window::SetFont(Font &font) {
|
||||
@@ -465,7 +487,12 @@ int ListBox::GetSelection() {
|
||||
}
|
||||
|
||||
int ListBox::Find(const char *prefix) {
|
||||
return ((wxListBox*)id)->FindString(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) {
|
||||
|
@@ -14,6 +14,8 @@
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#include "ScintillaWX.h"
|
||||
#include "wx/stc/stc.h"
|
||||
|
||||
@@ -60,6 +62,29 @@ void wxSTCDropTarget::OnLeave() {
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
@@ -193,9 +218,8 @@ void ScintillaWX::NotifyParent(SCNotification scn) {
|
||||
void ScintillaWX::Copy() {
|
||||
if (currentPos != anchor) {
|
||||
char* text = CopySelectionRange();
|
||||
textDO.SetText(text);
|
||||
wxTheClipboard->Open();
|
||||
wxTheClipboard->SetData(&textDO);
|
||||
wxTheClipboard->SetData(new wxTextDataObject(text));
|
||||
wxTheClipboard->Close();
|
||||
}
|
||||
}
|
||||
@@ -236,7 +260,7 @@ bool ScintillaWX::CanPaste() {
|
||||
}
|
||||
|
||||
void ScintillaWX::CreateCallTipWindow(PRectangle) {
|
||||
ct.wCallTip = new wxWindow(wDraw.GetID(), -1);
|
||||
ct.wCallTip = new wxSTCCallTip(wDraw.GetID(), -1, &ct);
|
||||
ct.wDraw = ct.wCallTip;
|
||||
}
|
||||
|
||||
@@ -384,7 +408,10 @@ void ScintillaWX::DoButtonMove(Point 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) {
|
||||
@@ -401,6 +428,9 @@ void ScintillaWX::DoContextMenu(Point pt) {
|
||||
ContextMenu(pt);
|
||||
}
|
||||
|
||||
void ScintillaWX::DoOnListBox() {
|
||||
AutoCompleteCompleted();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
@@ -433,12 +463,13 @@ void ScintillaWX::DoDragLeave() {
|
||||
// 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();
|
||||
// rcPaint = GetTextRectangle();
|
||||
// wxClientDC dc(wMain.GetID());
|
||||
// Surface surfaceWindow;
|
||||
// surfaceWindow.Init(&dc);
|
||||
// Paint(&surfaceWindow, rcPaint);
|
||||
// surfaceWindow.Release();
|
||||
wMain.GetID()->Refresh(FALSE);
|
||||
paintState = notPainting;
|
||||
}
|
||||
|
||||
|
@@ -126,6 +126,7 @@ public:
|
||||
|
||||
void DoCommand(int ID);
|
||||
void DoContextMenu(Point pt);
|
||||
void DoOnListBox();
|
||||
|
||||
|
||||
// helpers
|
||||
@@ -139,7 +140,6 @@ private:
|
||||
bool capturedMouse;
|
||||
wxStyledTextCtrl* stc;
|
||||
|
||||
wxTextDataObject textDO;
|
||||
wxSTCDropTarget* dropTarget;
|
||||
wxDragResult dragResult;
|
||||
};
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# Microsoft Developer Studio Project File - Name="StcVC" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
@@ -22,11 +22,9 @@ CFG=StcVC - Win32 Debug
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "StcVC - Win32 Release"
|
||||
|
||||
@@ -40,11 +38,12 @@ RSC=rc.exe
|
||||
# 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
|
||||
# ADD BASE RSC /l 0x809
|
||||
# ADD RSC /l 0x809
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
@@ -64,11 +63,12 @@ LIB32=link.exe -lib
|
||||
# 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
|
||||
# ADD BASE RSC /l 0x809
|
||||
# ADD RSC /l 0x809
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
@@ -179,6 +179,34 @@ 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
|
||||
|
@@ -2,7 +2,7 @@
|
||||
# File: makefile.b32
|
||||
# Author: Julian Smart
|
||||
# Created: 1999
|
||||
# Updated:
|
||||
# Updated:
|
||||
# Copyright:
|
||||
#
|
||||
# Makefile : Builds wxMMedia library for 32-bit BC++
|
||||
@@ -21,25 +21,36 @@ STCEXTRACPPFLAGS=-D__WX__ -DSCI_LEXER -I$(SCINTILLA)/include -I$(S)
|
||||
LIBTARGET=$(WXDIR)\contrib\lib\stc.lib
|
||||
|
||||
OBJECTS = \
|
||||
Accessor.obj \
|
||||
Accessor.obj \
|
||||
AutoComplete.obj \
|
||||
CallTip.obj \
|
||||
CellBuffer.obj \
|
||||
ContractionState.obj\
|
||||
Document.obj \
|
||||
CallTip.obj \
|
||||
CellBuffer.obj \
|
||||
ContractionState.obj \
|
||||
Document.obj \
|
||||
DocumentAccessor.obj \
|
||||
Editor.obj \
|
||||
Indicator.obj \
|
||||
Indicator.obj \
|
||||
KeyMap.obj \
|
||||
KeyWords.obj \
|
||||
LineMarker.obj \
|
||||
PropSet.obj \
|
||||
KeyWords.obj \
|
||||
LexCPP.obj \
|
||||
LexHTML.obj \
|
||||
LexOthers.obj \
|
||||
LexPerl.obj \
|
||||
LexPython.obj \
|
||||
LexSQL.obj \
|
||||
LexVB.obj \
|
||||
LineMarker.obj \
|
||||
PropSet.obj \
|
||||
ScintillaBase.obj \
|
||||
Style.obj \
|
||||
ViewStyle.obj \
|
||||
UniConversion.obj \
|
||||
ViewStyle.obj \
|
||||
WindowAccessor.obj \
|
||||
\
|
||||
PlatWX.obj \
|
||||
ScintillaWX.obj \
|
||||
stc.obj \
|
||||
ScintillaWX.obj \
|
||||
stc.obj \
|
||||
|
||||
|
||||
!include $(WXDIR)\src\makelib.b32
|
||||
|
||||
|
@@ -25,6 +25,16 @@ OBJECTS = \
|
||||
$(S)/ScintillaBase.$(OBJSUFF) \
|
||||
$(S)/Style.$(OBJSUFF) \
|
||||
$(S)/ViewStyle.$(OBJSUFF) \
|
||||
$(S)/LexCPP.$(OBJSUFF) \
|
||||
$(S)/LexHTML.$(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) \
|
||||
PlatWX.$(OBJSUFF) \
|
||||
ScintillaWX.$(OBJSUFF) \
|
||||
stc.$(OBJSUFF)
|
||||
|
@@ -15,21 +15,30 @@ NOPCH=1
|
||||
!include $(WXDIR)\src\makevc.env
|
||||
|
||||
OBJECTS = \
|
||||
$(D)\Accessor.obj \
|
||||
$(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)\LexOthers.obj \
|
||||
$(D)\LexPerl.obj \
|
||||
$(D)\LexPython.obj \
|
||||
$(D)\LexSQL.obj \
|
||||
$(D)\LexVB.obj \
|
||||
$(D)\LineMarker.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 \
|
||||
|
@@ -3,5 +3,6 @@ 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 somewhere between 1.22
|
||||
and 1.23, (from their CVS.)
|
||||
The current version of the Scintilla code is 1.25+ (from their CVS on
|
||||
5-19-2000).
|
||||
|
||||
|
@@ -3,26 +3,30 @@
|
||||
// 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:
|
||||
// bufferSize is a trade off between time taken to copy the characters and SendMessage overhead
|
||||
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];
|
||||
WindowID id;
|
||||
PropSet &props;
|
||||
int startPos;
|
||||
int endPos;
|
||||
int lenDoc;
|
||||
int offset; // Optional but including an offset makes GCC generate better code
|
||||
void Fill(int position);
|
||||
int codePage;
|
||||
|
||||
virtual bool InternalIsLeadByte(char ch)=0;
|
||||
virtual void Fill(int position)=0;
|
||||
public:
|
||||
Accessor(WindowID id_, PropSet &props_, int offset_=0) :
|
||||
id(id_), props(props_), startPos(0x7FFFFFFF), endPos(0),
|
||||
lenDoc(-1), offset(offset_) {
|
||||
}
|
||||
Accessor() : startPos(extremePosition), endPos(0), codePage(0) {}
|
||||
virtual ~Accessor() {}
|
||||
char operator[](int position) {
|
||||
position += offset;
|
||||
if (position < startPos || position >= endPos) {
|
||||
Fill(position);
|
||||
}
|
||||
@@ -30,7 +34,6 @@ public:
|
||||
}
|
||||
char SafeGetCharAt(int position, char chDefault=' ') {
|
||||
// Safe version of operator[], returning a defined value for invalid position
|
||||
position += offset;
|
||||
if (position < startPos || position >= endPos) {
|
||||
Fill(position);
|
||||
if (position < startPos || position >= endPos) {
|
||||
@@ -40,37 +43,28 @@ public:
|
||||
}
|
||||
return buf[position - startPos];
|
||||
}
|
||||
char StyleAt(int position);
|
||||
int GetLine(int position);
|
||||
int LineStart(int line);
|
||||
int LevelAt(int line);
|
||||
int Length();
|
||||
void Flush() {
|
||||
startPos = 0x7FFFFFFF;
|
||||
lenDoc = -1;
|
||||
bool IsLeadByte(char ch) {
|
||||
return codePage && InternalIsLeadByte(ch);
|
||||
}
|
||||
int GetLineState(int line);
|
||||
int SetLineState(int line, int state);
|
||||
PropSet &GetPropSet() { return props; }
|
||||
};
|
||||
|
||||
class StylingContext : public Accessor {
|
||||
char styleBuf[bufferSize];
|
||||
int validLen;
|
||||
char chFlags;
|
||||
char chWhile;
|
||||
unsigned int startSeg;
|
||||
public:
|
||||
StylingContext(WindowID id_, PropSet &props_, int offset_=0) :
|
||||
Accessor(id_,props_,offset_), validLen(0), chFlags(0) {}
|
||||
void StartAt(unsigned int start, char chMask=31);
|
||||
void SetFlags(char chFlags_, char chWhile_) {chFlags = chFlags_; chWhile = chWhile_; };
|
||||
void ColourSegment(unsigned int start, unsigned int end, int chAttr);
|
||||
unsigned int GetStartSegment() { return startSeg; }
|
||||
void StartSegment(unsigned int pos);
|
||||
void ColourTo(unsigned int pos, int chAttr);
|
||||
int GetLine(int position);
|
||||
void SetLevel(int line, int level);
|
||||
void Flush();
|
||||
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;
|
||||
};
|
||||
|
||||
|
@@ -3,6 +3,39 @@
|
||||
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
void ColouriseDoc(int codePage, int startPos, int lengthDoc, int initStyle,
|
||||
int language, WordList *keywordlists[], StylingContext &styler);
|
||||
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;
|
||||
}
|
||||
|
||||
|
@@ -45,6 +45,7 @@
|
||||
#pragma warning(disable: 4800 4244 4309)
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <richedit.h>
|
||||
#endif
|
||||
|
||||
@@ -209,16 +210,19 @@ public:
|
||||
Font();
|
||||
~Font();
|
||||
|
||||
void Create(const char *faceName, int size, bool bold=false, bool italic=false);
|
||||
void Create(const char *faceName, int characterSet, int size, bool bold, bool italic);
|
||||
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;
|
||||
@@ -266,6 +270,7 @@ public:
|
||||
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);
|
||||
@@ -290,6 +295,11 @@ public:
|
||||
|
||||
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
|
||||
@@ -300,6 +310,7 @@ protected:
|
||||
WindowID id;
|
||||
public:
|
||||
Window() : id(0) {}
|
||||
Window(const Window &source) : id(source.id) {}
|
||||
virtual ~Window();
|
||||
Window &operator=(WindowID id_) {
|
||||
id = id_;
|
||||
|
@@ -75,7 +75,7 @@ public:
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
char operator[](int i) {
|
||||
char operator[](int i) const {
|
||||
if (s)
|
||||
return s[i];
|
||||
else
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
int value() {
|
||||
int value() const {
|
||||
if (s)
|
||||
return atoi(s);
|
||||
else
|
||||
@@ -168,7 +168,7 @@ public:
|
||||
WordList(bool onlyLineEnds_ = false) :
|
||||
words(0), list(0), len(0), onlyLineEnds(onlyLineEnds_) {}
|
||||
~WordList() { Clear(); }
|
||||
operator bool() { return list; }
|
||||
operator bool() { return list ? true : false; }
|
||||
const char *operator[](int ind) { return words[ind]; }
|
||||
void Clear();
|
||||
void Set(const char *s);
|
||||
|
@@ -21,6 +21,8 @@
|
||||
#define SCLEX_ERRORLIST 10
|
||||
#define SCLEX_MAKEFILE 11
|
||||
#define SCLEX_BATCH 12
|
||||
#define SCLEX_XCODE 13
|
||||
#define SCLEX_LATEX 14
|
||||
|
||||
// Lexical states for SCLEX_PYTHON
|
||||
#define SCE_P_DEFAULT 0
|
||||
@@ -35,6 +37,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
|
||||
|
||||
// Lexical states for SCLEX_CPP, SCLEX_VB
|
||||
#define SCE_C_DEFAULT 0
|
||||
@@ -45,7 +49,7 @@
|
||||
#define SCE_C_WORD 5
|
||||
#define SCE_C_STRING 6
|
||||
#define SCE_C_CHARACTER 7
|
||||
#define SCE_C_PUNTUATION 8
|
||||
#define SCE_C_UUID 8
|
||||
#define SCE_C_PREPROCESSOR 9
|
||||
#define SCE_C_OPERATOR 10
|
||||
#define SCE_C_IDENTIFIER 11
|
||||
@@ -63,49 +67,85 @@
|
||||
#define SCE_H_OTHER 8
|
||||
#define SCE_H_COMMENT 9
|
||||
#define SCE_H_ENTITY 10
|
||||
// Embedded Javascript
|
||||
#define SCE_HJ_START 11
|
||||
#define SCE_HJ_DEFAULT 12
|
||||
#define SCE_HJ_COMMENT 13
|
||||
#define SCE_HJ_COMMENTLINE 14
|
||||
#define SCE_HJ_COMMENTDOC 15
|
||||
#define SCE_HJ_NUMBER 16
|
||||
#define SCE_HJ_WORD 17
|
||||
#define SCE_HJ_KEYWORD 18
|
||||
#define SCE_HJ_DOUBLESTRING 19
|
||||
#define SCE_HJ_SINGLESTRING 20
|
||||
#define SCE_HJ_SYMBOLS 21
|
||||
#define SCE_HJ_STRINGEOL 28
|
||||
// XML and ASP
|
||||
#define SCE_H_TAGEND 22
|
||||
#define SCE_H_XMLSTART 23
|
||||
#define SCE_H_XMLEND 24
|
||||
#define SCE_H_SCRIPT 25
|
||||
#define SCE_H_ASP 26
|
||||
#define SCE_H_ASPAT 27
|
||||
#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
|
||||
// Embedded Javascript
|
||||
#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
|
||||
// ASP Javascript
|
||||
#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
|
||||
// Embedded VBScript
|
||||
#define SCE_HB_START 40
|
||||
#define SCE_HB_DEFAULT 41
|
||||
#define SCE_HB_COMMENTLINE 42
|
||||
#define SCE_HB_NUMBER 43
|
||||
#define SCE_HB_WORD 44
|
||||
#define SCE_HB_STRING 45
|
||||
#define SCE_HB_IDENTIFIER 46
|
||||
#define SCE_HB_STRINGEOL 47
|
||||
#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
|
||||
// ASP VBScript
|
||||
#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
|
||||
// Embedded Python
|
||||
#define SCE_HP_START 50
|
||||
#define SCE_HP_DEFAULT 51
|
||||
#define SCE_HP_COMMENTLINE 52
|
||||
#define SCE_HP_NUMBER 53
|
||||
#define SCE_HP_STRING 54
|
||||
#define SCE_HP_CHARACTER 55
|
||||
#define SCE_HP_WORD 56
|
||||
#define SCE_HP_TRIPLE 57
|
||||
#define SCE_HP_TRIPLEDOUBLE 58
|
||||
#define SCE_HP_CLASSNAME 59
|
||||
#define SCE_HP_DEFNAME 60
|
||||
#define SCE_HP_OPERATOR 61
|
||||
#define SCE_HP_IDENTIFIER 62
|
||||
#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
|
||||
// ASP Python
|
||||
#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
|
||||
|
||||
// Lexical states for SCLEX_PERL
|
||||
#define SCE_PL_DEFAULT 0
|
||||
@@ -131,4 +171,11 @@
|
||||
#define SCE_PL_BACKTICKS 20
|
||||
#define SCE_PL_DATASECTION 21
|
||||
|
||||
// Lexical states for SCLEX_LATEX
|
||||
#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
|
||||
|
||||
#endif
|
||||
|
@@ -89,7 +89,6 @@ extern "C" {
|
||||
|
||||
#define SCI_GETVIEWWS SCI_START + 20
|
||||
#define SCI_SETVIEWWS SCI_START + 21
|
||||
#define SCI_CHANGEPOSITION SCI_START + 22
|
||||
#define SCI_GOTOLINE SCI_START + 24
|
||||
#define SCI_GOTOPOS SCI_START + 25
|
||||
#define SCI_SETANCHOR SCI_START + 26
|
||||
@@ -107,6 +106,9 @@ extern "C" {
|
||||
#define SCI_STARTSTYLING SCI_START + 32
|
||||
#define SCI_SETSTYLING SCI_START + 33
|
||||
|
||||
// This is the same value as CP_UTF8 in Windows
|
||||
#define SC_CP_UTF8 65001
|
||||
|
||||
#define SCI_SETBUFFEREDDRAW SCI_START + 35
|
||||
#define SCI_SETTABWIDTH SCI_START + 36
|
||||
#define SCI_SETCODEPAGE SCI_START + 37
|
||||
@@ -156,7 +158,11 @@ extern "C" {
|
||||
#define STYLE_BRACELIGHT 34
|
||||
#define STYLE_BRACEBAD 35
|
||||
#define STYLE_CONTROLCHAR 36
|
||||
#define STYLE_MAX 63
|
||||
#define STYLE_MAX 127
|
||||
|
||||
#define SC_CHARSET_ANSI 0
|
||||
#define SC_CHARSET_DEFAULT 1
|
||||
#define SC_CHARSET_RUSSIAN 204
|
||||
|
||||
#define SCI_STYLECLEARALL SCI_START + 50
|
||||
#define SCI_STYLESETFORE SCI_START + 51
|
||||
@@ -167,6 +173,8 @@ extern "C" {
|
||||
#define SCI_STYLESETFONT SCI_START + 56
|
||||
#define SCI_STYLESETEOLFILLED SCI_START + 57
|
||||
#define SCI_STYLERESETDEFAULT SCI_START + 58
|
||||
#define SCI_STYLESETUNDERLINE SCI_START + 59
|
||||
#define SCI_STYLESETCHARACTERSET SCI_START + 66
|
||||
|
||||
#define SCI_SETSELFORE SCI_START + 67
|
||||
#define SCI_SETSELBACK SCI_START + 68
|
||||
@@ -190,6 +198,8 @@ extern "C" {
|
||||
#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
|
||||
@@ -213,6 +223,21 @@ extern "C" {
|
||||
#define SCI_AUTOCPOSSTART SCI_START + 103
|
||||
#define SCI_AUTOCCOMPLETE SCI_START + 104
|
||||
#define SCI_AUTOCSTOPS SCI_START + 105
|
||||
#define SCI_AUTOCSETSEPARATOR SCI_START + 106
|
||||
#define SCI_AUTOCGETSEPARATOR SCI_START + 107
|
||||
#define SCI_AUTOCSELECT SCI_START + 108
|
||||
|
||||
#define SCI_GETTABWIDTH SCI_START + 121
|
||||
#define SCI_SETINDENT SCI_START + 122
|
||||
#define SCI_GETINDENT SCI_START + 123
|
||||
#define SCI_SETUSETABS SCI_START + 124
|
||||
#define SCI_GETUSETABS SCI_START + 125
|
||||
#define SCI_SETLINEINDENTATION SCI_START + 126
|
||||
#define SCI_GETLINEINDENTATION SCI_START + 127
|
||||
#define SCI_GETLINEINDENTPOSITION SCI_START + 128
|
||||
|
||||
#define SCI_SETHSCROLLBAR SCI_START + 130
|
||||
#define SCI_GETHSCROLLBAR SCI_START + 131
|
||||
|
||||
#define SCI_CALLTIPSHOW SCI_START + 200
|
||||
#define SCI_CALLTIPCANCEL SCI_START + 201
|
||||
@@ -279,6 +304,13 @@ extern "C" {
|
||||
#define SCI_ZOOMOUT SCI_START + 334
|
||||
#define SCI_DELWORDLEFT SCI_START + 335
|
||||
#define SCI_DELWORDRIGHT SCI_START + 336
|
||||
#define SCI_LINECUT SCI_START + 337
|
||||
#define SCI_LINEDELETE SCI_START + 338
|
||||
#define SCI_LINETRANSPOSE SCI_START + 339
|
||||
#define SCI_LOWERCASE SCI_START + 340
|
||||
#define SCI_UPPERCASE SCI_START + 341
|
||||
#define SCI_LINESCROLLDOWN SCI_START + 342
|
||||
#define SCI_LINESCROLLUP SCI_START + 343
|
||||
|
||||
#define SCI_LINELENGTH SCI_START + 350
|
||||
#define SCI_BRACEHIGHLIGHT SCI_START + 351
|
||||
@@ -311,6 +343,14 @@ extern "C" {
|
||||
// OR this with CARET_SLOP to reposition whenever outside slop border
|
||||
|
||||
#define SCI_SETCARETPOLICY SCI_START + 369
|
||||
#define SCI_LINESONSCREEN SCI_START + 370
|
||||
#define SCI_USEPOPUP SCI_START + 371
|
||||
#define SCI_SELECTIONISRECTANGLE SCI_START + 372
|
||||
#define SCI_SETZOOM SCI_START + 373
|
||||
#define SCI_GETZOOM SCI_START + 374
|
||||
|
||||
#define SCI_ADDREFDOC SCI_START + 375
|
||||
#define SCI_RELEASEDOC SCI_START + 376
|
||||
|
||||
// GTK+ Specific
|
||||
#define SCI_GRABFOCUS SCI_START + 400
|
||||
@@ -342,8 +382,11 @@ typedef void (tMacroRecorder)(UINT iMessage, WPARAM wParam, LPARAM lParam,
|
||||
#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 0x377
|
||||
#define SC_MODEVENTMASKALL 0xF77
|
||||
|
||||
struct SCNotification {
|
||||
NMHDR nmhdr;
|
||||
@@ -394,6 +437,8 @@ void Scintilla_RegisterClasses(HINSTANCE hInstance);
|
||||
|
||||
#ifdef INCLUDE_DEPRECATED_FEATURES
|
||||
|
||||
#define SCI_CHANGEPOSITION SCI_START + 22
|
||||
|
||||
// Default style settings. These are deprecated and will be removed in a future version.
|
||||
#define SCI_SETFORE SCI_START + 60
|
||||
#define SCI_SETBACK SCI_START + 61
|
||||
|
@@ -20,79 +20,34 @@
|
||||
#define EM_CANPASTE (1074)
|
||||
#define EM_CANUNDO (198)
|
||||
#define EM_CHARFROMPOS (215)
|
||||
#define EM_DISPLAYBAND (1075)
|
||||
#define EM_EMPTYUNDOBUFFER (205)
|
||||
#define EM_EXGETSEL (1076)
|
||||
#define EM_EXLIMITTEXT (1077)
|
||||
#define EM_EXLINEFROMCHAR (1078)
|
||||
#define EM_EXSETSEL (1079)
|
||||
#define EM_FINDTEXT (1080)
|
||||
#define EM_FINDTEXTEX (1103)
|
||||
#define EM_FINDWORDBREAK (1100)
|
||||
#define EM_FMTLINES (200)
|
||||
#define EM_FORMATRANGE (1081)
|
||||
#define EM_GETCHARFORMAT (1082)
|
||||
#define EM_GETEVENTMASK (1083)
|
||||
#define EM_GETFIRSTVISIBLELINE (206)
|
||||
#define EM_GETHANDLE (189)
|
||||
#define EM_GETLIMITTEXT (213)
|
||||
#define EM_GETLINE (196)
|
||||
#define EM_GETLINECOUNT (186)
|
||||
#define EM_GETMARGINS (212)
|
||||
#define EM_GETMODIFY (184)
|
||||
#define EM_GETIMECOLOR (1129)
|
||||
#define EM_GETIMEOPTIONS (1131)
|
||||
#define EM_GETOPTIONS (1102)
|
||||
#define EM_GETOLEINTERFACE (1084)
|
||||
#define EM_GETPARAFORMAT (1085)
|
||||
#define EM_GETPASSWORDCHAR (210)
|
||||
#define EM_GETPUNCTUATION (1125)
|
||||
#define EM_GETRECT (178)
|
||||
#define EM_GETSEL (176)
|
||||
#define EM_GETSELTEXT (1086)
|
||||
#define EM_GETTEXTRANGE (1099)
|
||||
#define EM_GETTHUMB (190)
|
||||
#define EM_GETWORDBREAKPROC (209)
|
||||
#define EM_GETWORDBREAKPROCEX (1104)
|
||||
#define EM_GETWORDWRAPMODE (1127)
|
||||
#define EM_HIDESELECTION (1087)
|
||||
#define EM_LIMITTEXT (197)
|
||||
#define EM_LINEFROMCHAR (201)
|
||||
#define EM_LINEINDEX (187)
|
||||
#define EM_LINELENGTH (193)
|
||||
#define EM_LINESCROLL (182)
|
||||
#define EM_PASTESPECIAL (1088)
|
||||
#define EM_POSFROMCHAR (214)
|
||||
#define EM_REPLACESEL (194)
|
||||
#define EM_REQUESTRESIZE (1089)
|
||||
#define EM_SCROLL (181)
|
||||
#define EM_SCROLLCARET (183)
|
||||
#define EM_SELECTIONTYPE (1090)
|
||||
#define EM_SETBKGNDCOLOR (1091)
|
||||
#define EM_SETCHARFORMAT (1092)
|
||||
#define EM_SETEVENTMASK (1093)
|
||||
#define EM_SETHANDLE (188)
|
||||
#define EM_SETIMECOLOR (1128)
|
||||
#define EM_SETIMEOPTIONS (1130)
|
||||
#define EM_SETLIMITTEXT (197)
|
||||
#define EM_SETMARGINS (211)
|
||||
#define EM_SETMODIFY (185)
|
||||
#define EM_SETOLECALLBACK (1094)
|
||||
#define EM_SETOPTIONS (1101)
|
||||
#define EM_SETPARAFORMAT (1095)
|
||||
#define EM_SETPASSWORDCHAR (204)
|
||||
#define EM_SETPUNCTUATION (1124)
|
||||
#define EM_SETREADONLY (207)
|
||||
#define EM_SETRECT (179)
|
||||
#define EM_SETRECTNP (180)
|
||||
#define EM_SETSEL (177)
|
||||
#define EM_SETTABSTOPS (203)
|
||||
#define EM_SETTARGETDEVICE (1096)
|
||||
#define EM_SETWORDBREAKPROC (208)
|
||||
#define EM_SETWORDBREAKPROCEX (1105)
|
||||
#define EM_SETWORDWRAPMODE (1126)
|
||||
#define EM_STREAMIN (1097)
|
||||
#define EM_STREAMOUT (1098)
|
||||
#define EM_UNDO (199)
|
||||
|
||||
#define WM_NULL (0)
|
||||
@@ -132,6 +87,7 @@
|
||||
#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
|
||||
@@ -151,6 +107,8 @@
|
||||
#define VK_RETURN WXK_RETURN
|
||||
#define VK_ADD WXK_ADD
|
||||
#define VK_SUBTRACT WXK_SUBTRACT
|
||||
//TODO:
|
||||
#define VK_DIVIDE WXK_DIVIDE
|
||||
|
||||
// Are these needed any more
|
||||
#define LPSTR char *
|
||||
|
47
contrib/src/stc/scintilla/include/WindowAccessor.h
Normal file
@@ -0,0 +1,47 @@
|
||||
// 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) {
|
||||
}
|
||||
~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);
|
||||
};
|
@@ -15,6 +15,7 @@ AutoComplete::AutoComplete() {
|
||||
active = false;
|
||||
posStart = 0;
|
||||
strcpy(stopChars, "");
|
||||
separator = ' ';
|
||||
}
|
||||
|
||||
AutoComplete::~AutoComplete() {
|
||||
@@ -44,6 +45,14 @@ bool AutoComplete::IsStopChar(char ch) {
|
||||
return ch && strchr(stopChars, ch);
|
||||
}
|
||||
|
||||
void AutoComplete::SetSeparator(char separator_) {
|
||||
separator = separator_;
|
||||
}
|
||||
|
||||
char AutoComplete::GetSeparator() {
|
||||
return separator;
|
||||
}
|
||||
|
||||
int AutoComplete::SetList(const char *list) {
|
||||
int maxStrLen = 12;
|
||||
lb.Clear();
|
||||
@@ -53,7 +62,7 @@ int AutoComplete::SetList(const char *list) {
|
||||
char *startword = words;
|
||||
int i = 0;
|
||||
for (; words && words[i]; i++) {
|
||||
if (words[i] == ' ') {
|
||||
if (words[i] == separator) {
|
||||
words[i] = '\0';
|
||||
lb.Append(startword);
|
||||
maxStrLen = Platform::Maximum(maxStrLen, strlen(startword));
|
||||
|
@@ -9,6 +9,7 @@
|
||||
class AutoComplete {
|
||||
bool active;
|
||||
char stopChars[256];
|
||||
char separator;
|
||||
public:
|
||||
ListBox lb;
|
||||
int posStart;
|
||||
@@ -27,7 +28,11 @@ public:
|
||||
void SetStopChars(const char *stopChars_);
|
||||
bool IsStopChar(char ch);
|
||||
|
||||
// The list string contains a sequence of words separated by spaces
|
||||
// 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
|
||||
int SetList(const char *list);
|
||||
|
||||
void Show();
|
||||
|
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#include "Scintilla.h"
|
||||
#include "CallTip.h"
|
||||
|
||||
CallTip::CallTip() {
|
||||
@@ -117,7 +118,7 @@ PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn,
|
||||
Surface surfaceMeasure;
|
||||
surfaceMeasure.Init();
|
||||
int deviceHeight = (size * surfaceMeasure.LogPixelsY()) / 72;
|
||||
font.Create(faceName, deviceHeight);
|
||||
font.Create(faceName, SC_CHARSET_DEFAULT, deviceHeight, false, false);
|
||||
if (val)
|
||||
delete []val;
|
||||
val = new char[strlen(defn) + 1];
|
||||
|
@@ -6,13 +6,14 @@
|
||||
#ifndef CALLTIP_H
|
||||
#define CALLTIP_H
|
||||
|
||||
const char callClassName[] = "CallTip";
|
||||
|
||||
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;
|
||||
|
@@ -191,11 +191,23 @@ void LineVector::InsertValue(int pos, int value) {
|
||||
}
|
||||
}
|
||||
lines++;
|
||||
for (int i = lines + 1; i > pos; i--) {
|
||||
for (int i = lines; i > pos; i--) {
|
||||
linesData[i] = linesData[i - 1];
|
||||
}
|
||||
linesData[pos].startPosition = value;
|
||||
linesData[pos].handleSet = 0;
|
||||
if (levels) {
|
||||
for (int j = lines; j > pos; j--) {
|
||||
levels[j] = levels[j - 1];
|
||||
}
|
||||
if (pos == 0) {
|
||||
levels[pos] = SC_FOLDLEVELBASE;
|
||||
} else if (pos == (lines-1)) { // Last line will not be a folder
|
||||
levels[pos] = SC_FOLDLEVELBASE;
|
||||
} else {
|
||||
levels[pos] = levels[pos-1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LineVector::SetValue(int pos, int value) {
|
||||
@@ -221,6 +233,15 @@ void LineVector::Remove(int pos) {
|
||||
for (int i = pos; i < lines; i++) {
|
||||
linesData[i] = linesData[i + 1];
|
||||
}
|
||||
if (levels) {
|
||||
// Level information merges back onto previous line
|
||||
int posAbove = pos-1;
|
||||
if (posAbove < 0)
|
||||
posAbove = 0;
|
||||
for (int j = posAbove; j < lines; j++) {
|
||||
levels[j] = levels[j + 1];
|
||||
}
|
||||
}
|
||||
lines--;
|
||||
}
|
||||
|
||||
@@ -233,9 +254,8 @@ int LineVector::LineFromPosition(int pos) {
|
||||
return lines - 1;
|
||||
int lower = 0;
|
||||
int upper = lines;
|
||||
int middle = 0;
|
||||
do {
|
||||
middle = (upper + lower + 1) / 2; // Round high
|
||||
int middle = (upper + lower + 1) / 2; // Round high
|
||||
if (pos < linesData[middle].startPosition) {
|
||||
upper = middle - 1;
|
||||
} else {
|
||||
@@ -316,12 +336,13 @@ Action::~Action() {
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void Action::Create(actionType at_, int position_, char *data_, int lenData_) {
|
||||
void Action::Create(actionType at_, int position_, char *data_, int lenData_, bool mayCoalesce_) {
|
||||
delete []data;
|
||||
position = position_;
|
||||
at = at_;
|
||||
data = data_;
|
||||
lenData = lenData_;
|
||||
mayCoalesce = mayCoalesce_;
|
||||
}
|
||||
|
||||
void Action::Destroy() {
|
||||
@@ -336,39 +357,222 @@ void Action::Grab(Action *source) {
|
||||
at = source->at;
|
||||
data = source->data;
|
||||
lenData = source->lenData;
|
||||
|
||||
mayCoalesce = source->mayCoalesce;
|
||||
|
||||
// Ownership of source data transferred to this
|
||||
source->position = 0;
|
||||
source->at = startAction;
|
||||
source->data = 0;
|
||||
source->lenData = 0;
|
||||
source->mayCoalesce = true;
|
||||
}
|
||||
|
||||
CellBuffer::CellBuffer(int initialLength) {
|
||||
body = new char[initialLength];
|
||||
size = initialLength;
|
||||
length = 0;
|
||||
part1len = 0;
|
||||
gaplen = initialLength;
|
||||
part2body = body + gaplen;
|
||||
readOnly = false;
|
||||
// The undo history stores a sequence of user operations that represent the user's view of the
|
||||
// commands executed on the text.
|
||||
// Each user operation contains a sequence of text insertion and text deletion actions.
|
||||
// All the user operations are stored in a list of individual actions with 'start' actions used
|
||||
// as delimiters between user operations.
|
||||
// Initially there is one start action in the history.
|
||||
// As each action is performed, it is recorded in the history. The action may either become
|
||||
// part of the current user operation or may start a new user operation. If it is to be part of the
|
||||
// current operation, then it overwrites the current last action. If it is to be part of a new
|
||||
// operation, it is appended after the current last action.
|
||||
// After writing the new action, a new start action is appended at the end of the history.
|
||||
// The decision of whether to start a new user operation is based upon two factors. If a
|
||||
// compound operation has been explicitly started by calling BeginUndoAction and no matching
|
||||
// EndUndoAction (these calls nest) has been called, then the action is coalesced into the current
|
||||
// operation. If there is no outstanding BeginUndoAction call then a new operation is started
|
||||
// unless it looks as if the new action is caused by the user typing or deleting a stream of text.
|
||||
// Sequences that look like typing or deletion are coalesced into a single user operation.
|
||||
|
||||
UndoHistory::UndoHistory() {
|
||||
|
||||
lenActions = 100;
|
||||
actions = new Action[lenActions];
|
||||
maxAction = 0;
|
||||
currentAction = 0;
|
||||
collectingUndo = undoCollectAutoStart;
|
||||
undoSequenceDepth = 0;
|
||||
savePoint = 0;
|
||||
|
||||
actions[currentAction].Create(startAction);
|
||||
}
|
||||
|
||||
UndoHistory::~UndoHistory() {
|
||||
delete []actions;
|
||||
actions = 0;
|
||||
}
|
||||
|
||||
void UndoHistory::EnsureUndoRoom() {
|
||||
//Platform::DebugPrintf("%% %d action %d %d %d\n", at, position, length, currentAction);
|
||||
if (currentAction >= 2) {
|
||||
// Have to test that there is room for 2 more actions in the array
|
||||
// as two actions may be created by this function
|
||||
if (currentAction >= (lenActions - 2)) {
|
||||
// Run out of undo nodes so extend the array
|
||||
int lenActionsNew = lenActions * 2;
|
||||
Action *actionsNew = new Action[lenActionsNew];
|
||||
if (!actionsNew)
|
||||
return;
|
||||
for (int act = 0; act <= currentAction; act++)
|
||||
actionsNew[act].Grab(&actions[act]);
|
||||
delete []actions;
|
||||
lenActions = lenActionsNew;
|
||||
actions = actionsNew;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UndoHistory::AppendAction(actionType at, int position, char *data, int lengthData) {
|
||||
EnsureUndoRoom();
|
||||
//Platform::DebugPrintf("%% %d action %d %d %d\n", at, position, lengthData, currentAction);
|
||||
//Platform::DebugPrintf("^ %d action %d %d\n", actions[currentAction - 1].at,
|
||||
// actions[currentAction - 1].position, actions[currentAction - 1].lenData);
|
||||
if (currentAction >= 1) {
|
||||
if (0 == undoSequenceDepth) {
|
||||
// Top level actions may not always be coalesced
|
||||
Action &actPrevious = actions[currentAction - 1];
|
||||
// See if current action can be coalesced into previous action
|
||||
// Will work if both are inserts or deletes and position is same
|
||||
if (at != actPrevious.at) {
|
||||
currentAction++;
|
||||
} else if (currentAction == savePoint) {
|
||||
currentAction++;
|
||||
} else if ((at == removeAction) &&
|
||||
((position + lengthData * 2) != actPrevious.position)) {
|
||||
// Removals must be at same position to coalesce
|
||||
currentAction++;
|
||||
} else if ((at == insertAction) &&
|
||||
(position != (actPrevious.position + actPrevious.lenData*2))) {
|
||||
// Insertions must be immediately after to coalesce
|
||||
currentAction++;
|
||||
} else {
|
||||
//Platform::DebugPrintf("action coalesced\n");
|
||||
}
|
||||
} else {
|
||||
// Actions not at top level are always coalesced unless this is after return to top level
|
||||
if (!actions[currentAction].mayCoalesce)
|
||||
currentAction++;
|
||||
}
|
||||
} else {
|
||||
currentAction++;
|
||||
}
|
||||
actions[currentAction].Create(at, position, data, lengthData);
|
||||
currentAction++;
|
||||
actions[currentAction].Create(startAction);
|
||||
maxAction = currentAction;
|
||||
}
|
||||
|
||||
void UndoHistory::BeginUndoAction() {
|
||||
EnsureUndoRoom();
|
||||
if (undoSequenceDepth == 0) {
|
||||
if (actions[currentAction].at != startAction) {
|
||||
currentAction++;
|
||||
actions[currentAction].Create(startAction);
|
||||
maxAction = currentAction;
|
||||
}
|
||||
actions[currentAction].mayCoalesce = false;
|
||||
}
|
||||
undoSequenceDepth++;
|
||||
}
|
||||
|
||||
void UndoHistory::EndUndoAction() {
|
||||
EnsureUndoRoom();
|
||||
undoSequenceDepth--;
|
||||
if (0 == undoSequenceDepth) {
|
||||
if (actions[currentAction].at != startAction) {
|
||||
currentAction++;
|
||||
actions[currentAction].Create(startAction);
|
||||
maxAction = currentAction;
|
||||
}
|
||||
actions[currentAction].mayCoalesce = false;
|
||||
}
|
||||
}
|
||||
|
||||
void UndoHistory::DropUndoSequence() {
|
||||
undoSequenceDepth = 0;
|
||||
}
|
||||
|
||||
void UndoHistory::DeleteUndoHistory() {
|
||||
for (int i = 1; i < maxAction; i++)
|
||||
actions[i].Destroy();
|
||||
maxAction = 0;
|
||||
currentAction = 0;
|
||||
actions[currentAction].Create(startAction);
|
||||
savePoint = 0;
|
||||
}
|
||||
|
||||
void UndoHistory::SetSavePoint() {
|
||||
savePoint = currentAction;
|
||||
}
|
||||
|
||||
bool UndoHistory::IsSavePoint() const {
|
||||
return savePoint == currentAction;
|
||||
}
|
||||
|
||||
bool UndoHistory::CanUndo() const {
|
||||
return (currentAction > 0) && (maxAction > 0);
|
||||
}
|
||||
|
||||
int UndoHistory::StartUndo() {
|
||||
// Drop any trailing startAction
|
||||
if (actions[currentAction].at == startAction && currentAction > 0)
|
||||
currentAction--;
|
||||
|
||||
// Count the steps in this action
|
||||
int act = currentAction;
|
||||
while (actions[act].at != startAction && act > 0) {
|
||||
act--;
|
||||
}
|
||||
return currentAction - act;
|
||||
}
|
||||
|
||||
const Action &UndoHistory::GetUndoStep() const {
|
||||
return actions[currentAction];
|
||||
}
|
||||
|
||||
void UndoHistory::CompletedUndoStep() {
|
||||
currentAction--;
|
||||
}
|
||||
|
||||
bool UndoHistory::CanRedo() const {
|
||||
return maxAction > currentAction;
|
||||
}
|
||||
|
||||
int UndoHistory::StartRedo() {
|
||||
// Drop any leading startAction
|
||||
if (actions[currentAction].at == startAction && currentAction < maxAction)
|
||||
currentAction++;
|
||||
|
||||
// Count the steps in this action
|
||||
int act = currentAction;
|
||||
while (actions[act].at != startAction && act < maxAction) {
|
||||
act++;
|
||||
}
|
||||
return act - currentAction;
|
||||
}
|
||||
|
||||
const Action &UndoHistory::GetRedoStep() const {
|
||||
return actions[currentAction];
|
||||
}
|
||||
|
||||
void UndoHistory::CompletedRedoStep() {
|
||||
currentAction++;
|
||||
}
|
||||
|
||||
CellBuffer::CellBuffer(int initialLength) {
|
||||
body = new char[initialLength];
|
||||
size = initialLength;
|
||||
length = 0;
|
||||
part1len = 0;
|
||||
gaplen = initialLength;
|
||||
part2body = body + gaplen;
|
||||
readOnly = false;
|
||||
collectingUndo = undoCollectAutoStart;
|
||||
}
|
||||
|
||||
CellBuffer::~CellBuffer() {
|
||||
delete []body;
|
||||
body = 0;
|
||||
delete []actions;
|
||||
actions = 0;
|
||||
}
|
||||
|
||||
void CellBuffer::GapTo(int position) {
|
||||
@@ -486,7 +690,7 @@ const char *CellBuffer::InsertString(int position, char *s, int insertLength) {
|
||||
for (int i = 0; i < insertLength / 2; i++) {
|
||||
data[i] = s[i * 2];
|
||||
}
|
||||
AppendAction(insertAction, position, data, insertLength / 2);
|
||||
uh.AppendAction(insertAction, position, data, insertLength / 2);
|
||||
}
|
||||
|
||||
BasicInsertString(position, s, insertLength);
|
||||
@@ -504,7 +708,7 @@ void CellBuffer::InsertCharStyle(int position, char ch, char style) {
|
||||
bool CellBuffer::SetStyleAt(int position, char style, char mask) {
|
||||
char curVal = ByteAt(position*2 + 1);
|
||||
if ((curVal & mask) != style) {
|
||||
SetByteAt(position*2 + 1, (curVal & ~mask) | style);
|
||||
SetByteAt(position*2 + 1, static_cast<char>((curVal & ~mask) | style));
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -517,7 +721,7 @@ bool CellBuffer::SetStyleFor(int position, int lengthStyle, char style, char mas
|
||||
while (lengthStyle--) {
|
||||
char curVal = ByteAt(bytePos);
|
||||
if ((curVal & mask) != style) {
|
||||
SetByteAt(bytePos, (curVal & ~mask) | style);
|
||||
SetByteAt(bytePos, static_cast<char>((curVal & ~mask) | style));
|
||||
changed = true;
|
||||
}
|
||||
bytePos += 2;
|
||||
@@ -525,48 +729,6 @@ bool CellBuffer::SetStyleFor(int position, int lengthStyle, char style, char mas
|
||||
return changed;
|
||||
}
|
||||
|
||||
void CellBuffer::EnsureUndoRoom() {
|
||||
//Platform::DebugPrintf("%% %d action %d %d %d\n", at, position, length, currentAction);
|
||||
if (currentAction >= 2) {
|
||||
// Have to test that there is room for 2 more actions in the array
|
||||
// as two actions may be created by this function
|
||||
if (currentAction >= (lenActions - 2)) {
|
||||
// Run out of undo nodes so extend the array
|
||||
int lenActionsNew = lenActions * 2;
|
||||
Action *actionsNew = new Action[lenActionsNew];
|
||||
if (!actionsNew)
|
||||
return;
|
||||
for (int act = 0; act <= currentAction; act++)
|
||||
actionsNew[act].Grab(&actions[act]);
|
||||
delete []actions;
|
||||
lenActions = lenActionsNew;
|
||||
actions = actionsNew;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CellBuffer::AppendAction(actionType at, int position, char *data, int lengthData) {
|
||||
EnsureUndoRoom();
|
||||
//Platform::DebugPrintf("%% %d action %d %d %d\n", at, position, lengthData, currentAction);
|
||||
if (currentAction >= 2) {
|
||||
// See if current action can be coalesced into previous action
|
||||
// Will work if both are inserts or deletes and position is same or two different
|
||||
if ((at != actions[currentAction - 1].at) || (abs(position - actions[currentAction - 1].position) > 2)) {
|
||||
currentAction++;
|
||||
} else if (currentAction == savePoint) {
|
||||
currentAction++;
|
||||
}
|
||||
} else {
|
||||
currentAction++;
|
||||
}
|
||||
actions[currentAction].Create(at, position, data, lengthData);
|
||||
if ((collectingUndo == undoCollectAutoStart) && (0 == undoSequenceDepth)) {
|
||||
currentAction++;
|
||||
actions[currentAction].Create(startAction);
|
||||
}
|
||||
maxAction = currentAction;
|
||||
}
|
||||
|
||||
const char *CellBuffer::DeleteChars(int position, int deleteLength) {
|
||||
// InsertString and DeleteChars are the bottleneck though which all changes occur
|
||||
char *data = 0;
|
||||
@@ -577,7 +739,7 @@ const char *CellBuffer::DeleteChars(int position, int deleteLength) {
|
||||
for (int i = 0; i < deleteLength / 2; i++) {
|
||||
data[i] = ByteAt(position + i * 2);
|
||||
}
|
||||
AppendAction(removeAction, position, data, deleteLength / 2);
|
||||
uh.AppendAction(removeAction, position, data, deleteLength / 2);
|
||||
}
|
||||
|
||||
BasicDeleteChars(position, deleteLength);
|
||||
@@ -616,11 +778,11 @@ void CellBuffer::SetReadOnly(bool set) {
|
||||
}
|
||||
|
||||
void CellBuffer::SetSavePoint() {
|
||||
savePoint = currentAction;
|
||||
uh.SetSavePoint();
|
||||
}
|
||||
|
||||
bool CellBuffer::IsSavePoint() {
|
||||
return savePoint == currentAction;
|
||||
return uh.IsSavePoint();
|
||||
}
|
||||
|
||||
int CellBuffer::AddMark(int line, int markerNum) {
|
||||
@@ -792,7 +954,7 @@ void CellBuffer::BasicDeleteChars(int position, int deleteLength) {
|
||||
|
||||
undoCollectionType CellBuffer::SetUndoCollection(undoCollectionType collectUndo) {
|
||||
collectingUndo = collectUndo;
|
||||
undoSequenceDepth = 0;
|
||||
uh.DropUndoSequence();
|
||||
return collectingUndo;
|
||||
}
|
||||
|
||||
@@ -800,69 +962,32 @@ bool CellBuffer::IsCollectingUndo() {
|
||||
return collectingUndo;
|
||||
}
|
||||
|
||||
void CellBuffer::AppendUndoStartAction() {
|
||||
EnsureUndoRoom();
|
||||
// Finish any currently active undo sequence
|
||||
undoSequenceDepth = 0;
|
||||
if (actions[currentAction].at != startAction) {
|
||||
undoSequenceDepth++;
|
||||
currentAction++;
|
||||
actions[currentAction].Create(startAction);
|
||||
maxAction = currentAction;
|
||||
}
|
||||
}
|
||||
|
||||
void CellBuffer::BeginUndoAction() {
|
||||
EnsureUndoRoom();
|
||||
if (undoSequenceDepth == 0) {
|
||||
if (actions[currentAction].at != startAction) {
|
||||
currentAction++;
|
||||
actions[currentAction].Create(startAction);
|
||||
maxAction = currentAction;
|
||||
}
|
||||
}
|
||||
undoSequenceDepth++;
|
||||
uh.BeginUndoAction();
|
||||
}
|
||||
|
||||
void CellBuffer::EndUndoAction() {
|
||||
EnsureUndoRoom();
|
||||
undoSequenceDepth--;
|
||||
if (0 == undoSequenceDepth) {
|
||||
if (actions[currentAction].at != startAction) {
|
||||
currentAction++;
|
||||
actions[currentAction].Create(startAction);
|
||||
maxAction = currentAction;
|
||||
}
|
||||
}
|
||||
uh.EndUndoAction();
|
||||
}
|
||||
|
||||
void CellBuffer::DeleteUndoHistory() {
|
||||
for (int i = 1; i < maxAction; i++)
|
||||
actions[i].Destroy();
|
||||
maxAction = 0;
|
||||
currentAction = 0;
|
||||
savePoint = 0;
|
||||
uh.DeleteUndoHistory();
|
||||
}
|
||||
|
||||
bool CellBuffer::CanUndo() {
|
||||
return (!readOnly) && ((currentAction > 0) && (maxAction > 0));
|
||||
return (!readOnly) && (uh.CanUndo());
|
||||
}
|
||||
|
||||
int CellBuffer::StartUndo() {
|
||||
// Drop any trailing startAction
|
||||
if (actions[currentAction].at == startAction && currentAction > 0)
|
||||
currentAction--;
|
||||
|
||||
// Count the steps in this action
|
||||
int act = currentAction;
|
||||
while (actions[act].at != startAction && act > 0) {
|
||||
act--;
|
||||
}
|
||||
return currentAction - act;
|
||||
return uh.StartUndo();
|
||||
}
|
||||
|
||||
const Action &CellBuffer::UndoStep() {
|
||||
const Action &actionStep = actions[currentAction];
|
||||
const Action &CellBuffer::GetUndoStep() const {
|
||||
return uh.GetUndoStep();
|
||||
}
|
||||
|
||||
void CellBuffer::PerformUndoStep() {
|
||||
const Action &actionStep = uh.GetUndoStep();
|
||||
if (actionStep.at == insertAction) {
|
||||
BasicDeleteChars(actionStep.position, actionStep.lenData*2);
|
||||
} else if (actionStep.at == removeAction) {
|
||||
@@ -874,29 +999,23 @@ const Action &CellBuffer::UndoStep() {
|
||||
BasicInsertString(actionStep.position, styledData, actionStep.lenData*2);
|
||||
delete []styledData;
|
||||
}
|
||||
currentAction--;
|
||||
return actionStep;
|
||||
uh.CompletedUndoStep();
|
||||
}
|
||||
|
||||
bool CellBuffer::CanRedo() {
|
||||
return (!readOnly) && (maxAction > currentAction);
|
||||
return (!readOnly) && (uh.CanRedo());
|
||||
}
|
||||
|
||||
int CellBuffer::StartRedo() {
|
||||
// Drop any leading startAction
|
||||
if (actions[currentAction].at == startAction && currentAction < maxAction)
|
||||
currentAction++;
|
||||
|
||||
// Count the steps in this action
|
||||
int act = currentAction;
|
||||
while (actions[act].at != startAction && act < maxAction) {
|
||||
act++;
|
||||
}
|
||||
return act - currentAction;
|
||||
return uh.StartRedo();
|
||||
}
|
||||
|
||||
const Action &CellBuffer::RedoStep() {
|
||||
const Action &actionStep = actions[currentAction];
|
||||
const Action &CellBuffer::GetRedoStep() const {
|
||||
return uh.GetRedoStep();
|
||||
}
|
||||
|
||||
void CellBuffer::PerformRedoStep() {
|
||||
const Action &actionStep = uh.GetRedoStep();
|
||||
if (actionStep.at == insertAction) {
|
||||
char *styledData = new char[actionStep.lenData * 2];
|
||||
for (int i = 0; i < actionStep.lenData; i++) {
|
||||
@@ -908,8 +1027,7 @@ const Action &CellBuffer::RedoStep() {
|
||||
} else if (actionStep.at == removeAction) {
|
||||
BasicDeleteChars(actionStep.position, actionStep.lenData*2);
|
||||
}
|
||||
currentAction++;
|
||||
return actionStep;
|
||||
uh.CompletedRedoStep();
|
||||
}
|
||||
|
||||
int CellBuffer::SetLineState(int line, int state) {
|
||||
|
@@ -79,16 +79,55 @@ public:
|
||||
int position;
|
||||
char *data;
|
||||
int lenData;
|
||||
bool mayCoalesce;
|
||||
|
||||
Action();
|
||||
~Action();
|
||||
void Create(actionType at_, int position_=0, char *data_=0, int lenData_=0);
|
||||
void Create(actionType at_, int position_=0, char *data_=0, int lenData_=0, bool mayCoalesce_=true);
|
||||
void Destroy();
|
||||
void Grab(Action *source);
|
||||
};
|
||||
|
||||
enum undoCollectionType { undoCollectNone, undoCollectAutoStart, undoCollectManualStart };
|
||||
|
||||
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
|
||||
@@ -102,13 +141,8 @@ private:
|
||||
char *part2body;
|
||||
bool readOnly;
|
||||
|
||||
Action *actions;
|
||||
int lenActions;
|
||||
int maxAction;
|
||||
int currentAction;
|
||||
undoCollectionType collectingUndo;
|
||||
int undoSequenceDepth;
|
||||
int savePoint;
|
||||
UndoHistory uh;
|
||||
|
||||
LineVector lv;
|
||||
|
||||
@@ -117,9 +151,6 @@ private:
|
||||
void GapTo(int position);
|
||||
void RoomFor(int insertionLength);
|
||||
|
||||
void EnsureUndoRoom();
|
||||
void AppendAction(actionType at, int position, char *data, int length);
|
||||
|
||||
inline char ByteAt(int position);
|
||||
void SetByteAt(int position, char ch);
|
||||
|
||||
@@ -143,7 +174,7 @@ public:
|
||||
|
||||
// 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=(char)0xff);
|
||||
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);
|
||||
@@ -170,19 +201,20 @@ public:
|
||||
|
||||
undoCollectionType SetUndoCollection(undoCollectionType collectUndo);
|
||||
bool IsCollectingUndo();
|
||||
void AppendUndoStartAction();
|
||||
void BeginUndoAction();
|
||||
void EndUndoAction();
|
||||
void DeleteUndoHistory();
|
||||
|
||||
// To perform an undo, StartUndo is called to retreive the number of steps, then UndoStep is
|
||||
// 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 &UndoStep();
|
||||
const Action &GetUndoStep() const;
|
||||
void PerformUndoStep();
|
||||
bool CanRedo();
|
||||
int StartRedo();
|
||||
const Action &RedoStep();
|
||||
const Action &GetRedoStep() const;
|
||||
void PerformRedoStep();
|
||||
|
||||
int SetLineState(int line, int state);
|
||||
int GetLineState(int line);
|
||||
|
@@ -30,7 +30,6 @@ void ContractionState::MakeValid() const {
|
||||
if (!valid) {
|
||||
// Could be cleverer by keeping the index of the last still valid entry
|
||||
// rather than invalidating all.
|
||||
int linePrev = -1;
|
||||
int lineDisplay = 0;
|
||||
for (int line=0; line<linesInDoc; line++) {
|
||||
lines[line].displayLine = lineDisplay;
|
||||
@@ -108,12 +107,12 @@ void ContractionState::InsertLines(int lineDoc, int lineCount) {
|
||||
return;
|
||||
}
|
||||
//Platform::DebugPrintf("InsertLine[%d] = %d\n", lineDoc);
|
||||
if ((linesInDoc + 2) >= size) {
|
||||
Grow(size + growSize);
|
||||
if ((linesInDoc + lineCount + 2) >= size) {
|
||||
Grow(linesInDoc + lineCount + growSize);
|
||||
}
|
||||
linesInDoc += lineCount;
|
||||
linesInDisplay += lineCount;
|
||||
for (int i = linesInDoc + 1; i >= lineDoc + lineCount; i--) {
|
||||
for (int i = linesInDoc; i >= lineDoc + lineCount; i--) {
|
||||
lines[i].visible = lines[i - lineCount].visible;
|
||||
lines[i].expanded = lines[i - lineCount].expanded;
|
||||
}
|
||||
@@ -130,16 +129,18 @@ void ContractionState::DeleteLines(int lineDoc, int lineCount) {
|
||||
linesInDisplay -= lineCount;
|
||||
return;
|
||||
}
|
||||
int delta = 0;
|
||||
for (int d=0;d<lineCount;d++)
|
||||
int deltaDisplayed = 0;
|
||||
for (int d=0;d<lineCount;d++) {
|
||||
if (lines[lineDoc+d].visible)
|
||||
delta--;
|
||||
deltaDisplayed--;
|
||||
}
|
||||
for (int i = lineDoc; i < linesInDoc-lineCount; i++) {
|
||||
lines[i].visible = lines[i + lineCount].visible;
|
||||
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 += delta;
|
||||
linesInDisplay += deltaDisplayed;
|
||||
valid = false;
|
||||
}
|
||||
|
||||
@@ -154,8 +155,12 @@ bool ContractionState::GetVisible(int lineDoc) const {
|
||||
}
|
||||
|
||||
bool ContractionState::SetVisible(int lineDocStart, int lineDocEnd, bool visible) {
|
||||
if (lineDocStart == 0)
|
||||
lineDocStart++;
|
||||
if (lineDocStart > lineDocEnd)
|
||||
return false;
|
||||
if (size == 0) {
|
||||
Grow(lineDocEnd + growSize);
|
||||
Grow(linesInDoc + growSize);
|
||||
}
|
||||
// TODO: modify docLine members to mirror displayLine
|
||||
int delta = 0;
|
||||
@@ -191,7 +196,7 @@ bool ContractionState::GetExpanded(int lineDoc) const {
|
||||
|
||||
bool ContractionState::SetExpanded(int lineDoc, bool expanded) {
|
||||
if (size == 0) {
|
||||
Grow(lineDoc + growSize);
|
||||
Grow(linesInDoc + growSize);
|
||||
}
|
||||
if ((lineDoc >= 0) && (lineDoc < linesInDoc)) {
|
||||
if (lines[lineDoc].expanded != expanded) {
|
||||
|
@@ -32,7 +32,10 @@ Document::Document() {
|
||||
}
|
||||
endStyled = 0;
|
||||
enteredCount = 0;
|
||||
enteredReadOnlyCount = 0;
|
||||
tabInChars = 8;
|
||||
indentInChars = 0;
|
||||
useTabs = true;
|
||||
watchers = 0;
|
||||
lenWatchers = 0;
|
||||
}
|
||||
@@ -65,26 +68,54 @@ void Document::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) {
|
||||
int line = LineFromPosition(position);
|
||||
if (line == LinesTotal() - 1) {
|
||||
position = LineStart(line + 1);
|
||||
} else {
|
||||
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;
|
||||
return LineEnd(LineFromPosition(position));
|
||||
}
|
||||
|
||||
int Document::VCHomePosition(int position) {
|
||||
@@ -124,7 +155,10 @@ int Document::GetLastChild(int lineParent, int level) {
|
||||
level = GetLevel(lineParent) & SC_FOLDLEVELNUMBERMASK;
|
||||
int maxLine = LinesTotal();
|
||||
int lineMaxSubord = lineParent;
|
||||
while ((lineMaxSubord < maxLine-1) && IsSubordinate(level, GetLevel(lineMaxSubord+1))) {
|
||||
while (lineMaxSubord < maxLine-1) {
|
||||
EnsureStyledTo(LineStart(lineMaxSubord+2));
|
||||
if (!IsSubordinate(level, GetLevel(lineMaxSubord+1)))
|
||||
break;
|
||||
lineMaxSubord++;
|
||||
}
|
||||
if (lineMaxSubord > lineParent) {
|
||||
@@ -170,18 +204,23 @@ bool Document::IsCrLf(int pos) {
|
||||
bool Document::IsDBCS(int pos) {
|
||||
#if PLAT_WIN
|
||||
if (dbcsCodePage) {
|
||||
// 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))) {
|
||||
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++;
|
||||
if (startLine >= pos)
|
||||
return true;
|
||||
}
|
||||
startLine++;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -190,6 +229,28 @@ bool Document::IsDBCS(int pos) {
|
||||
#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.
|
||||
@@ -221,29 +282,41 @@ int Document::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) {
|
||||
|
||||
#if PLAT_WIN
|
||||
if (dbcsCodePage) {
|
||||
// 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 (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;
|
||||
if (atLeadByte) {
|
||||
// Position is between a lead byte and a trail byte
|
||||
if (moveDir > 0)
|
||||
return pos + 1;
|
||||
else
|
||||
return pos - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -261,41 +334,60 @@ void Document::ModifiedAt(int pos) {
|
||||
|
||||
// Unlike Undo, Redo, and InsertStyledString, the pos argument is a cell number not a char number
|
||||
void Document::DeleteChars(int pos, int len) {
|
||||
if (cb.IsReadOnly() && enteredReadOnlyCount==0) {
|
||||
enteredReadOnlyCount++;
|
||||
NotifyModifyAttempt();
|
||||
enteredReadOnlyCount--;
|
||||
}
|
||||
if (enteredCount == 0) {
|
||||
enteredCount++;
|
||||
if (cb.IsReadOnly())
|
||||
NotifyModifyAttempt();
|
||||
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);
|
||||
int modFlags = SC_MOD_DELETETEXT | SC_PERFORMED_USER;
|
||||
DocModification mh(modFlags, pos, len, LinesTotal() - prevLinesTotal, text);
|
||||
NotifyModified(mh);
|
||||
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())
|
||||
NotifyModifyAttempt();
|
||||
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);
|
||||
|
||||
int modFlags = SC_MOD_INSERTTEXT | SC_PERFORMED_USER;
|
||||
DocModification mh(modFlags, position / 2, insertLength / 2, LinesTotal() - prevLinesTotal, text);
|
||||
NotifyModified(mh);
|
||||
NotifyModified(
|
||||
DocModification(
|
||||
SC_MOD_INSERTTEXT | SC_PERFORMED_USER,
|
||||
position / 2, insertLength / 2,
|
||||
LinesTotal() - prevLinesTotal, text));
|
||||
}
|
||||
enteredCount--;
|
||||
}
|
||||
@@ -307,9 +399,18 @@ int Document::Undo() {
|
||||
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.UndoStep();
|
||||
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;
|
||||
@@ -344,10 +445,17 @@ int Document::Redo() {
|
||||
int steps = cb.StartRedo();
|
||||
for (int step=0; step<steps; step++) {
|
||||
int prevLinesTotal = LinesTotal();
|
||||
const Action &action = cb.RedoStep();
|
||||
int cellPosition = action.position / 2;
|
||||
ModifiedAt(cellPosition);
|
||||
newPos = cellPosition;
|
||||
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) {
|
||||
@@ -358,7 +466,8 @@ int Document::Redo() {
|
||||
}
|
||||
if (step == steps-1)
|
||||
modFlags |= SC_LASTSTEPINUNDOREDO;
|
||||
NotifyModified(DocModification(modFlags, cellPosition, action.lenData,
|
||||
NotifyModified(
|
||||
DocModification(modFlags, action.position / 2, action.lenData,
|
||||
LinesTotal() - prevLinesTotal, action.data));
|
||||
}
|
||||
|
||||
@@ -395,14 +504,13 @@ void Document::InsertString(int position, const char *s, int insertLength) {
|
||||
}
|
||||
}
|
||||
|
||||
void Document::ChangeChar(int pos, char ch) {
|
||||
DeleteChars(pos, 1);
|
||||
InsertChar(pos, ch);
|
||||
}
|
||||
|
||||
void Document::DelChar(int pos) {
|
||||
if (IsCrLf(pos)) {
|
||||
DeleteChars(pos, 2);
|
||||
} else if (IsDBCS(pos)) {
|
||||
DeleteChars(pos, 2);
|
||||
} else if (pos < Length()) {
|
||||
DeleteChars(pos, 1);
|
||||
}
|
||||
DeleteChars(pos, LenChar(pos));
|
||||
}
|
||||
|
||||
int Document::DelCharBack(int pos) {
|
||||
@@ -411,6 +519,10 @@ int Document::DelCharBack(int 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;
|
||||
@@ -420,27 +532,80 @@ int Document::DelCharBack(int pos) {
|
||||
}
|
||||
}
|
||||
|
||||
static bool isindentchar(char ch) {
|
||||
return (ch == ' ') || (ch == '\t');
|
||||
}
|
||||
|
||||
static int NextTab(int pos, int tabSize) {
|
||||
return ((pos / tabSize) + 1) * tabSize;
|
||||
}
|
||||
|
||||
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) {
|
||||
int pos = LineStart(line);
|
||||
int length = Length();
|
||||
while ((pos < length) && isindentchar(cb.CharAt(pos))) {
|
||||
pos++;
|
||||
}
|
||||
return pos;
|
||||
}
|
||||
|
||||
void Document::Indent(bool forwards, int lineBottom, int lineTop) {
|
||||
if (forwards) {
|
||||
// Indent by a tab
|
||||
for (int line = lineBottom; line >= lineTop; line--) {
|
||||
InsertChar(LineStart(line), '\t');
|
||||
}
|
||||
} else {
|
||||
// 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 ispc = 0;
|
||||
while (ispc < tabInChars && cb.CharAt(LineStart(line) + ispc) == ' ')
|
||||
ispc++;
|
||||
int posStartLine = LineStart(line);
|
||||
if (ispc == tabInChars) {
|
||||
DeleteChars(posStartLine, ispc);
|
||||
} else if (cb.CharAt(posStartLine + ispc) == '\t') {
|
||||
DeleteChars(posStartLine, ispc + 1);
|
||||
} else { // Hit a non-white
|
||||
DeleteChars(posStartLine, ispc);
|
||||
}
|
||||
}
|
||||
// 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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -485,6 +650,8 @@ void Document::ConvertLineEnds(int eolModeSet) {
|
||||
}
|
||||
|
||||
bool Document::IsWordChar(unsigned char ch) {
|
||||
if ((SC_CP_UTF8 == dbcsCodePage) && (ch >0x80))
|
||||
return true;
|
||||
return wordchars[ch];
|
||||
}
|
||||
|
||||
@@ -551,16 +718,14 @@ long Document::FindText(int minPos, int maxPos, const char *s, bool caseSensitiv
|
||||
|
||||
// Compute actual search ranges needed
|
||||
int lengthFind = strlen(s);
|
||||
int endSearch = 0;
|
||||
int endSearch = endPos;
|
||||
if (startPos <= endPos) {
|
||||
endSearch = endPos - lengthFind + 1;
|
||||
} else {
|
||||
endSearch = endPos;
|
||||
}
|
||||
//Platform::DebugPrintf("Find %d %d %s %d\n", startPos, endPos, ft->lpstrText, lengthFind);
|
||||
char firstChar = s[0];
|
||||
if (!caseSensitive)
|
||||
firstChar = toupper(firstChar);
|
||||
firstChar = static_cast<char>(toupper(firstChar));
|
||||
int pos = startPos;
|
||||
while (forward ? (pos < endSearch) : (pos >= endSearch)) {
|
||||
char ch = CharAt(pos);
|
||||
@@ -605,6 +770,25 @@ 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++) {
|
||||
@@ -671,6 +855,13 @@ void Document::SetStyles(int length, char *styles) {
|
||||
}
|
||||
}
|
||||
|
||||
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) &&
|
||||
|