Initial revision

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Karsten Ballüder 1998-05-20 14:01:55 +00:00
parent 1b66e7e5ab
commit c801d85f15
779 changed files with 172138 additions and 0 deletions

321
INSTALL Normal file
View File

@ -0,0 +1,321 @@
* General
----------
wxGTK uses GNU configure. If you have problems with your make use GNU
make instead.
* Create your configuration
-----------------------------
Usage:
./configure options
If you want to use system's C and C++ compiler,
set environment variables CC and CCC as
% setenv CC cc
% setenv CCC CC
% ./configure options
to see all the options please use:
./configure --help
The basic philosophy is that if you want to use different
configurations, like a debug and a release version,
or use the same source tree on different systems,
you have only to change the environment variable OSTYPE.
(Sadly this variable is not set by default on some systems
in some shells - on SGI's for example). So you will have to
set it there. This variable HAS to be set before starting
configure, so that it knows which system it tries to
configure for.
Configure will complain if the system variable OSTYPE has
not been defined. And Make in some circumstances as well...
* General options
-------------------
The following options handle the kind of library you want to build.
--with-shared Create shared libraries.
--without-optimise Do not optimise the code.
--with-profile Add profiling info to the
object files. Currently
broken.
--with-mem_tracing Add built-in memory tracing.
Not yet.
--with-debug Add debug info to object
files.
* Feature Options
-------------------
When using the Windows version of wxWindows, it is possible
to edit the file /include/wx/msw/setup.h in order to enable
or disable some features of wxWindows so that the resulting
binaries get smaller.
As I don't yet care for binary size and target mainly at
producing a shared library, wxGTK's configure system auto-
matically enables all features, as long as they are already
implemented.
* Additional libraries
-----------------------
[Note: Currently wxGTK will compile out-of-the-box
with no extra libraries required. Support for
OpenGl, threads, Python and hopefully ODBC
support will soon be added.]
wxGTK requires the GTK (The Gimp Toolkit) to be installed,
which probably makes sense.
There will be a few more features of wxGTK, which will
require further libraries (on some platforms). These
features will be optional. I hope to teach configure
to check that out automatically.
Thread support:
Requires pthreads under Linux without glibc.
OpenGl:
Requires OpenGl or MesaGl.
Python scripting language support:
Requires Python.
* Compiling
-------------
First you have to create all makefiles in all subdirectories:
make makefiles
Dependencies are generated automatically using
make depend
Now the makefiles are created you can compile everything is as simple
as typing:
make
make yourself some coffee, as it will try to compile
ALL the files in this distribution.
if you want to be more selective:
make src will build only the base libraries
make utils will build the utils
make samples will build the samples
make other will build the other samples
make user will build the files in the directory other
Depending on the configuration of some files, the libraries
and binaries will be placed in different directories.
The "global" binaries and libraries will be placed in:
bin/$(OSTYPE) and
lib/$(OSTYPE) respectively
"local" binaries and libraries will be placed in:
(basedir of that application)/$(OSTYPE).
This is also the place where all the object-files will go.
If you want to conserve disk space by removing unnecessary
object-files:
make clean_obj
will do the work for you.
* Creating a new Project
--------------------------
I propose to put all contributed programs in the directory
"user", with a directory of its own.
This directory then should include the following files:
Makefile (You can copy this one from any application in samples
probably you will not need to edit this one. There is
only one case where you might be interested in changing
this file, but about that see later.)
Makefile.in (This is the base application-Makefile template, from
which the actual Makefile for each system is created.
More about this later)
put ALL your source code along with all the other stuff you need for
your application in this directory (subdirectories are welcome).
** Something about Makefiles
------------------------------
On general principle it should only contain ONE line, which is as follows:
include ../../src/gtk/setup/general/makeapp
this will include all the necessary definitions for creating the applications
the only case where you might want to add another line is the following:
this version of configure also supports creation of source archives of the
application for easy distribution and updates to newer version of wxxt.
For this purpose all files in the application-directory will be put into
a gziped tar-file in the full notation user/<your application>/*
if you want to include some other files that you want "more visible", like
a README.<yourApp> or a shell script for easy
compilation/installation/distribution, then you have to add a variable
DISTRIBUTE_ADDITIONAL=<your files>
to the Makefile.
So it would look like this:
DISTRIBUTE_ADDITIONAL=README.TheApp
include ../../src/gtk/setup/general/makeapp
As we have already talked about distribution the command to create a
distribution is:
make distrib
NOTE: If you are in the base directory of wxxt it will create
distribution packages for wxxt as well as for all packages in the
user directory.
So if you want to create only packages for the files in user,
then go to the directory other and type:
make distrib
or if you only want one application to be created then
enter the specific directory and type there:
make distrib
All the distribution files will be put in the directory
distrib at the base of the wxxt-tree (where also configure
and template.mak can be found).
** Something about Makefile.in
--------------------------------
As you have already seen with Makefile, configure makes a lot of use
if the include statement in make to keep the Makefiles as simple as
possible.
So basically there are only variables to define and then a include command.
Exception to this rule is if you have special rules for some stuff...
These rules should go AFTER the include statement!!!
so the general header looks like this:
# wxGTK base directory
WXBASEDIR=@WXBASEDIR@
# set the OS type for compilation
OS=@OS@
# compile a library only
RULE=bin
and the general footer will look like this:
# include the definitions now
include ../../../template.mak
the key variable is RULE, which defines what make should create
in this directory.
here are some examples:
RULE description
===========================================================================
bin creates a local binary (for a global binary prefix bin with g)
additional variables needed:
BIN_TARGET this gives the name of your application
BIN_OBJ this gives the object files needed to
link the application
optional variables are:
BIN_SRC this gives the list of c/c++ files for
which dependencies will be checked.
(This can be achieved with: make depend)
BIN_LINK this gives commands for additional
libraries needed to link the application
---------------------------------------------------------------------------
bin2 creates two local binaries (for global binaries prefix bin2 with g)
in addition to the variables specified above you MUST also
provide the same variables with BIN2_ instead of BIN_
---------------------------------------------------------------------------
lib creates a local library (for a global binary prefix bin with g)
additional variables needed:
LIB_TARGET this gives the name of your library
LIB_OBJ this gives the object files needed for
the library to be build.
optional variables are:
LIB_SRC this gives the list of c/c++ files for
which dependencies will be checked.
libbin and libgbin are also possible and will need in addition
the variables from bin
---------------------------------------------------------------------------
gslib is similar to lib, but it creates a shared library if the system
supports it.
additional variables needed:
LIB_MAJOR major number of the shared library
LIB_MINOR minor number of the shared library
---------------------------------------------------------------------------
other additional variables:
ADD_COMPILE define additional includes/defines that
are needed to compile the object files
(if you need to reference some directory
utils - like wxGrid -, then please
reference them with the variables defined
in template.mak - e.g.: $(SRCDIR),$(UTILS),
$(SAMPLES),$(OTHERS))
NEEDED_DEFINES lists all the defines that HAVE to be set in
/include/wx/setup.h to compile correctly.
SRC_DIR lists all directories that are needed to
compile. (i.e: lists all the directories,
where there are source-files.) But it is
also needed to clean an object and for
machines, for which make does not support
VPATH
currently there are the following compiling rules provided:
object files are created for the following file extensions:
.c .cc .cpp
Please have a closer look at the Makefiles in this distribution.
* Platforms configure is working with
---------------------------------------
Please report build succes on any machine. Especially non-
Linux operating systems (which I don't have).
Original author of the autoconf system for wxxt-1.66 and for this INSTALL
file:
Martin Sperl sperl@dsn.ast.univie.ac.at
Ported to wxGTK 0.1:
Wolfram Gloger wmglo@dent.med.uni-muenchen.de
Thanks alot to both of them.
In the hope that it will be useful,
Robert Roebling roebling@sun2.ruf.uni-freiburg.de

167
Makefile Normal file
View File

@ -0,0 +1,167 @@
# Top-level Makefile for wxGTK by Wolfram Gloger
# based on the version for wx-Xt by Martin Sperl
SHELL=/bin/sh
#if DIRS are defind make only executes in these diretories
all::
@if test "x$(DIRS)" = x; then \
for i in src samples utils user; do \
echo "entering directory $$i building $@"; \
(cd $$i; ${MAKE} -k $@); \
done; \
else \
for i in $(DIRS) xxx; do \
if test "$$i" != xxx; then \
echo "entering directory $$i building $@"; \
(cd $$i; ${MAKE} -k $@); \
fi; \
done; \
fi
# what to do if a target is not understood:
# pass it on to all the children...
.DEFAULT::
@if test "x$(DIRS)" = x; then \
for i in src samples utils user; do \
echo "entering directory $$i building $@"; \
(cd $$i; ${MAKE} -k $@); \
done; \
else \
for i in $(DIRS) xxx; do \
if test "$$i" != xxx; then \
echo "entering directory $$i building $@"; \
(cd $$i; ${MAKE} -k $@); \
fi; \
done; \
fi
src::
@echo "entering directory src building all"
@cd src; ${MAKE} all
samples::
@echo "entering directory samples building all"
@cd samples; ${MAKE} all
utils::
@echo "entering directory utils building all"
@cd utils; ${MAKE} all
user::
@echo "entering directory user building all"
@cd user; ${MAKE} all
# the following ones recreate all Makefiles.
makefiles:: recreate
Makefiles:: recreate
recreate::
@src/gtk/setup/general/createall
# the following ones define what needs to be done to distribute the
# library and its components
distribute:: distrib
distrib:: distrib_base distrib_user join_utils join_samples
distrib_samples::
@echo "entering directory samples creating distribution files"
@(cd samples; ${MAKE} -k distrib)
distrib_user::
@echo "entering directory user creating distribution files"
@(cd user; ${MAKE} -k distrib)
distrib_utils::
@echo "entering directory utils creating distribution files"
@(cd utils; ${MAKE} -k distrib)
join_utils:: distrib_utils
@$(MAKE) join \
BASEDIR=utils \
FILES=`echo distrib/utils/*.tgz `
join_samples:: distrib_samples
@$(MAKE) join \
BASEDIR=samples \
FILES=`echo distrib/samples/*.tgz `
join_user:: distrib_user
@$(MAKE) join \
BASEDIR=user \
FILES=`echo distrib/user/*.tgz `
join::
@# needed are BASEDIR and FILES
@if test "x$$BASEDIR" = x; then\
echo "BASEDIR not specified.";\
exit -1;\
fi
@if test "x$$FILES" != x ; then \
echo "putting all seperate distribution files:";\
echo "$$FILES";\
echo "into distrib/$(BASEDIR).tgz";\
src/gtk/setup/general/jointar $(BASEDIR) $$FILES distrib/$(BASEDIR).tgz; \
else \
echo "Nothing to join - deleting..."; \
echo "This may be the case, if you have not specified FILES."\
rm -f distrib/$(BASEDIR).tgz; \
fi
distrib_base::
@if test ! -d distrib ; then mkdir distrib; fi;
@if test ! -f system.list ; then \
echo "dummy" > system.list;\
fi
@(curr=`pwd`; direc=`basename $$curr`;\
(cd ..; \
echo creating distrib/$$direc.tar from the current directory;\
tar -cf /tmp/$$direc.tar \
$$direc/COPYING\
$$direc/INSTALL\
$$direc/Makefile\
$$direc/template.mak\
$$direc/configure\
$$direc/configure.in\
$$direc/config.guess\
$$direc/config.sub\
$$direc/install-sh\
$$direc/user/Makefile \
$$direc/utils/Makefile \
$$direc/samples/Makefile \
;\
sed "s|^\(.*\)$$|/\1/|g" $$direc/system.list \
| uniq > /tmp/$$direc.list; \
echo "/RCS/" >> /tmp/$$direc.list; \
for each in misc docs wx src setup; do \
tar -uf /tmp/$$direc.tar \
`\
find $$direc/$$each \( -type f -o -type l \) -print \
| fgrep -vf /tmp/$$direc.list \
| grep -v "[~#]$$" \
` ;\
done; \
echo compressing $$direc.tar to $$direc.tgz;\
gzip -9 -c /tmp/$$direc.tar > $$direc/distrib/$$direc.tgz;\
rm /tmp/$$direc.tar /tmp/$$direc.list;\
)\
)
# the following ones are only needed if configure.in has changed
# and needs to be updated...
config:: configure
configure::
@autoconf
@cat configure \
| sed "s/config.cache/\$$OSTYPE.config.cache/g" \
| sed "s/config.status/\$$OSTYPE.config.status/g" \
| sed "s/\*\*--/ --/g" \
> configure1
@chmod a+x configure1
@mv configure1 configure

599
config.guess vendored Executable file
View File

@ -0,0 +1,599 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Written by Per Bothner <bothner@cygnus.com>.
# The master version of this file is at the FSF in /home/gd/gnu/lib.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
# The plan is that this can be called by configure scripts if you
# don't specify an explicit system type (host/target name).
#
# Only a few systems have been added to this list; please add others
# (but try to keep the structure clean).
#
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 8/24/94.)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
alpha:OSF1:[VX]*:*)
# After 1.2, OSF1 uses "V1.3" for uname -r.
# After 4.x, OSF1 uses "X4.x" for uname -r.
echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VX]//'`
exit 0 ;;
alpha:OSF1:*:*)
# 1.2 uses "1.2" for uname -r.
echo alpha-dec-osf${UNAME_RELEASE}
exit 0 ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit 0 ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-cbm-sysv4
exit 0;;
amiga:NetBSD:*:*)
echo m68k-cbm-netbsd${UNAME_RELEASE}
exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
Pyramid*:OSx*:*:*)
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
else
echo pyramid-pyramid-bsd
fi
exit 0 ;;
sun4*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
i86pc:SunOS:5.*:*)
echo i386-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
exit 0 ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit 0 ;;
atari*:NetBSD:*:*)
echo m68k-atari-netbsd${UNAME_RELEASE}
exit 0 ;;
sun3*:NetBSD:*:*)
echo m68k-sun-netbsd${UNAME_RELEASE}
exit 0 ;;
mac68k:NetBSD:*:*)
echo m68k-apple-netbsd${UNAME_RELEASE}
exit 0 ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
mips:*:4*:UMIPS)
echo mips-mips-riscos4sysv
exit 0 ;;
mips:*:5*:RISCos)
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit 0 ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
exit 0 ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
exit 0 ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
exit 0 ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`uname -p`
if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88100 ] ; then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
echo m88k-dg-dgux${UNAME_RELEASE}
else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else echo i586-dg-dgux${UNAME_RELEASE}
fi
exit 0 ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit 0 ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
exit 0 ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
exit 0 ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
exit 0 ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
exit 0 ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i[34]86:AIX:*:*)
echo i386-ibm-aix
exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
sed 's/^ //' << EOF >dummy.c
#include <sys/systemcfg.h>
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
exit 0 ;;
*:AIX:*:4)
if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=4.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit 0 ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit 0 ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
exit 0 ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit 0 ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
exit 0 ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
exit 0 ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
exit 0 ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit 0 ;;
9000/[3478]??:HP-UX:*:*)
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/7?? | 9000/8?[679] ) HP_ARCH=hppa1.1 ;;
9000/8?? ) HP_ARCH=hppa1.0 ;;
esac
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
3050*:HI-UX:*:*)
sed 's/^ //' << EOF >dummy.c
#include <unistd.h>
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
exit 0 ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit 0 ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit 0 ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit 0 ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit 0 ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit 0 ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
exit 0 ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
exit 0 ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit 0 ;;
CRAY*X-MP:*:*:*)
echo xmp-cray-unicos
exit 0 ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE}
exit 0 ;;
CRAY*C90:*:*:*)
echo c90-cray-unicos${UNAME_RELEASE}
exit 0 ;;
CRAY-2:*:*:*)
echo cray2-cray-unicos
exit 0 ;;
hp3[0-9][05]:NetBSD:*:*)
echo m68k-hp-netbsd${UNAME_RELEASE}
exit 0 ;;
i[34]86:BSD/386:*:* | *:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
*:NetBSD:*:*)
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
i*:CYGWIN*:*)
echo i386-unknown-cygwin32
exit 0 ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin32
exit 0 ;;
*:GNU:*:*)
echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
*:Linux:*:*)
# 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`
if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i[345]86"; then
echo "${UNAME_MACHINE}-unknown-linux" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i[345]86linux"; then
echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i[345]86coff"; then
echo "${UNAME_MACHINE}-unknown-linuxcoff" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then
echo "${UNAME_MACHINE}-unknown-linux" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then
echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0
elif test "${UNAME_MACHINE}" = "alpha" ; then
echo alpha-unknown-linux ; exit 0
else
# Either a pre-BFD a.out linker (linuxoldld) or one that does not give us
# useful --help. Gcc wants to distinguish between linuxoldld and linuxaout.
test ! -d /usr/lib/ldscripts/. \
&& echo "${UNAME_MACHINE}-unknown-linuxoldld" && exit 0
# Determine whether the default compiler is a.out or elf
cat >dummy.c <<EOF
main(argc, argv)
int argc;
char *argv[];
{
#ifdef __ELF__
printf ("%s-unknown-linux\n", argv[1]);
#else
printf ("%s-unknown-linuxaout\n", argv[1]);
#endif
return 0;
}
EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
fi ;;
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
# are messed up and put the nodename in both sysname and nodename.
i[34]86:DYNIX/ptx:4*:*)
echo i386-sequent-sysv4
exit 0 ;;
i[34]86:*:4.*:* | i[34]86:SYSTEM_V:4.*:*)
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
else
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}
fi
exit 0 ;;
i[34]86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
echo ${UNAME_MACHINE}-unknown-isc$UNAME_REL
elif /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-unknown-sysv32
fi
exit 0 ;;
Intel:Mach:3*:*)
echo i386-unknown-mach3
exit 0 ;;
paragon:*:*:*)
echo i860-intel-osf1
exit 0 ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
exit 0 ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
exit 0 ;;
M680[234]0:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0)
uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4.3 && exit 0 ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4 && exit 0 ;;
m680[234]0:LynxOS:2.[23]*:*)
echo m68k-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
i[34]86:LynxOS:2.[23]*:*)
echo i386-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.[23]*:*)
echo sparc-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
rs6000:LynxOS:2.[23]*:*)
echo rs6000-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit 0 ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
echo ${UNAME_MACHINE}-sni-sysv4
else
echo ns32k-sni-sysv
fi
exit 0 ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit 0 ;;
R3000:*System_V*:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
cat >dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
printf ("arm-acorn-riscix"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
printf ("m68k-hp-bsd\n"); exit (0);
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
printf ("%s-next-nextstep%s\n", __ARCHITECTURE__, version==2 ? "2" : "3");
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-unknown-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
#if !defined (ultrix)
printf ("vax-dec-bsd\n"); exit (0);
#else
printf ("vax-dec-ultrix\n"); exit (0);
#endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
# Convex versions that predate uname can use getsysinfo(1)
if [ -x /usr/convex/getsysinfo ]
then
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
exit 0 ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit 0 ;;
c34*)
echo c34-convex-bsd
exit 0 ;;
c38*)
echo c38-convex-bsd
exit 0 ;;
c4*)
echo c4-convex-bsd
exit 0 ;;
esac
fi
#echo '(Unable to guess system type)' 1>&2
exit 1

927
config.sub vendored Executable file
View File

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

6572
configure vendored Executable file

File diff suppressed because it is too large Load Diff

1453
configure.in Normal file

File diff suppressed because it is too large Load Diff

227
docs/changes.txt Normal file
View File

@ -0,0 +1,227 @@
Generic wxWindows 2.0 Change Log
--------------------------------
Note: for platform-specific changes, see wx/docs/XXX/changes.txt
where XXX is one of msw, motif, xt, gtk, mac.
Alpha 9, April 27th 1998
------------------------
- Corrected some bugs, such as the wxModule compilation problem.
- Added Gnu-Win32 b19/Mingw32 support by changing resource
compilation and pragmas.
- Changed SIZEOF to WXSIZEOF.
Alpha 8, April 17th 1998
------------------------
- Added src/other/png, src/other/zlib directories.
- Added samples/png.
- IMPORTANT: Changed 'no id' number from 0 to -1, in wxEVT_ macros.
Porters, please check particularly your wxTreeCtrl and wxListCtrl
header files.
- Added modules.h/cpp, config.cpp, fileconf.cpp, textfile.cpp/h.
Alpha 7, March 30th 1998
------------------------
- Added tab classes, tab sample.
- Revised memory.cpp, memory.h slightly; memory.h now #defines
new to WXDEBUG_NEW in DEBUG mode. Windows implementation app.cpp
now checks for leaks on exit. Added memcheck sample.
See src/msw/issues.txt for more details.
- resource.h, resource.cpp changed to make wxDefaultResourceTable
a pointer. Now initialize resource system with
wxInitializeResourceSystem and wxCleanUpResourceSystem, to
allow better control of memory.
- wxString now derives from wxObject, to enable memory leak
checking.
- Added some #include fixes in various files, plus changed
float to long in wxToolBar files.
Alpha 6, March 10th 1998
------------------------
- Added Vadim's dynarray.h, dynarray.cpp.
- Added Vadim's menuitem.cpp.
- Added Windows-specific wxCheckListBox,
owner-draw wxListBox, and drag-and-drop
(see docs/msw/changes.txt).
Alpha 5, 14th February 1998
--------------------------
- GENERIC AND MSW-SPECIFIC CODE NOW TREATED AS TWO SEPARATE
DISTRIBUTIONS. This change log will therefore now refer to
the generic code only. See docs/msw/changes.txt for Windows-specific
changes.
- Readmes, change logs and installation files now go in
platform-specific directories under docs, e.g. docs/msw,
docs/gtk.
- Added DECLARE_APP and IMPLEMENT_APP macros so wxApp object gets
created dynamically, not as a global object.
- Put wxColour into wx/msw/colour.h, src/msw/colour.cpp.
- Changed names of some include/wx/generic headers to be
consistent and to conform to gcc pragma conventions. Also
changed choicesg.cpp to choicdgg.cpp.
- Added gcc pragmas.
- Added gtk inclusion in include/wx headers.
- Added consistent file headings to source and headers.
- Removed lang.cpp, lang.h and references to wxSTR_... variables;
added a few references to wxTransString.
- Added operator to wxTransString that converts automatically
to wxString, so we can say e.g. wxMessageBox(wxTransString("Hello"), ...).
- samples/internat now works (minimally).
- Added wxMouseEvent::GetPosition and
wxMouseEvent::GetLogicalPosition, both returning wxPoints.
- Made wxSize and wxRect contain longs not ints.
- Cured some lemory leaks (thanks Vadim).
- Tidied up OnIdle and introduced RequestMore/MoreRequested so
will only keep processing OnIdle if it returns TRUE from
MoreRequested.
Alpha 4, 31st January 1998
--------------------------
- Changed wxDC functions to take longs instead of floats. GetSize now takes
integer pointers, plus a version that returns a wxSize.
- const keyword added to various wxDC functions.
- Under Windows, wxDC no longer has any knowledge of whether
an associated window is scrolled or not. Instead, the device
origin is set by wxScrolledWindow in wxScrolledWindow::PrepareDC.
- wxScrolledWindow applications can optionally override the virtual OnDraw
function instead of using the OnPaint event handler. The wxDC passed to
OnDraw will be translated by PrepareDC to reflect scrolling.
When drawing outside of OnDraw, must call PrepareDC explicitly.
- wxToolBarBase/wxToolBarSimple similarly changed to allow for
scrolling toolbars.
- Integrated wxPostScriptDC patches for 1.xx by Chris Breeze,
to help printing with multiple pages.
- IPC classes given base classes (wxConnectionBase etc.) which
define the API used by different implementations. DDE
implementation updated to use these base classes.
- wxHelpInstance now separated into wxHelpControllerBase (base
for all implementations), wxWinHelpController (uses standard
WinHelp), wxXLPHelPController (talks to wxHelp by DDE or
TCP/IP). There will be others eventually, such as
wxHTMLHelpController for Microsoft (and Netscape?) HTML Help.
- Added Vadim Zeitlin's wxString class plus
internationalization code (gettext simulation, wxLocale, etc.).
New files from Vadim:
include\wx\string.h
include\wx\debug.h
include\wx\file.h
include\wx\log.h
include\wx\intl.h
src\common\string.cpp
src\common\log.cpp
src\common\intl.cpp
src\common\file.cpp
No longer use GNU wxString files.
- Split off file-related functions into include\wx\filefn.h and
src\common\filefn.cpp.
- Borland C++ support (WIN32) for main library and
samples, using makefile.b32 files.
- Preparation done for allowing BC++ to compile wxWin as a DLL,
including changes to defs.h.
- wxIntPoint removed, wxPoint is now int, and wxRealPoint
introduced.
- Added wxShowEvent (generated when window is being shown or
hidden).
- Got minimal, docview, mdi samples working for 16-bit VC++ and
cured 16-bit problem with wxTextCtrl (removed global memory
trick).
- Updated GnuWin32 makefiles, checked minimal, mdi, docview samples.
Alpha 3, September 1997
-----------------------
- wxListCtrl, wxTreeCtrl, wxImageList classes done.
- Instigated new file hierarchy, split files and classes up more logically.
- PrologIO and some other utils now put into core library.
- Revamped print/preview classes, added wxPageSetupDialog.
- Started documentation.
Alpha 2, 30th April 1997
------------------------
- EVT_... macros now have at least one argument, for conformance
with MetroWerks compiler.
- Added ids to .wxr file format.
- Got Dialog Editor compiled and running again but need
to extend functionality to be in line with new controls.
Added dialoged\test app to allow dynamic loading of .wxr files
for testing purposes.
- Rewrote wxBitmap to allow installable file type
handlers.
- Rewrote wxBitmapButton, wxStaticBitmap to not use Fafa.
- Wrote most of wxTreeCtrl and sample (need wxImageList to implement it
fully).
- Added back wxRadioBox.
- Tidied up wx_main.cpp, wxApp class, putting PenWin code in
a separate file.
Alpha 1, 5th April 1997
-----------------------
At this point, the following has been achieved:
- A lot, but not all, of the code has been revamped for better
naming conventions, protection of data members, and use of
wxString instead of char *.
- Obsolete functionality deleted (e.g. default wxPanel layout,
old system event system) and code size reduced.
- Class hierarchy changed (see design doc) - base classes such
as wxbWindow now removed.
- No longer includes windows.h in wxWin headers, by using stand-in
Windows types where needed e.g. WXHWND.
- PrologIO revised.
- wxScrolledWindow, wxStatusBar and new MDI classes added.
MDI is now achived using separate classes, not window styles.
- wxSystemSettings added, and made use of to reflect standard
Windows settings.
- SetButtonFont/SetLabelFont replaced by SetFont; font and colour
settings mucho rationalised.
- All windows are now subclassed with the same window proc to make
event handling far more consistent. Old internal wxWnd and derived
classes removed.
- API for controls revised, in particular addition of
wxValidator parameters and removal of labels for some controls.
- 1 validator written: see examples/validate.
- Event table system introduced (see most samples and
wx_event.cpp/ProcessEvent, wx_event.h). wxEvtHandler
made more flexible, with Push/PopEventHandler allowing a chain
of event handlers.
- wxRadioBox removed - will be added back soon.
- Toolbar class hierarchy revised:
wxToolBarBase
wxToolBarSimple (= old wxToolBar)
wxToolBar95 (= old wxButtonBar under Win95
wxToolBarMSW (= old wxButtonBar under WIN16/WIN32)
- Constraint system debugged somewhat (sizers now work properly).
- wxFileDialog, wxDirDialog added; other common dialogs now
have class equivalents. Generic colour and font dialogs
rewritten to not need obsolete panel layout.
- .wxr resource system partially reinstated, though needs
an integer ID for controls. Hopefully the resource system
will be replaced by something better and more efficient
in the future.
- Device contexts no longer stored with window and accessed
with GetDC - use wxClientDC, wxPaintDC, wxWindowDC stack
variables instead.
- wxSlider uses trackbar class under Win95, and wxSL_LABELS flag
determines whether labels are shown. Other Win95-specific flags
introduced, e.g. for showing ticks.
- Styles introduced for dealing with 3D effects per window, for
any window: all Win95 3D effects supported, plus transparent windows.
- Major change to allow 3D effect support without CTL3D, under
Win95.
- Bitmap versions of button and checkbox separated out into new
classes, but unimplemented as yet because I intend to remove
the need for Fafa - it apparently causes GPFs in Win95 OSR 2.
- utils/wxprop classes working (except maybe wxPropertyFormView)
in preparation for use in Dialog Editor.
- GNU-WIN32 compilation verified (a month or so ago).

292
docs/gtk/welcome.html Normal file
View File

@ -0,0 +1,292 @@
<html>
<head><title>wxGTK Homepage</title>
</head>
<body bgcolor=#FFFFFF text=#000000 link=#0020FF vlink=#800000 alink=#007777>
<h1>"wxWindows for the GTK" Homepage</h1>
<hr>
<h3>Current version</h3>
15th May '98: wxGTK v0.12 (alpha-)
<p>
This release is hardly more stable than the one before, but it
has many new features. It's main purpose is actually to prepare
the final merge of the Windows port and the GTK port source
trees into a common tree, developed using CVS. The growing
number of demos which compile and run with wxGTK "although"
being written for wxMSW shows that we seem to be on the right
track. One nice new feature for many potential users is that
wxGTK no longer needs any extra libraries to be installed,
other than the GTK.
<p>
If you have a compiler
better than gcc 2.7.2.2 then you can uncomment a line in src/common/prntbase.cpp
which defines __GOOD_COMPILER__. This should make the printing demo work.
I haven't got such a compiler, so I actually don't know. Somebody reported
problems with version 2.7.2.3 as well.
<p>
<hr>
<h3>Acknowledgements</h3>
I'd like to thank the
<a href="http://www.freiburg.linux.de">Freiburg Linux User Group</a>
for kindly providing
this site and Christian Wetzel in particular for helping me with
this site's administration.
<p>
<hr>
<h3>What is wxWindows?</h3>
wxWindows is a C++ cross-platform GUI toolkit written mainly by Julian Smart.
More information about wxWindows can be found at the
<a href="http://web.ukonline.co.uk/julian.smart/wxwin">wxWindows Homepage</a>.
<p>
The current version of wxWindows (v1.68) supports Windows ('95 and NT), Motif and
XView (aka OpenLook). There is another port (wxXt) available, which uses the
free-ware widget set from the Free Widget Foundation (FSF). Ports have been
started for the Mac, OS/2 and NextStep.
<p>
For different reasons, it was decided to start a complete rewrite of wxWindows,
which will then be called wxWindows 2.0. For a list of new features and changes
from the current version, you may read the wxWindows Homepage (see above).
<p>
Currently, work is being done on four ports of wxWindows 2.0:
<dl>
<li> Windows (wxMSW, main author Julian Smart)
<li> Unix, Motif (wxMotif, main author Markus Holzhem)
<li> Unix, GIMP Toolkit (wxGTK, main author Robert Roebling)
<li> Macintosh (wxMac, main author Greg Whitehead)
</dl>
<p>
wxWindows provides a rich set of classes which help to make cross-platform
GUI programming easy. In many aspect, it is modelled after MFC, making transition
from MFC to wxWindows relatively painless. The main technical
difference between most other free or commercial cross platform libraries is
that wxWindows is a wrapper around existing widget sets, whereas the other
toolkits (Qt, Tk, Java, Amulet, OPaC, JX, Fresko) draw their widgets themselves,
which results in applications having a different look than native applications
for that specific platform.
<p>
There are classes for the following categories
<dl>
<li> Window classes: wxWindow, wxFrame, wxDialogBox, wxPanel, wxCanvas etc.
<li> Widget classes: wxButton, wxCheckbox, wxChoice, wxListBox, wxListCtrl, wxText, wxGauge etc.
<li> Data structures: wxList, wxString, wxHashTable, wxDate etc.
<li> Layout/constraint system
<li> GDI classes: wxPen, wxBrush, wxFont, wxBitmap etc.
<li> Events: wxCommandEvent, wxMouseEvent, wxKeyEvent etc.
<li> Devices contexts: wxCanvasDC, wxPostScriptDC, wxMemoryDC, wxPrinterDC
<li> Base classes for runtime-type information: wxObject
<li> Interprocess communication: wxClient, wxConnection, wxSocket, wxServer etc.
<li> Document-view architecture: wxDocument, wxView, wxDocManager etc.
<li> Printing framework: wxPreviewFrame, wxPrintDialog, wxPrinter etc.
<li> Many helper classes, wxApplication, wxTypeTree, wxPathList etc.
<li> Classes for internationalization
<li> Built-in memory leak checking, log-files
<li> A multitude of functions and macros
</dl>
<hr>
<h3>Copyright</h3>
The choice of a suitable copyright has been subject to endless discussions. It
has always been the aim, to put wxWindows under a copyright, which protects
the work of its authors while at the same time encouraging the use of wxWindows
in as many projects as possible.
<p>
The (so far) last decision has been to put the whole of wxWindows
under a modified (less restrictive) version of the GNU library general
public license.
<p>
The only exception is that wxGTK now contains code (gdk_imlib) which is
under the GNU library general public license. When you make changes to
this part of wxGTK, you'll have to make these changes public (in contrast
to changes to the rest).
<p>
It is obviously encouraged that anybody who uses wxWindows and who
makes any improvements to it will make these changes available to
wxWindows' authors.
<p>
<hr>
<h3>What can I do with wxWindows 2.0?</h3>
wxWindows is still in alpha stage, which means that there are still bugs
waiting for you and several features are not yet (fully) implemented, but
you can expect the interface to be more or less stable, so no major
modifications will have to be made to your source code. wxGTK is already
used in a number of medium sized projects and is it being developped
in close cooperation with the authors of these applications.
<p>
<hr>
<h3>Can I write a GNOME application with wxGTK 2.0?</h3>
Good question. The idea to use wxGTK for the GNOME desktop environment is
quite obvious. When this topic came up on the GNOME mailing list, the GNOME
people have shown an amazingly negative opinion about wxWindows. One reason
might be that several of the main authors of the GNOME-project consider
C++ a "broken language". I don't share that view and I am sure many people
find C++ easier to handle and better suited for GUI programming than C.
<p>
Just recently, the topic of C++ in general and wxGTK in particular appeared
again on the GNOME list. It has shown that - at least - the opinion on C++
on the GNOME list is split.
<p>
There is already a C++ wrapper for the GTK called GTK-- written by Tero Pulkkinen.
It is very small and adds very little overhead to the GTK. If platform
independence is no issue for you and you want to write a small tool
for Linux, you should probably use GTK--. Of course you can use wxGTK
for that, too :-)
<p>
<hr>
<h3>Screenshots</h3>
What would a home page of a GUI be without a screenshot? Well, as wxWindows
is a wrapper around existing widget/item sets, a wxWindows application will
look like any other native Windows, Motif, GTK or Mac application.
<p>
But for those of you, who wouldn't download wxGTK only because there
is no screenshot,
<a href="ftp://ftp.freiburg.linux.de/pub/linux/wxxt/sshot.jpg">here it comes</a>.
<p>
<hr>
<h3>Download 1.68</h3>
Go to the
<a href="ftp://ftp.freiburg.linux.de/pub/linux/wxxt">FTP</a>
section directly.
<p>
There is documentation for version 1.68 in html available.
<a href="ftp://ftp.freiburg.linux.de/pub/linux/wxxt">here</a>. Not yet.
<p>
You can download current wxWindows version 1.68 for Windows, Motif and
XView from
<a href="ftp://ftp.freiburg.linux.de/pub/linux/wxxt">here</a>. Not yet.
<p>
You can download wxXt 1.66d from
<a href="ftp://ftp.freiburg.linux.de/pub/linux/wxxt/wxxt166d.tgz">here</a>.
<p>
<hr>
<h3>Download 2.0 alpha</h3>
There is documentation for version 2.0 in html available.
<a href="ftp://ftp.freiburg.linux.de/pub/linux/wxxt/wxGTK_doc.tgz">here</a>.
<p>
You can download the first alpha for wxWindows 2.0 for Windows from
<a href="ftp://ftp.freiburg.linux.de/pub/linux/wxxt/">here</a>. Not yet.
<p>
You can download the current alpha for wxWindows 2.0 for GTK from
<a href="ftp://ftp.freiburg.linux.de/pub/linux/wxxt/wxGTK-0.12.tgz">here</a>.
<p>
<hr>
<h3>News from wxGTK 0.12</h3>
<p>
PNG, zlib and gdk_imlib code included.
<p>
MDI implementation. More a basis for further testing
than of real value.
<p>
Split "--with-debug" option into two options: "--with-debug_info"
and "--with-debug_flag". The first one sets the "-g" flag when
compiling, the second defines "DEBUG" in setup.h (which is included
from defs.h).
<p>
Merged DocView framework. The sample doesn't compile yet, because
it uses features from wxTextCtrl, which I haven't implemented yet.
<p>
Merged TabCtrl. Doesn't look perfect, but it seems to work.
<p>
Merged remaining classes from the newest wxMSW alpha. (wxDynArray,
wxModule etc.).
<p>
Further updates, bug fixes or additions:
<p>
<dl>
<li> wxYield() (again)
<li> postscript support for bitmaps
<li> spline code merged
<li> several bug fixes
<li> new samples
</dl>
<p>
<hr>
<h3>Known problems</h3>
Missing implementation of:
<dl>
<li>Impossible to set new font in GTK's widgets
<li>Items containing bitmaps
<li>Masks, bitmap handlers (partially done)
<li>Gauge
<li>Combobox
<li>Palettes (colormaps)
<li>Keyboard accelerators for menus
<li>Validation
<li>Clipboard functions
<li>Resources (for use with wxIDE-to-be)
<li>Drag and Drop
<li>Threads, Interprocess communication
<li>Sockets
<li>Database classes
</dl>
<p>
<hr>
<h3>Installation of wxGTK under Linux</h3>
GTK requires an up-to-date version of the
<dl>
<li> GTK (GIMP ToolKit)
</dl>
to be installed as a shared lib on your system. wxGTK is being developped with
version 1.0.1 and it is known not to work with earlier versions.
The GTK library is available from
<a href="ftp://ftp.gtk.org/pub/">somewhere here (gtk.org).</a>
After having typed "make install" the GTK header files should be
in "/usr/local/include". Correct me, if I am wrong.
<p>
Compilation itself works as usual with autoconf:
<dl>
<li> Unpack it to a suitable subdirectory, let's say ~/wxGTK
<li> Type "cd wxGTK"
<li> Type "configure"
<li> Type "make"
</dl>
Some demos use files stored in the source directory of those demos
(e.g. internat uses files in samples/internat) whereas the binaries
will end up in samples/internat/linux. You'll have to copy the binaries
down or call them like "linux/test" from samples/internat. This is
also the case for wxTest (which should display a horse).
<p>
You can create a shared library by adding the option "--with-shared" to
the "configure" command. Afterwards, you'll have to copy the library
~/wxGTK/lib/linux (if you have Linux) to a directory in your LDPATH (e.g. /usr/X11R6/lib)
and run "ldconfig".
<p>
<hr>
<h3>Mailing list for wxGTK</h3>
The mailing list (as well as this page) is called wxxt for more
or less historical reasons.
<p>
You can subsribe to the mailing list by sending a mail to
<a href="mailto:majordomo@wesley.informatik.uni-freiburg.de">majordomo@wesley.informatik.uni-freiburg.de</a>.
This mail must contain the text "subscribe wxxt" in the body (not the subject) of the
mail. You will then get a confirmation that somebody asked majordomo to put you
on the list and you will have to confirm this once again by sending back
the authentisation, which comes in the confirmation mail. The last step
is also described in the actual confirmation mail (I think).
<p>
You can send a mail to the mailing list to the address
<a href="mailto:wxxt@www.freiburg.linux.de">wxxt@www.freiburg.linux.de</a>.
<p>
Unsubscribe by sending "unsubscribe wxxt" to majordomo (see above). Not to
the actual mailing list.
<p>
<hr>
<address>
<br>This page is maintained by <a href="mailto:roebling@sun2.ruf.uni-freiburg.de">Robert Roebling</a>.
Comments, in contrast to junk and flames, welcome.
<p>
Last changed 15th Mai '98.
</address>
</body>
</html>

224
docs/licence.txt Normal file
View File

@ -0,0 +1,224 @@
wxWindows Licence
-----------------
Copyright (c) 1998 Julian Smart, Markus Holzem
Preamble
--------
This licence is intended to protect wxWindows, its developers,
and its users, so that the considerable investment it represents
is not abused.
Unlike the wxWindows licence, you as a user are not obliged to
distribute wxWindows source code with your products. However,
you are prevented from selling the code without permission from
the authors, or denying others the rights to use or distribute
wxWindows in the way intended.
The wxWindows Licence establishes the copyright for the code and
related material, and it gives you legal permission to copy,
distribute and/or modify the library. It also asserts that no
warranty is given by the authors for this or derived code.
Finally, the licence specifies that any patent involving
wxWindows, must be licenced for everyone's free use.
wxWindows Licence
-----------------
Terms and conditions for copying, distribution and modification
1. This Licence Agreement applies to any software library which
contains a notice placed by the copyright holder or other
authorized party saying it may be distributed under the terms of
this wxWindows Licence (also called "this Licence"). Each
licencee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application
programs (which use some of those functions and data) to form
executables.
The "Library", below, refers to any such software library or
work which has been distributed under these terms. A "work
based on the Library" means either the Library or any derivative
work under copyright law: that is to say, a work containing the
Library or a portion of it, either verbatim or with
modifications and/or translated straightforwardly into another
language. (Hereinafter, translation is included without
limitation in the term "modification".)
"Source code" for a work means the preferred form of the work
for making modifications to it. For a library, complete source
code means all the source code for all modules it contains, plus
any associated interface definition files, plus the scripts used
to control compilation and installation of the library.
Activities other than copying, distribution and modification are
not covered by this Licence; they are outside its scope. The act
of running a program using the Library is not restricted, and
output from such a program is covered only if its contents
constitute a work based on the Library (independent of the use
of the Library in a tool for writing it). Whether that is true
depends on what the Library does and what the program that uses
the Library does.
2. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided
that you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep
intact all the notices that refer to this Licence and to the
absence of any warranty; and distribute a copy of this Licence
along with the Library.
You may charge a fee for the physical act of transferring a
copy, and you may at your option offer warranty protection in
exchange for a fee.
3. You may modify your copy or copies of the Library or any
portion of it, thus forming a work based on the Library, and
copy and distribute such modifications or work under the terms
of Section 1 above, provided that you cause the files modified
to carry prominent notices stating that you changed the files
and the date of any change. With agreement from the authors of
wxWindows, you may charge for value added to the Library, for
example, a commercially supported version, or a port to a new
platform. It is expected that collaboration between such
commercial interests and the free wxWindows community will yield
benefits to both parties, since wxWindows represents a
substantial investment of time and effort. It is not in the
spirit of this agreement that commercial exploitation of
wxWindows should in any way detract from the free version.
4. You may copy and distribute the Library in object code or
derived library form under the terms of Sections 1 and 2 above
provided that you accompany it with the complete corresponding
machine-readable source code.
If distribution of object code is made by offering access to
copy from a designated place, then offering equivalent access to
copy the source code from the same place satisfies the
requirement to distribute the source code, even though third
parties are not compelled to copy the source along with the
object code.
5. You may not copy, modify, sublicence, link with, or
distribute the Library except as expressly provided under this
Licence. Any attempt otherwise to copy, modify, sublicence,
link with, or distribute the Library is void, and will
automatically terminate your rights under this Licence.
However, parties who have received copies, or rights, from you
under this Licence will not have their licences terminated so
long as such parties remain in full compliance.
6. You are not required to accept this Licence, since you have
not signed it. However, nothing else grants you permission to
modify or distribute the Library or its derivative works. These
actions are prohibited by law if you do not accept this Licence.
Therefore, by modifying or distributing the Library (or any work
based on the Library), you indicate your acceptance of this
Licence to do so, and all its terms and conditions for copying,
distributing or modifying the Library or works based on it.
7. Each time you redistribute the Library (or any work based on
the Library), the recipient automatically receives a licence
from the original licensor to copy, distribute, link with or
modify the Library subject to these terms and conditions. You
may not impose any further restrictions on the recipients'
exercise of the rights granted herein. You are not responsible
for enforcing compliance by third parties to this Licence.
8. If, as a consequence of a court judgment or allegation of
patent infringement or for any other reason (not limited to
patent issues), conditions are imposed on you (whether by court
order, agreement or otherwise) that contradict the conditions of
this Licence, they do not excuse you from the conditions of this
Licence. If you cannot distribute so as to satisfy
simultaneously your obligations under this Licence and any other
pertinent obligations, then as a consequence you may not
distribute the Library at all. For example, if a patent licence
would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you,
then the only way you could satisfy both it and this Licence
would be to refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable
under any particular circumstance, the balance of the section is
intended to apply, and the section as a whole is intended to
apply in other circumstances.
It is not the purpose of this section to induce you to infringe
any patents or other property right claims or to contest
validity of any such claims; this section has the sole purpose
of protecting the integrity of the free software distribution
system which is implemented by public licence practices. Many
people have made generous contributions to the wide range of
software distributed through that system in reliance on
consistent application of that system; it is up to the
author/donor to decide if he or she is willing to distribute
software through any other system and a licencee cannot impose
that choice.
This section is intended to make thoroughly clear what is
believed to be a consequence of the rest of this Licence.
9. If the distribution and/or use of the Library is restricted
in certain countries either by patents or by copyrighted
interfaces, the original copyright holder who places the Library
under this Licence may add an explicit geographical distribution
limitation excluding those countries, so that distribution is
permitted only in or among countries not thus excluded. In such
case, this Licence incorporates the limitation as if written in
the body of this Licence.
10. The authors of wxWindows may publish revised and/or new
versions of the wxWindows Licence from time to time. Such new
versions will be similar in spirit to the present version, but
may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library specifies a version number of this Licence which applies
to it and "any later version", you have the option of following
the terms and conditions either of that version or of any later
version published by the wxWindows authors. If the Library does
not specify a licence version number, you may choose any version
ever published by the wxWindows authors.
11. If you wish to incorporate parts of the Library into other
free programs whose distribution conditions are incompatible
with these, write to the program author to ask for permission.
For software which is copyrighted by the wxWindows authors,
write to the wxWindows authors. Our decision will be guided by
the two goals of preserving the free status of all derivatives
of our free software and of promoting the sharing and reuse of
software generally.
NO WARRANTY
-----------
12. BECAUSE THE LIBRARY IS LICENCED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE
LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE
QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE
LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
SERVICING, REPAIR OR CORRECTION.
13. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO
IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS
OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH
ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS

10
docs/readme.txt Normal file
View File

@ -0,0 +1,10 @@
wxWindows 2.0 alpha
-------------------
This is an alpha distribution of wxWindows 2.0. It may be made up
of sources for different platforms from different authors.
For generic installation information, see the docs directory. For
platform-specific installation information see for example docs/msw or
docs/gtk.

56
docs/symbols.txt Normal file
View File

@ -0,0 +1,56 @@
This is a list of preprocessor symbols used in the wxWindows source.
GUIs:
-----
__X__ any X, but not GTK
__MOTIF__ Motif
__XT__ Xt; mutually exclusive with WX_MOTIF (?)
__GTK__ GTK
__XVIEW__ Obsolete!
__WINDOWS__ Any Windows
__MAC__ MacOS
__UNIX__ any Unix
__WIN95__ GUI for Windows 95 and above; NT 4.0 and above.
__WIN32__ WIN32 API
__NT__ Windows NT
__CURSES__ CURSES
OSes/machines:
__HPUX__
__SVR4__
__SYSV__
__LINUX__
__SGI__
__ULTRIX__
__BSD__
__VMS__
__SUN__ Any Sun
__SUNOS__
__SOLARIS__
__ALPHA__
__AIX__
__DATA_GENERAL__
__OSF__
__FREEBSD__
Compilers:
----------
__GNUWIN32__ Gnu-Win32 compiler
__DJGPP__ DJGPP
__GNUG__ Gnu C++ on any platform
__BORLANDC__ Borland C++
__WATCOMC__ Watcom C++
__SYMANTECC__ Symantec C++
__VISUALC__ VC++
__SUNCC__
__XLC__ ?? compiler
wxWindows modes:
----------------
__DEBUG__ usage: #ifdef __DEBUG__ (=> debug mode, else => release)
WXDEBUG usage: #if DEBUG (0: release, 1: minimal debug code, ...)

48
im_palette.pal Normal file
View File

@ -0,0 +1,48 @@
0x00 0x00 0x00
0xff 0xff 0xff
0xdd 0xdd 0xdd
0xbb 0xbb 0xbb
0x99 0x99 0x99
0x77 0x77 0x77
0x55 0x55 0x55
0x33 0x33 0x33
0x88 0x00 0x00
0xcc 0x00 0x00
0xff 0x00 0x00
0xff 0x44 0x00
0xff 0x88 0x00
0xff 0xcc 0x00
0xff 0xff 0x00
0xcc 0xcc 0x00
0x88 0x88 0x00
0x44 0x44 0x00
0x00 0x44 0x00
0x00 0x88 0x00
0x00 0xcc 0x00
0x00 0xff 0x00
0x00 0x44 0x44
0x00 0x88 0x88
0x00 0xff 0xff
0x00 0x00 0x44
0x00 0x00 0x88
0x00 0x00 0xff
0x88 0x00 0x88
0xff 0xcc 0x99
0xcc 0xaa 0x77
0xaa 0x88 0x55
0x88 0x66 0x33
0x66 0x44 0x11
0x44 0x22 0x00
0x22 0x00 0x00
0x00 0x44 0x88
0x44 0x88 0xcc
0x88 0xcc 0xff
0x00 0xcc 0x44
0x44 0x88 0x44
0x88 0xcc 0x00
0x22 0x44 0x11
0x33 0x66 0x22
0x44 0x55 0x33
0x66 0x88 0x44
0x33 0x66 0x22
0x22 0x44 0x11

99
imrc Normal file
View File

@ -0,0 +1,99 @@
################################
# Config file for Imlib #
################################
# The file that contains palette entries for a global palette for all Imlib
# based programs.
# options: full path to palette file
PaletteFile /etc/im_palette.pal
# This defines if when the display is greater than 8 bit, that it still remaps
# the images to the palette defined, rather than using "perfect" rendering
# options: yes/no
PaletteOverride no
# If remapping to the palette, whether to use Floyd-Steinberg dithering. Saying
# yes will slow things down though.
# options: yes/no
Dither yes
# when remapping to the palette, saying fast will reduce accuracy, but improve
# speed quite considerably
# options: fast/slow
Remap fast
# This turns on dithering for 15/16 bpp. This makes smooth gradients look much
# smoother - in fact almost perfect. You will find it nigh impossible to tell
# the difference between 15/16bpp dithered and 24bpp. Unless you have extra
# CPU to burn, its not recommended, unless you are a image quality freak, and
# you insist on maximum quality in 15/16bpp. It does slow things down. It
# would be best to leave it off and let the applications themselves allow
# you to select it for certain purposes only.
HighQuality off
# This option if specified off will force MIT-SHM off, otherwise will allow
# Imlib to work it out itself.
Mit-Shm on
# This will turn shared pixmaps on or off (off forces off, on lets imlib
# work it out). This is yet another speedup. leave it on unless it doesn't
# work.. then turn it off.
SharedPixmaps off
# This speeds up rendering considerably, but may not work on your hardware
# due to it bypassing a few layers and byte-twiddling the rendered image data
# manually, and due to endianess, bit-ordering or RGB ordering it may screw up
# and not work, so try it.. if things work great!, if not, wait until a
# renderer for your situation is written, or write one yourself and donate
# it. It's easy to do, just look at rend.c
FastRender on
# This is in fact a workaround due to Solaris's shared memory theories.
# This specifies the maximum size of a shared memory chunk in bytes. If an
# image is larger that this in bytes for the video mode you're in, imlib will
# not use MIT-SHM. if you comment this out, imlib will use as much memory as
# necessary to render the image.
# Shm_Max_Size 1000000
# This turns Image loading (24) bit caching on or off. HIGHLY suggested to be
# turned ON!
Image_Cache on
# Image cache size in bytes. As with any cache, the more, the better. If you
# load the same image more than once. Imlib will used a previously loaded
# copy, and if its freed, the Image_Cache_Size amount of bytes of image data
# are kept even after being freed, in case the same image is loaded again soon
# afterwards. Neat eh?
Image_Cache_Size 4000000
# This turns the pixmap caching system on or off. If on, only well-behaved
# programs that conform to the specs for using Imlib will exhibit the
# behavior as expected. It is suggested to leave this on, as it will boost
# performance considerably, speed-wise and memory-wise. The reason apps need
# to be well-behaved is so that they don't go drawing on, and XFreePixmap'ing
# these pixmaps themselves, because this will trample all over the cache
# and give very horrid effects, or even make the apps crash with segfaults or
# Xlib errors.
Pixmap_Cache on
# Pixmap cache is in **-> BITS <-**... the end result is APPROXIMATELY
# 10000000 bits of pixmap make your Xserver grow by 1Mb of RAM (VERY rough).
# As with any cache, the more, the better. The more you have, the less likely
# it is that you will get cache misses and so performance on scaling the same
# image to commonly used sizes (ie if 3 or 4 sizes of the same image are used)
# will be lightning fast, in fact in some tests I did, in 16bpp up to 38 times
# as fast, and in 8bpp (with dithering on) up to 105 times faster!!! (these
# are nominal figures obtained on my machine. these are MAXIMUM speedup
# results. Results may vary on other machines and according to the way
# programs are written and use Imlib)
Pixmap_Cache_Size 40000000
# This FORCES Imlib to use the hexadecimal visual id stated here if it is
# defined in the imrc. This bypasses Imlib's routines that hunt for the best
# visual. You can obtain a list of visual ID's using the xdpyinfo command.
# You should only need this if Imlib doesn't pick the correct visual or you
# have strange hardware/Xserver combinations.
#ForceVisualID 22
# This allows Imlib to fall back on Imagemagick and/or NETPBM
# utilities if it can't load the file.
Fallback on
# Default Gamma, Brightness and Contrast stuff....
Gamma 1.0
Brightness 1.0
Contrast 1.0
Red_Gamma 1.0
Red_Brightness 1.0
Red_Contrast 1.0
Green_Gamma 1.0
Green_Brightness 1.0
Green_Contrast 1.0
Blue_Gamma 1.0
Blue_Brightness 1.0
Blue_Contrast 1.0

61
include/wx/app.h Normal file
View File

@ -0,0 +1,61 @@
/////////////////////////////////////////////////////////////////////////////
// Name: app.h
// Purpose: wxApp inclusion
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __APPH_BASE__
#define __APPH_BASE__
/*
class WXDLLEXPORT wxApp;
typedef wxApp* (*wxAppInitializerFunction) (void);
*/
#include "wx/object.h"
typedef wxObject* (*wxAppInitializerFunction) (void); // returning wxApp* won't work with gcc
#if defined(__WINDOWS__)
#include "wx/msw/app.h"
#elif defined(__MOTIF__)
#include "wx/xt/app.h"
#elif defined(__GTK__)
#include "wx/gtk/app.h"
#endif
// Having a global instance of this class allows
// wxApp to be aware of the app creator function.
// wxApp can then call this function to create a new
// app object. Convoluted, but necessary.
class WXDLLEXPORT wxAppInitializer
{
public:
wxAppInitializer(wxAppInitializerFunction fn)
{
wxApp::SetInitializerFunction(fn);
}
};
#define IMPLEMENT_APP(appname) \
wxApp *wxCreateApp(void) { return new appname; } \
wxAppInitializer wxTheAppInitializer((wxAppInitializerFunction) wxCreateApp); \
appname& wxGetApp(void) { return *(appname *)wxTheApp; } \
\
extern int wxEntry( int argc, char *argv[] ); \
int main(int argc, char *argv[]) { return wxEntry(argc, argv); }
#define DECLARE_APP(appname) \
extern appname& wxGetApp(void) ;
#endif
// __APPH_BASE__

13
include/wx/bitmap.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __BITMAPH_BASE__
#define __BITMAPH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/bitmap.h"
#elif defined(__MOTIF__)
#include "wx/xt/bitmap.h"
#elif defined(__GTK__)
#include "wx/gtk/bitmap.h"
#endif
#endif
// __BITMAPH_BASE__

12
include/wx/bmpbuttn.h Normal file
View File

@ -0,0 +1,12 @@
#ifndef __BMPBUTTONH_BASE__
#define __BMPBUTTONH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/bmpbuttn.h"
#elif defined(__MOTIF__)
#include "wx/xt/bmpbuttn.h"
#elif defined(__GTK__)
#include "wx/gtk/bmpbuttn.h"
#endif
#endif

13
include/wx/brush.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __BRUSHH_BASE__
#define __BRUSHH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/brush.h"
#elif defined(__MOTIF__)
#include "wx/xt/brush.h"
#elif defined(__GTK__)
#include "wx/gtk/brush.h"
#endif
#endif
// __BRUSHH_BASE__

13
include/wx/button.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __BUTTONH_BASE__
#define __BUTTONH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/button.h"
#elif defined(__MOTIF__)
#include "wx/xt/button.h"
#elif defined(__GTK__)
#include "wx/gtk/button.h"
#endif
#endif
// __BUTTONH_BASE__

13
include/wx/checkbox.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __CHECKBOXH_BASE__
#define __CHECKBOXH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/checkbox.h"
#elif defined(__MOTIF__)
#include "wx/xt/checkbox.h"
#elif defined(__GTK__)
#include "wx/gtk/checkbox.h"
#endif
#endif
// __CHECKBOXH_BASE__

7
include/wx/choicdlg.h Normal file
View File

@ -0,0 +1,7 @@
#ifndef __CHOICDLGH_BASE__
#define __CHOICDLGH_BASE__
#include "wx/generic/choicdgg.h"
#endif
// __CHOICDLGH_BASE__

13
include/wx/choice.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __CHOICEH_BASE__
#define __CHOICEH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/choice.h"
#elif defined(__MOTIF__)
#include "wx/xt/choice.h"
#elif defined(__GTK__)
#include "wx/gtk/choice.h"
#endif
#endif
// __CHOICEH_BASE__

13
include/wx/clipbrd.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __CLIPBRDH_BASE__
#define __CLIPBRDH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/clipbrd.h"
#elif defined(__MOTIF__)
#include "wx/xt/clipbrd.h"
#elif defined(__GTK__)
#include "wx/gtk/clipbrd.h"
#endif
#endif
// __CLIPBRDH_BASE__

223
include/wx/cmndata.h Normal file
View File

@ -0,0 +1,223 @@
/////////////////////////////////////////////////////////////////////////////
// Name: cmndata.h
// Purpose: Common GDI data classes
// Author: Julian Smart and others
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __CMNDATAH_BASE__
#define __CMNDATAH_BASE__
#ifdef __GNUG__
#pragma interface "cmndata.h"
#endif
class WXDLLEXPORT wxColourData: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxColourData)
public:
wxColour dataColour;
wxColour custColours[16];
bool chooseFull;
wxColourData(void);
~wxColourData(void);
inline void SetChooseFull(bool flag) { chooseFull = flag; }
inline bool GetChooseFull(void) { return chooseFull; }
inline void SetColour(wxColour& colour) { dataColour = colour; }
inline wxColour &GetColour(void) { return dataColour; }
// Array of 16 custom colours
void SetCustomColour(int i, wxColour& colour);
wxColour GetCustomColour(int i);
void operator=(const wxColourData& data);
};
class WXDLLEXPORT wxFontData: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxFontData)
public:
wxColour fontColour;
bool showHelp;
bool allowSymbols;
bool enableEffects;
wxFont initialFont;
wxFont chosenFont;
int minSize;
int maxSize;
wxFontData(void);
~wxFontData(void);
inline void SetAllowSymbols(bool flag) { allowSymbols = flag; }
inline bool GetAllowSymbols(void) { return allowSymbols; }
inline void SetColour(const wxColour& colour) { fontColour = colour; }
inline wxColour &GetColour(void) { return fontColour; }
inline void SetShowHelp(bool flag) { showHelp = flag; }
inline bool GetShowHelp(void) { return showHelp; }
inline void EnableEffects(bool flag) { enableEffects = flag; }
inline bool GetEnableEffects(void) { return enableEffects; }
inline void SetInitialFont(const wxFont& font) { initialFont = font; }
inline wxFont GetInitialFont(void) { return initialFont; }
inline void SetChosenFont(const wxFont& font) { chosenFont = font; }
inline wxFont GetChosenFont(void) { return chosenFont; }
inline void SetRange(int minRange, int maxRange) { minSize = minRange; maxSize = maxRange; }
void operator=(const wxFontData& data);
};
/*
* wxPrintData
* Encapsulates information displayed and edited in the printer dialog box.
*/
class WXDLLEXPORT wxPrintData: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxPrintData)
public:
#ifdef __WINDOWS__
void *printData;
#endif
int printFromPage;
int printToPage;
int printMinPage;
int printMaxPage;
int printNoCopies;
int printOrientation;
bool printAllPages;
bool printCollate;
bool printToFile;
bool printEnableSelection;
bool printEnablePageNumbers;
bool printEnableHelp;
bool printEnablePrintToFile;
bool printSetupDialog;
wxPrintData(void);
~wxPrintData(void);
inline int GetFromPage(void) { return printFromPage; };
inline int GetToPage(void) { return printToPage; };
inline int GetMinPage(void) { return printMinPage; };
inline int GetMaxPage(void) { return printMaxPage; };
inline int GetNoCopies(void) { return printNoCopies; };
inline bool GetAllPages(void) { return printAllPages; };
inline bool GetCollate(void) { return printCollate; };
inline bool GetPrintToFile(void) { return printToFile; };
inline bool GetSetupDialog(void) { return printSetupDialog; };
inline int GetOrientation(void) { return printOrientation; };
inline void SetFromPage(int v) { printFromPage = v; };
inline void SetToPage(int v) { printToPage = v; };
inline void SetMinPage(int v) { printMinPage = v; };
inline void SetMaxPage(int v) { printMaxPage = v; };
inline void SetNoCopies(int v) { printNoCopies = v; };
inline void SetAllPages(bool flag) { printAllPages = flag; };
inline void SetCollate(bool flag) { printCollate = flag; };
inline void SetPrintToFile(bool flag) { printToFile = flag; };
inline void SetSetupDialog(bool flag) { printSetupDialog = flag; };
inline void SetOrientation(int orient) { printOrientation = orient; };
inline void EnablePrintToFile(bool flag) { printEnablePrintToFile = flag; };
inline void EnableSelection(bool flag) { printEnableSelection = flag; };
inline void EnablePageNumbers(bool flag) { printEnablePageNumbers = flag; };
inline void EnableHelp(bool flag) { printEnableHelp = flag; };
inline bool GetEnablePrintToFile(void) { return printEnablePrintToFile; };
inline bool GetEnableSelection(void) { return printEnableSelection; };
inline bool GetEnablePageNumbers(void) { return printEnablePageNumbers; };
inline bool GetEnableHelp(void) { return printEnableHelp; };
void operator=(const wxPrintData& data);
#ifdef __WINDOWS__
// Convert to/from the PRINTDLG structure
void ConvertToNative(void);
void ConvertFromNative(void);
void SetOwnerWindow(wxWindow* win);
inline void* GetNativeData(void) { return printData; }
#endif
};
/*
* This is the data used (and returned) by the wxPageSetupDialog.
*/
class WXDLLEXPORT wxPageSetupData: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxPageSetupData)
public:
#if defined(__WIN95__)
void* m_pageSetupData;
#endif
wxPoint m_paperSize;
wxPoint m_minMarginTopLeft;
wxPoint m_minMarginBottomRight;
wxPoint m_marginTopLeft;
wxPoint m_marginBottomRight;
int m_orientation;
// Flags
bool m_defaultMinMargins;
bool m_enableMargins;
bool m_enableOrientation;
bool m_enablePaper;
bool m_enablePrinter;
bool m_getDefaultInfo; // Equiv. to PSD_RETURNDEFAULT
bool m_enableHelp;
wxPageSetupData(void);
~wxPageSetupData(void);
inline wxPoint GetPaperSize(void) { return m_paperSize; };
inline wxPoint GetMinMarginTopLeft(void) { return m_minMarginTopLeft; };
inline wxPoint GetMinMarginBottomRight(void) { return m_minMarginBottomRight; };
inline wxPoint GetMarginTopLeft(void) { return m_marginTopLeft; };
inline wxPoint GetMarginBottomRight(void) { return m_marginBottomRight; };
inline int GetOrientation(void) { return m_orientation; };
inline bool GetDefaultMinMargins(void) { return m_defaultMinMargins; };
inline bool GetEnableMargins(void) { return m_enableMargins; };
inline bool GetEnableOrientation(void) { return m_enableOrientation; };
inline bool GetEnablePaper(void) { return m_enablePaper; };
inline bool GetEnablePrinter(void) { return m_enablePrinter; };
inline bool GetDefaultInfo(void) { return m_getDefaultInfo; };
inline bool GetEnableHelp(void) { return m_enableHelp; };
inline void SetPaperSize(const wxPoint& pt) { m_paperSize = pt; };
inline void SetMinMarginTopLeft(const wxPoint& pt) { m_minMarginTopLeft = pt; };
inline void SetMinMarginBottomRight(const wxPoint& pt) { m_minMarginBottomRight = pt; };
inline void SetMarginTopLeft(const wxPoint& pt) { m_marginTopLeft = pt; };
inline void SetMarginBottomRight(const wxPoint& pt) { m_marginBottomRight = pt; };
inline void SetOrientation(int orient) { m_orientation = orient; };
inline void SetDefaultMinMargins(bool flag) { m_defaultMinMargins = flag; };
inline void SetDefaultInfo(bool flag) { m_getDefaultInfo = flag; };
inline void EnableMargins(bool flag) { m_enableMargins = flag; };
inline void EnableOrientation(bool flag) { m_enableOrientation = flag; };
inline void EnablePaper(bool flag) { m_enablePaper = flag; };
inline void EnablePrinter(bool flag) { m_enablePrinter = flag; };
inline void EnableHelp(bool flag) { m_enableHelp = flag; };
#if defined(__WIN95__)
// Convert to/from the PAGESETUPDLG structure
void ConvertToNative(void);
void ConvertFromNative(void);
void SetOwnerWindow(wxWindow* win);
inline void* GetNativeData(void) { return m_pageSetupData; }
#endif
void operator=(const wxPageSetupData& data);
};
#endif
// __CMNDATAH_BASE__

13
include/wx/colordlg.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __COLORDLGH_BASE__
#define __COLORDLGH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/colordlg.h"
#elif defined(__MOTIF__)
#include "wx/generic/colrdlgg.h"
#elif defined(__GTK__)
#include "wx/generic/colrdlgg.h"
#endif
#endif
// __COLORDLGH_BASE__

13
include/wx/combobox.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __COMBOBOXH_BASE__
#define __COMBOBOXH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/combobox.h"
#elif defined(__MOTIF__)
#include "wx/xt/combobox.h"
#elif defined(__GTK__)
#include "wx/gtk/combobox.h"
#endif
#endif
// __COMBOBOXH_BASE__

121
include/wx/config.h Normal file
View File

@ -0,0 +1,121 @@
///////////////////////////////////////////////////////////////////////////////
// Name:
// Purpose:
// Author: Karsten Ballüder & Vadim Zeitlin
// Modified by:
// Created: 07.04.98 (adapted from appconf.h)
// RCS-ID: $Id$
// Copyright: (c) 1997 Karsten Ballüder Ballueder@usa.net
// Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
#ifndef _APPCONF_H
#define _APPCONF_H
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
/// shall we be case sensitive in parsing variable names?
#ifndef APPCONF_CASE_SENSITIVE
#define APPCONF_CASE_SENSITIVE FALSE
#endif
/// separates group and entry names
#ifndef APPCONF_PATH_SEPARATOR
#define APPCONF_PATH_SEPARATOR '/'
#endif
/// introduces immutable entries
#ifndef APPCONF_IMMUTABLE_PREFIX
#define APPCONF_IMMUTABLE_PREFIX '!'
#endif
/// should we use registry instead of configuration files under Win32?
#ifndef APPCONF_WIN32_NATIVE
#define APPCONF_WIN32_NATIVE TRUE
#endif
// ----------------------------------------------------------------------------
// global functions
// ----------------------------------------------------------------------------
/*
Replace environment variables ($SOMETHING) with their values. The format is
$VARNAME or ${VARNAME} where VARNAME contains alphanumeric characters and
'_' only. '$' must be escaped ('\$') in order to be taken literally.
*/
wxString ExpandEnvVars(const wxString& str);
// ----------------------------------------------------------------------------
// abstract base class wxConfig which defines the interface for derived classes
//
// wxConfig organizes the items in a tree-like structure (modeled after the
// Unix/Dos filesystem). There are groups (directories) and keys (files).
// There is always one current group given by the current path.
//
// Keys are pairs "key_name = value" where value may be of string or integer
// (long) type (@@@ doubles and other types such as wxDate coming soon).
// ----------------------------------------------------------------------------
class wxConfig
{
public:
// ctor & virtual dtor
wxConfig() { }
virtual ~wxConfig();
// path management
// set current path: if the first character is '/', it's the absolute path,
// otherwise it's a relative path. '..' is supported. If the strPath
// doesn't exist it is created.
virtual void SetPath(const wxString& strPath) = 0;
// retrieve the current path (always as absolute path)
virtual const wxString& GetPath() const = 0;
// enumeration: all functions here return false when there are no more items.
// you must pass the same lIndex to GetNext and GetFirst (don't modify it)
// enumerate subgroups
virtual bool GetFirstGroup(wxString& str, long& lIndex) = 0;
virtual bool GetNextGroup (wxString& str, long& lIndex) = 0;
// enumerate entries
virtual bool GetFirstEntry(wxString& str, long& lIndex) = 0;
virtual bool GetNextEntry (wxString& str, long& lIndex) = 0;
// key access
// read a string or long value from the key. If the key is not
// found the default value is returned.
virtual const char *Read(const char *szKey,
const char *szDefault = NULL) const = 0;
virtual long Read(const char *szKey, long lDefault) const = 0;
// write the value (return true on success)
virtual bool Write(const char *szKey, const char *szValue) = 0;
virtual bool Write(const char *szKey, long lValue) = 0;
// permanently writes all changes
virtual bool Flush(bool bCurrentOnly = FALSE) = 0;
// delete entries/groups
// deletes the specified entry and the group it belongs to if
// it was the last key in it and the second parameter is true
virtual bool DeleteEntry(const char *szKey,
bool bDeleteGroupIfEmpty = TRUE) = 0;
// delete the group (with all subgroups)
virtual bool DeleteGroup(const char *szKey) = 0;
// delete the whole underlying object (disk file, registry key, ...)
// primarly for use by desinstallation routine.
virtual bool DeleteAll() = 0;
protected:
// true if environment variables are to be auto-expanded
bool m_bExpandEnvVars;
};
// ----------------------------------------------------------------------------
// functions to create different config implementations
// ----------------------------------------------------------------------------
wxConfig *CreateFileConfig(const wxString& strFile, bool bLocalOnly = FALSE);
#endif //_APPCONF_H

13
include/wx/control.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __CONTROLH_BASE__
#define __CONTROLH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/control.h"
#elif defined(__MOTIF__)
#include "wx/xt/control.h"
#elif defined(__GTK__)
#include "wx/gtk/control.h"
#endif
#endif
// __CONTROLH_BASE__

13
include/wx/cursor.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __CURSORH_BASE__
#define __CURSORH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/cursor.h"
#elif defined(__MOTIF__)
#include "wx/xt/cursor.h"
#elif defined(__GTK__)
#include "wx/gtk/cursor.h"
#endif
#endif
// __CURSORH_BASE__

131
include/wx/date.h Normal file
View File

@ -0,0 +1,131 @@
/////////////////////////////////////////////////////////////////////////////
// Name: date.h
// Purpose: wxDate class
// Author: Julian Smart, Steve Marcus, Eric Simon, Chris Hill,
// Charles D. Price
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WXDATEH__
#define __WXDATEH__
#ifdef __GNUG__
#pragma interface "date.h"
#endif
#include "wx/object.h"
#include "wx/string.h"
#if USE_TIMEDATE
enum wxdate_format_type {wxMDY, wxDAY, wxMONTH, wxFULL, wxEUROPEAN};
#define wxNO_CENTURY 0x02
#define wxDATE_ABBR 0x04
class WXDLLEXPORT wxDate: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxDate)
protected:
unsigned long julian; // see julDate(); days since 1/1/4713 B.C.
int month; // see NMonth()
int day; // see Day()
int year; // see NYear4()
int day_of_week; // see NDOW(); 1 = Sunday, ... 7 = Saturday
private:
int DisplayFormat;
unsigned char DisplayOptions;
void julian_to_mdy (); // convert julian day to mdy
void julian_to_wday (); // convert julian day to day_of_week
void mdy_to_julian (); // convert mdy to julian day
public:
wxDate ();
wxDate (const long j);
wxDate (const int m, const int d, const int y);
wxDate (const wxString& dat);
wxDate (const wxDate &dt);
operator wxString (void);
void operator = (const wxDate& date);
void operator = (const wxString& date);
wxDate operator + (const long i);
wxDate operator + (const int i);
wxDate operator - (const long i);
wxDate operator - (const int i);
long operator - (const wxDate &dt);
wxDate &operator += (const long i);
wxDate &operator -= (const long i);
wxDate &operator ++ (); // Prefix increment
wxDate &operator ++ (int); // Postfix increment
wxDate &operator -- (); // Prefix decrement
wxDate &operator -- (int); // Postfix decrement
friend bool operator < (const wxDate &dt1, const wxDate &dt2);
friend bool operator <= (const wxDate &dt1, const wxDate &dt2);
friend bool operator > (const wxDate &dt1, const wxDate &dt2);
friend bool operator >= (const wxDate &dt1, const wxDate &dt2);
friend bool operator == (const wxDate &dt1, const wxDate &dt2);
friend bool operator != (const wxDate &dt1, const wxDate &dt2);
friend ostream &operator << (ostream &os, const wxDate &dt);
wxString FormatDate (const int type=-1) const;
void SetFormat (const int format);
int SetOption (const int option, const bool enable=TRUE);
long GetJulianDate() const; // returns julian date
int GetDayOfYear() const; // returns relative date since Jan. 1
bool IsLeapYear() const; // returns TRUE if leap year, FALSE if not
// Version 4.0 Extension to Public Interface - CDP
// These 'Set's modify the date object and actually SET it
// They all return a reference to self (*this)
wxDate &Set(); // Sets to current system date
wxDate &Set(long lJulian);
wxDate &Set(int nMonth, int nDay, int nYear);
wxDate &AddWeeks(int nCount = 1); //
wxDate &AddMonths(int nCount = 1); // May also pass neg# to decrement
wxDate &AddYears(int nCount = 1); //
int GetDay() const; // Numeric Day of date object
int GetDaysInMonth(); // Number of days in month (1..31)
int GetFirstDayOfMonth() const; // First Day Of Month (1..7)
wxString GetDayOfWeekName(); // Character Day Of Week ('Sunday'..'Saturday')
int GetDayOfWeek() const; // (1..7)
int GetWeekOfMonth(); // Numeric Week Of Month (1..6)
int GetWeekOfYear(); // Numeric Week Of Year (1..52)
wxString GetMonthName(); // Character Month name
int GetMonth() const; // Month Number (1..12)
wxDate GetMonthStart(); // First Date Of Month
wxDate GetMonthEnd(); // Last Date Of Month
int GetYear() const; // eg. 1992
wxDate GetYearStart(); // First Date Of Year
wxDate GetYearEnd(); // Last Date Of Year
bool IsBetween(const wxDate& first, const wxDate& second) const;
wxDate Previous(const int dayOfWeek) const;
};
#endif
#endif
// __WXDATEH__

13
include/wx/dc.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __DCH_BASE__
#define __DCH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/dc.h"
#elif defined(__MOTIF__)
#include "wx/xt/dc.h"
#elif defined(__GTK__)
#include "wx/gtk/dc.h"
#endif
#endif
// __DCH_BASE__

13
include/wx/dcclient.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __DCCLIENTH_BASE__
#define __DCCLIENTH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/dcclient.h"
#elif defined(__MOTIF__)
#include "wx/xt/dcclient.h"
#elif defined(__GTK__)
#include "wx/gtk/dcclient.h"
#endif
#endif
// __DCCLIENTH_BASE__

13
include/wx/dcmemory.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __DCMEMORYH_BASE__
#define __DCMEMORYH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/dcmemory.h"
#elif defined(__MOTIF__)
#include "wx/xt/dcmemory.h"
#elif defined(__GTK__)
#include "wx/gtk/dcmemory.h"
#endif
#endif
// __DCMEMORYH_BASE__

9
include/wx/dcprint.h Normal file
View File

@ -0,0 +1,9 @@
#ifndef __DCPRINTH_BASE__
#define __DCPRINTH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/dcprint.h"
#endif
#endif
// __DCPRINTH_BASE__

13
include/wx/dcscreen.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __DCSCREENH_BASE__
#define __DCSCREENH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/dcscreen.h"
#elif defined(__MOTIF__)
#include "wx/xt/dcscreen.h"
#elif defined(__GTK__)
#include "wx/gtk/dcscreen.h"
#endif
#endif
// __DCSCREENH_BASE__

13
include/wx/dde.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __DDEH_BASE__
#define __DDEH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/dde.h"
#elif defined(__MOTIF__)
#include "wx/xt/dde.h"
#elif defined(__GTK__)
#include "wx/gtk/dde.h"
#endif
#endif
// __DDEH_BASE__

94
include/wx/debug.h Normal file
View File

@ -0,0 +1,94 @@
/////////////////////////////////////////////////////////////////////////////
// Name: debug.h
// Purpose: Misc debug functions and macros
// Author: Vadim Zeitlin
// Modified by:
// Created: 29/01/98
// RCS-ID: $Id$
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef __DEBUGH__
#define __DEBUGH__
#include <assert.h>
// ----------------------------------------------------------------------------
/**
@name Debugging macros
All debugging macros rely on ASSERT() which in turn calls user-defined
OnAssert() function. To keep things simple, it's called even when the
expression is TRUE (i.e. everything is ok) and by default does nothing: just
returns the same value back. But if you redefine it to do something more sexy
(popping up a message box in your favourite GUI, sending you e-mail or
whatever) it will affect all ASSERTs, FAILs and CHECKs in your code.
<BR>
<BR>
<b>Warning</b>: if you don't like advices on programming style, don't read
further! ;-)
<BR>
<BR>
Extensive use of these macros is recommended! Remember that ASSERTs are
disabled in final (without DEBUG defined) build, so they add strictly
nothing to your program's code. On the other hand, CHECK macros do stay
even in release builds, but in general are not much of a burden, while
a judicious use of them might increase your program's stability.
@memo Debugging macros (replacement for standard assert()) and more.
*/
// ----------------------------------------------------------------------------
//@{
/** @name Macros which are completely disabled in 'release' mode */
//@{
#ifdef __DEBUG__
/**
this function may be redefined to do something non trivial and is called
whenever one of debugging macros fails (i.e. condition is false in an
assertion)
@param szFile and nLine - file name and line number of the ASSERT
szMsg - optional message explaining the reason
*/
void wxOnAssert(const char *szFile, int nLine, const char *szMsg = NULL);
/// generic assert macro
#define wxASSERT(cond) if ( !(cond) ) wxOnAssert(__FILE__, __LINE__)
/// assert with additional message explaining it's cause
#define wxASSERT_MSG(x, m) if ( !(x) ) wxOnAssert(__FILE__, __LINE__, m)
#else
// nothing to do in release modes (hopefully at this moment there are
// no more bugs ;-)
#define wxASSERT(cond)
#define wxASSERT_MSG(x, m)
#endif //DEBUG
/// special form of assert: always triggers it (in debug mode)
#define wxFAIL wxASSERT(0)
/// FAIL with some message
#define wxFAIL_MSG(msg) wxASSERT_MSG(0, msg)
//@}
// NB: these macros work also in release mode!
/**
These macros must be used only in invalid situation: for example, an
invalid parameter (NULL pointer) is passed to a function. Instead of
dereferencing it and causing core dump the function might try using
CHECK( p != NULL ) or CHECK( p != NULL, return LogError("p is NULL!!") )
@name Macros which remain even in 'release' mode
*/
//@{
/// check that expression is true, "return" if not (also FAILs in debug mode)
#define wxCHECK(x) if (!(x)) {wxFAIL; return; }
/// check that expression is true, "return ret" if not
#define wxCHECK_RET(x, ret) if (!(x)) {wxFAIL; return ret; }
/// check that expression is true, perform op if not
#define wxCHECK2(x, op) if (!(x)) {wxFAIL; op; }
//@}
//@}
#endif // __DEBUGH__

861
include/wx/defs.h Normal file
View File

@ -0,0 +1,861 @@
/////////////////////////////////////////////////////////////////////////////
// Name: defs.h
// Purpose: Declarations/definitions common to all wx source files
// Author: Julian Smart and others
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __DEFSH__
#define __DEFSH__
#ifdef __GNUG__
#pragma interface "defs.h"
#endif
#ifdef __GTK__
#include "glib.h"
#include "gdk/gdk.h"
#include "gtk/gtk.h"
#endif
#include <stddef.h>
#include "wx/setup.h"
#include "wx/version.h"
// Helps SGI compilation, apparently
#if defined(__SGI__) && defined(__GNUG__)
#define __need_wchar_t
#endif
// Eliminate double/float warnings
#ifdef _MSC_VER
# pragma warning(disable:4244)
#endif
//////////////////////////////////////////////////////////////////////////////////
// Currently Only MS-Windows/NT, XView and Motif are supported
//
#if defined(__HPUX__) && !defined(__MOTIF__)
# define __MOTIF__
#endif
#if defined(__MOTIF__)
# define __X__
#elif defined(__WINDOWS__) || defined(__WINDOWS_386__) || defined(__NT__) || defined(__MSDOS__)
# ifndef __WINDOWS__
# define __WINDOWS__
# endif
#endif
// wxWindows checks for WIN32, not __WIN32__
#if ((defined(WIN32) || defined(__NT__)) && !defined(__WIN32__))
#define __WIN32__
#endif
#ifndef __WIN32__
#define __WIN16__
#endif
#if !defined(__WIN95__) && (WINVER >= 0x0400)
#define __WIN95__
#endif
// Make sure the environment is set correctly
#if defined(__WINDOWS__) && defined(__X__)
# error "Target can't be both X and Windows"
#elif !defined(__MOTIF__) && !defined(__WINDOWS__) && !defined(__GTK__) && !defined(__MAC__) && !defined(__X__)
#error "No Target! Use -D[__MOTIF__|__GTK__|__WINDOWS__|__MAC__]"
#endif
#if defined(__MOTIF__) || defined(__GTK__)
// Bool is now obsolete, use bool instead
// typedef int Bool;
#ifndef TRUE
# define TRUE 1
# define FALSE 0
# define Bool_DEFINED
#endif
#elif defined(__WINDOWS__)
#ifndef TRUE
# define TRUE 1
# define FALSE 0
#endif
#endif
// VC++ 4.0 is 1000.
// Add more tests here for compilers that don't already define bool.
#if ( defined(_MSC_VER) && (_MSC_VER <= 1000) ) || (defined(__BORLANDC__) && (__BORLANDC__ < 0x500))
typedef unsigned int bool;
#endif
#if ( defined(_MSC_VER) && (_MSC_VER <= 800) ) || defined(__GNUWIN32__)
#define byte unsigned char
#endif
typedef short int WXTYPE;
typedef int wxWindowID;
// Macro to cut down on compiler warnings.
#if REMOVE_UNUSED_ARG
#define WXUNUSED(identifier) /* identifier */
#else // stupid, broken compiler
#define WXUNUSED(identifier) identifier
#endif
/*
* Making or using wxWindows as a Windows DLL
*/
#ifdef __WINDOWS__
#ifdef __BORLANDC__
# ifdef WXMAKINGDLL
# define WXDLLEXPORT __export
# define WXDLLEXPORT_DATA(type) type __export
# define WXDLLEXPORT_CTORFN __export
# elif defined(WXUSINGDLL)
# define WXDLLEXPORT __import
# define WXDLLEXPORT_DATA(type) type __import
# define WXDLLEXPORT_CTORFN
# else
# define WXDLLEXPORT
# define WXDLLEXPORT_DATA(type) type
# define WXDLLEXPORT_CTORFN
# endif
#else
# ifdef WXMAKINGDLL
# define WXDLLEXPORT __declspec( dllexport )
# define WXDLLEXPORT_DATA(type) __declspec( dllexport ) type
# define WXDLLEXPORT_CTORFN __declspec( dllexport )
# elif defined(WXUSINGDLL)
# define WXDLLEXPORT __declspec( dllimport )
# define WXDLLEXPORT_DATA(type) __declspec( dllimport ) type
# define WXDLLEXPORT_CTORFN
# else
# define WXDLLEXPORT
# define WXDLLEXPORT_DATA(type) type
# define WXDLLEXPORT_CTORFN
# endif
#endif
#else
// Non-Windows
# define WXDLLEXPORT
# define WXDLLEXPORT_DATA(type) type
# define WXDLLEXPORT_CTORFN
#endif
// For ostream, istream ofstream
#if defined(__BORLANDC__) && defined( _RTLDLL )
# define WXDLLIMPORT __import
#else
# define WXDLLIMPORT
#endif
class WXDLLEXPORT wxObject;
class WXDLLEXPORT wxEvent;
// Vadim's types - check whether we need them all
/// the type for various indexes (string, arrays, ...)
typedef unsigned int uint;
/// extended boolean type: { yes, no, may be }
typedef signed int EBool;
/// with TRUE and FALSE is a possible value for a "3-state" boolean var
#define UNKNOWN (-1)
/** symbolic constant used by all Find()-like functions returning positive
integer on success as failure indicator */
#define NOT_FOUND (-1)
/** useful for Windows programmers: makes somewhat more clear all these
zeroes being passed to Windows APIs */
#define RESERVED (NULL)
// ----------------------------------------------------------------------------
// Error codes
// ----------------------------------------------------------------------------
/// Standard error codes
enum ErrCode
{
/// invalid parameter (in broad sense)
ERR_PARAM = (-4000),
/// no more data (iteration functions usually return this)
ERR_NODATA,
/// user cancelled the operation
ERR_CANCEL,
/// no error (the only non negative error code)
ERR_SUCCESS = 0
};
// ----------------------------------------------------------------------------
/** @name Very common macros */
// ----------------------------------------------------------------------------
//@{
/// delete pointer if it is not NULL
#define DELETEP(p) if ( (p) != NULL ) delete (p)
/// delete array pointer if it is not NULL
#define DELETEA(p) if ( (p) != NULL ) delete [] (p)
/// size of statically declared array
#define WXSIZEOF(array) (sizeof(array)/sizeof(array[0]))
// ----------------------------------------------------------------------------
// compiler and OS identification
// ----------------------------------------------------------------------------
// OS
#if defined(__HPUX__) || defined(____SVR4____) || defined(__LINUX__)
#ifndef __UNIX__
#define __UNIX__
#endif
#endif
#ifndef __UNIX__ // Windows
#ifndef __WINDOWS__
#define __WINDOWS__
#endif
#if defined(_MSC_VER)
#define __VISUALC__
#elif defined(__BCPLUSPLUS__) && !defined(__BORLANDC__)
#define __BORLANDC__
#elif defined(__WATCOMC__)
//#define __WATCOMC__
#elif defined(__SC__)
#define __SYMANTECC__
#endif // compiler
#endif // OS
#if defined(__UNIX__)
#define FILE_PATH_SEPARATOR ('/')
#elif defined(__WINDOWS__)
#define FILE_PATH_SEPARATOR ('\\')
#else
#error "don't know path separator for this platform"
#endif
// ----------------------------------------------------------------------------
// compiler specific settings
// ----------------------------------------------------------------------------
// to allow compiling with warning level 4 under Microsoft Visual C++ some
// warnings just must be disabled
#ifdef __VISUALC__
#pragma warning(disable: 4514) // unreferenced inline func has been removed
/*
you might be tempted to disable this one also: triggered by CHECK and FAIL
macros in debug.h, but it's, overall, is a rather useful one, so I leave it
and will try to find some way to disable this warning just for CHECK/FAIL.
Anyone?
*/
#pragma warning(disable: 4127) // conditional expression is constant
#endif // VC++
// Callback function type definition
typedef void (*wxFunction) (wxObject&, wxEvent&);
/*
* Window style flags.
* Values are chosen so they can be |'ed in a bit list.
* Some styles are used across more than one group,
* so the values mustn't clash with others in the group.
* Otherwise, numbers can be reused across groups.
*
* From version 1.66:
* Window (cross-group) styles now take up the first half
* of the flag, and control-specific styles the
* second half.
*
*/
/*
* Window (Frame/dialog/subwindow/panel item) style flags
*/
#define wxVSCROLL 0x80000000
#define wxHSCROLL 0x40000000
#define wxCAPTION 0x20000000
// New styles
#define wxDOUBLE_BORDER 0x10000000
#define wxSUNKEN_BORDER 0x08000000
#define wxRAISED_BORDER 0x04000000
#define wxBORDER 0x02000000
#define wxSIMPLE_BORDER 0x02000000
#define wxSTATIC_BORDER 0x01000000
#define wxTRANSPARENT_WINDOW 0x00100000
#define wxNO_BORDER 0x00200000
#define wxUSER_COLOURS 0x00800000
// Override CTL3D etc. control colour processing to
// allow own background colour
// OBSOLETE - use wxNO_CTL3D instead
#define wxNO_3D 0x00800000
// Override CTL3D or native 3D styles for children
#define wxOVERRIDE_KEY_TRANSLATIONS 0x00400000
// TODO: do we need this??? (Motif only)
// Add this style to a panel to get tab traversal working
// outside of dialogs.
#define wxTAB_TRAVERSAL 0x00080000
// Orientations
#define wxHORIZONTAL 0x01
#define wxVERTICAL 0x02
#define wxBOTH (wxVERTICAL|wxHORIZONTAL)
#define wxCENTER_FRAME 0x04 /* centering into frame rather than screen */
/*
* Frame/dialog style flags
*/
#define wxSTAY_ON_TOP 0x8000
#define wxICONIZE 0x4000
#define wxMINIMIZE wxICONIZE
#define wxMAXIMIZE 0x2000
#define wxTHICK_FRAME 0x1000
#define wxSYSTEM_MENU 0x0800
#define wxMINIMIZE_BOX 0x0400
#define wxMAXIMIZE_BOX 0x0200
#define wxTINY_CAPTION_HORIZ 0x0100
#define wxTINY_CAPTION_VERT 0x0080
#define wxRESIZE_BOX wxMAXIMIZE_BOX
#define wxRESIZE_BORDER 0x0040
#define wxDIALOG_MODAL 0x0020
#define wxDIALOG_MODELESS 0x0000
#define wxDEFAULT_FRAME_STYLE (wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION)
#if WXWIN_COMPATIBILITY
#define wxDEFAULT_FRAME wxDEFAULT_FRAME_STYLE
#endif
#define wxDEFAULT_DIALOG_STYLE (wxSYSTEM_MENU|wxCAPTION|wxTHICK_FRAME)
/*
* Subwindow style flags
*/
#define wxRETAINED 0x0001
#define wxBACKINGSTORE wxRETAINED
// wxCanvas or wxPanel can optionally have a thick frame under MS Windows.
// #define wxTHICK_FRAME 0x1000
/*
* wxToolBar style flags
*/
#define wxTB_3DBUTTONS 0x8000
/*
* Apply to all panel items
*/
#define wxCOLOURED 0x0800
// Alignment for panel item labels: replaces characters with zeros
// when creating label, so spaces can be included in string for alignment.
#define wxFIXED_LENGTH 0x0400
#define wxALIGN_LEFT 0x0000
#define wxALIGN_CENTER 0x0100
#define wxALIGN_CENTRE 0x0100
#define wxALIGN_RIGHT 0x0200
/*
* Styles for wxListBox
*/
// In wxListBox style flag
#define wxSB_MASK 0x0008
#define wxNEEDED_SB 0x0000
#define wxALWAYS_SB 0x0008
// New naming convention
#define wxLB_NEEDED_SB wxNEEDED_SB
#define wxLB_ALWAYS_SB wxALWAYS_SB
#define wxLB_SORT 0x0010
// These duplicate the styles in the Multiple argument
#define wxLB_SINGLE 0x0000
#define wxLB_MULTIPLE 0x0040
#define wxLB_EXTENDED 0x0080
// wxLB_OWNERDRAW is Windows-only
#define wxLB_OWNERDRAW 0x0100
#define wxLB_HSCROLL wxHSCROLL
/*
* wxTextCtrl style flags
*/
#define wxPROCESS_ENTER 0x0004
#define wxPASSWORD 0x0008
#define wxTE_PROCESS_ENTER wxPROCESS_ENTER
#define wxTE_PASSWORD wxPASSWORD
#define wxTE_READONLY 0x0010
#define wxTE_MULTILINE 0x0020
// TODO For backward compatibility, need wxOLD_READONLY
#define wxREADONLY wxTE_READONLY
#define wxEDITABLE 0
// #define wxTE_RICHTEXT 0x0020
/*
* wxComboBox style flags
*/
#define wxCB_SIMPLE 0x0004
#define wxCB_DROPDOWN 0x0000
#define wxCB_SORT 0x0008
#define wxCB_READONLY wxREADONLY
/*
* wxRadioBox/wxRadioButton style flags
*/
#define wxRA_HORIZONTAL wxHORIZONTAL
#define wxRA_VERTICAL wxVERTICAL
#define wxRB_GROUP 0x0004
/*
* wxGauge flags
*/
#define wxGA_PROGRESSBAR 0x0004
#define wxGA_HORIZONTAL wxHORIZONTAL
#define wxGA_VERTICAL wxVERTICAL
/*
* wxSlider flags
*/
#define wxSL_HORIZONTAL wxHORIZONTAL
#define wxSL_VERTICAL wxVERTICAL
// The next one is obsolete - use scroll events instead
#define wxSL_NOTIFY_DRAG 0x0000
#define wxSL_AUTOTICKS 0x0008
// #define wxSL_MANUALTICKS 0x0010
#define wxSL_LABELS 0x0020
#define wxSL_LEFT 0x0040
#define wxSL_TOP 0x0080
#define wxSL_RIGHT 0x0100
#define wxSL_BOTTOM 0x0200
#define wxSL_BOTH 0x0400
#define wxSL_SELRANGE 0x0800
/*
* wxScrollBar flags
*/
#define wxSB_HORIZONTAL wxHORIZONTAL
#define wxSB_VERTICAL wxVERTICAL
/*
* wxButton flags
*/
#define wxBU_AUTODRAW 0x0004
#define wxBU_NOAUTODRAW 0x0000
/*
* wxTreeCtrl flags
*/
#define wxTR_HAS_BUTTONS 0x0004
#define wxTR_EDIT_LABELS 0x0008
/*
* wxListCtrl flags
*/
#define wxLC_ICON 0x0004
#define wxLC_SMALL_ICON 0x0008
#define wxLC_LIST 0x0010
#define wxLC_REPORT 0x0020
#define wxLC_ALIGN_TOP 0x0040
#define wxLC_ALIGN_LEFT 0x0080
#define wxLC_AUTOARRANGE 0x0100
#define wxLC_USER_TEXT 0x0200
#define wxLC_EDIT_LABELS 0x0400
#define wxLC_NO_HEADER 0x0800
#define wxLC_NO_SORT_HEADER 0x1000
#define wxLC_SINGLE_SEL 0x2000
#define wxLC_SORT_ASCENDING 0x4000
#define wxLC_SORT_DESCENDING 0x8000
#define wxLC_MASK_TYPE (wxLC_ICON | wxLC_SMALL_ICON | wxLC_LIST | wxLC_REPORT)
#define wxLC_MASK_ALIGN (wxLC_ALIGN_TOP | wxLC_ALIGN_LEFT)
#define wxLC_MASK_SORT (wxLC_SORT_ASCENDING | wxLC_SORT_DESCENDING)
// Omitted because (a) too much detail (b) not enough style flags
// #define wxLC_NO_SCROLL
// #define wxLC_NO_LABEL_WRAP
// #define wxLC_OWNERDRAW_FIXED
// #define wxLC_SHOW_SEL_ALWAYS
/*
* wxSpinButton flags
*/
#define wxSP_VERTICAL 0x0004
#define wxSP_HORIZONTAL 0x0008
#define wxSP_ARROW_KEYS 0x0010
#define wxSP_WRAP 0x0020
/*
* wxSplitterWnd flags
*/
#define wxSP_NOBORDER 0x0000
#define wxSP_3D 0x0004
#define wxSP_BORDER 0x0008
/*
* wxTabCtrl flags
*/
#define wxTAB_MULTILINE 0x0000
#define wxTAB_RIGHTJUSTIFY 0x0004
#define wxTAB_FIXEDWIDTH 0x0008
#define wxTAB_OWNERDRAW 0x0010
/*
* wxStatusBar95 flags
*/
#define wxSB_SIZEGRIP 0x0002
/*
* GDI descriptions
*/
enum {
// Text font families
wxDEFAULT = 70,
wxDECORATIVE,
wxROMAN,
wxSCRIPT,
wxSWISS,
wxMODERN,
wxTELETYPE, /* @@@@ */
// Proportional or Fixed width fonts (not yet used)
wxVARIABLE = 80,
wxFIXED,
wxNORMAL = 90,
wxLIGHT,
wxBOLD,
// Also wxNORMAL for normal (non-italic text)
wxITALIC,
wxSLANT,
// Pen styles
wxSOLID = 100,
wxDOT,
wxLONG_DASH,
wxSHORT_DASH,
wxDOT_DASH,
wxUSER_DASH,
wxTRANSPARENT,
// Brush & Pen Stippling. Note that a stippled pen cannot be dashed!!
// Note also that stippling a Pen IS meaningfull, because a Line is
// drawn with a Pen, and without any Brush -- and it can be stippled.
wxSTIPPLE = 110,
wxBDIAGONAL_HATCH,
wxCROSSDIAG_HATCH,
wxFDIAGONAL_HATCH,
wxCROSS_HATCH,
wxHORIZONTAL_HATCH,
wxVERTICAL_HATCH,
#define IS_HATCH(s) ((s)>=wxBDIAGONAL_HATCH && (s)<=wxVERTICAL_HATCH)
wxJOIN_BEVEL = 120,
wxJOIN_MITER,
wxJOIN_ROUND,
wxCAP_ROUND = 130,
wxCAP_PROJECTING,
wxCAP_BUTT
};
// Logical ops
typedef enum {
wxCLEAR, // 0
wxXOR, // src XOR dst
wxINVERT, // NOT dst
wxOR_REVERSE, // src OR (NOT dst)
wxAND_REVERSE,// src AND (NOT dst)
wxCOPY, // src
wxAND, // src AND dst
wxAND_INVERT, // (NOT src) AND dst
wxNO_OP, // dst
wxNOR, // (NOT src) AND (NOT dst)
wxEQUIV, // (NOT src) XOR dst
wxSRC_INVERT, // (NOT src)
wxOR_INVERT, // (NOT src) OR dst
wxNAND, // (NOT src) OR (NOT dst)
wxOR, // src OR dst
wxSET, // 1
wxSRC_OR, // source _bitmap_ OR destination
wxSRC_AND // source _bitmap_ AND destination
} form_ops_t;
// Flood styles
#define wxFLOOD_SURFACE 1
#define wxFLOOD_BORDER 2
// Polygon filling mode
#define wxODDEVEN_RULE 1
#define wxWINDING_RULE 2
// ToolPanel in wxFrame
#define wxTOOL_TOP 1
#define wxTOOL_BOTTOM 2
#define wxTOOL_LEFT 3
#define wxTOOL_RIGHT 4
// Dialog specifiers/return values
#define wxOK 0x0001
#define wxYES_NO 0x0002
#define wxCANCEL 0x0004
#define wxYES 0x0008
#define wxNO 0x0010
#define wxICON_EXCLAMATION 0x0020
#define wxICON_HAND 0x0040
#define wxICON_QUESTION 0x0080
#define wxICON_INFORMATION 0x0100
#define wxICON_STOP wxICON_HAND
#define wxICON_ASTERISK wxICON_INFORMATION
#define wxICON_MASK (0x0020|0x0040|0x0080|0x0100)
#define wxCENTRE 0x0200
#define wxCENTER wxCENTRE
// Possible SetSize flags
// Use internally-calculated width if -1
#define wxSIZE_AUTO_WIDTH 1
// Use internally-calculated height if -1
#define wxSIZE_AUTO_HEIGHT 2
// Use internally-calculated width and height if each is -1
#define wxSIZE_AUTO 3
// Ignore missing (-1) dimensions (use existing).
// For readability only: test for wxSIZE_AUTO_WIDTH/HEIGHT in code.
#define wxSIZE_USE_EXISTING 0
// Allow -1 as a valid position
#define wxSIZE_ALLOW_MINUS_ONE 4
// Clipboard formats
// Numbers as per winuser.h
# define wxCF_TEXT 1 /* CF_TEXT */
# define wxCF_BITMAP 2 /* CF_BITMAP */
# define wxCF_METAFILE 3 /* CF_METAFILEPICT */
# define wxCF_DIB 8 /* CF_DIB */
# define wxCF_OEMTEXT 7 /* CF_OEMTEXT */
// Virtual keycodes
enum _Virtual_keycodes {
WXK_BACK = 8,
WXK_TAB = 9,
WXK_RETURN = 13,
WXK_ESCAPE = 27,
WXK_SPACE = 32,
WXK_DELETE = 127,
WXK_START = 300,
WXK_LBUTTON,
WXK_RBUTTON,
WXK_CANCEL,
WXK_MBUTTON,
WXK_CLEAR,
WXK_SHIFT,
WXK_CONTROL,
WXK_MENU,
WXK_PAUSE,
WXK_CAPITAL,
WXK_PRIOR, // Page up
WXK_NEXT, // Page down
WXK_END,
WXK_HOME,
WXK_LEFT,
WXK_UP,
WXK_RIGHT,
WXK_DOWN,
WXK_SELECT,
WXK_PRINT,
WXK_EXECUTE,
WXK_SNAPSHOT,
WXK_INSERT,
WXK_HELP,
WXK_NUMPAD0,
WXK_NUMPAD1,
WXK_NUMPAD2,
WXK_NUMPAD3,
WXK_NUMPAD4,
WXK_NUMPAD5,
WXK_NUMPAD6,
WXK_NUMPAD7,
WXK_NUMPAD8,
WXK_NUMPAD9,
WXK_MULTIPLY,
WXK_ADD,
WXK_SEPARATOR,
WXK_SUBTRACT,
WXK_DECIMAL,
WXK_DIVIDE,
WXK_F1,
WXK_F2,
WXK_F3,
WXK_F4,
WXK_F5,
WXK_F6,
WXK_F7,
WXK_F8,
WXK_F9,
WXK_F10,
WXK_F11,
WXK_F12,
WXK_F13,
WXK_F14,
WXK_F15,
WXK_F16,
WXK_F17,
WXK_F18,
WXK_F19,
WXK_F20,
WXK_F21,
WXK_F22,
WXK_F23,
WXK_F24,
WXK_NUMLOCK,
WXK_SCROLL,
WXK_PAGEUP,
WXK_PAGEDOWN
};
// Colours - see wx_gdi.cc for database
// OS mnemonics -- Identify the running OS (useful for Windows)
// [Not all platforms are currently available or supported]
enum {
wxCURSES,
wxXVIEW_X, // Sun's XView OpenLOOK toolkit
wxMOTIF_X, // OSF Motif 1.x.x
wxCOSE_X, // OSF Common Desktop Environment
wxNEXTSTEP, // NeXTStep
wxMACINTOSH, // Apple System 7
wxGEOS, // GEOS
wxOS2_PM, // OS/2 Workplace
wxWINDOWS, // Windows or WfW
wxPENWINDOWS, // Windows for Pen Computing
wxWINDOWS_NT, // Windows NT
wxWIN32S, // Windows 32S API
wxWIN95, // Windows 95
wxWIN386 // Watcom 32-bit supervisor modus
};
// Printing
#ifndef wxPORTRAIT
#define wxPORTRAIT 1
#define wxLANDSCAPE 2
#endif
// Standard menu identifiers
#define wxID_OPEN 5000
#define wxID_CLOSE 5001
#define wxID_NEW 5002
#define wxID_SAVE 5003
#define wxID_SAVEAS 5004
#define wxID_REVERT 5005
#define wxID_EXIT 5006
#define wxID_UNDO 5007
#define wxID_REDO 5008
#define wxID_HELP 5009
#define wxID_PRINT 5010
#define wxID_PRINT_SETUP 5011
#define wxID_PREVIEW 5012
#define wxID_ABOUT 5013
#define wxID_HELP_CONTENTS 5014
#define wxID_HELP_COMMANDS 5015
#define wxID_HELP_PROCEDURES 5016
#define wxID_HELP_CONTEXT 5017
#define wxID_CUT 5030
#define wxID_COPY 5031
#define wxID_PASTE 5032
#define wxID_CLEAR 5033
#define wxID_FIND 5034
#define wxID_FILE1 5050
#define wxID_FILE2 5051
#define wxID_FILE3 5052
#define wxID_FILE4 5053
#define wxID_FILE5 5054
#define wxID_FILE6 5055
#define wxID_FILE7 5056
#define wxID_FILE8 5057
#define wxID_FILE9 5058
#define wxID_OK 5100
#define wxID_CANCEL 5101
#define wxID_APPLY 5102
#define wxID_YES 5103
#define wxID_NO 5104
#ifdef __WINDOWS__
// Stand-ins for Windows types, to avoid
// #including all of windows.h
typedef unsigned long WXHWND;
typedef unsigned long WXHANDLE;
typedef unsigned long WXHICON;
typedef unsigned long WXHFONT;
typedef unsigned long WXHMENU;
typedef unsigned long WXHPEN;
typedef unsigned long WXHBRUSH;
typedef unsigned long WXHPALETTE;
typedef unsigned long WXHCURSOR;
typedef unsigned long WXHRGN;
typedef unsigned long WXHINSTANCE;
typedef unsigned long WXHBITMAP;
typedef unsigned long WXHIMAGELIST;
typedef unsigned long WXHGLOBAL;
typedef unsigned long WXHDC;
typedef unsigned int WXUINT;
typedef unsigned long WXDWORD;
typedef unsigned short WXWORD;
typedef unsigned int WXWPARAM;
typedef long WXLPARAM;
typedef unsigned long WXCOLORREF;
typedef void * WXRGN;
typedef void * WXRGNDATA;
typedef void * WXMSG;
typedef unsigned long WXHCONV;
typedef void * WXDRAWITEMSTRUCT;
typedef void * WXMEASUREITEMSTRUCT;
typedef void * WXLPCREATESTRUCT;
typedef int (*WXFARPROC)();
#endif
#endif
// __WXDEFSH__

13
include/wx/dialog.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __DIALOGH_BASE__
#define __DIALOGH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/dialog.h"
#elif defined(__MOTIF__)
#include "wx/xt/dialog.h"
#elif defined(__GTK__)
#include "wx/gtk/dialog.h"
#endif
#endif
// __DIALOGH_BASE__

13
include/wx/dirdlg.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __DIRDLGH_BASE__
#define __DIRDLGH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/dirdlg.h"
#elif defined(__MOTIF__)
#include "wx/xt/dirdlg.h"
#elif defined(__GTK__)
#include "wx/gtk/dirdlg.h"
#endif
#endif
// __DIRDLGH_BASE__

11
include/wx/dnd.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef __DNDH_BASE__
#define __DNDH_BASE__
#if defined(__WINDOWS__)
#elif defined(__MOTIF__)
#elif defined(__GTK__)
#include "wx/gtk/dnd.h"
#endif
#endif
// __DNDH_BASE__

519
include/wx/docview.h Normal file
View File

@ -0,0 +1,519 @@
/////////////////////////////////////////////////////////////////////////////
// Name: docview.h
// Purpose: Doc/View classes
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __DOCH__
#define __DOCH__
#ifdef __GNUG__
#pragma interface "docview.h"
#endif
#include "wx/defs.h"
#include "wx/list.h"
#include "wx/cmndata.h"
#include "wx/string.h"
#if USE_PRINTING_ARCHITECTURE
#include "wx/print.h"
#endif
class WXDLLEXPORT wxWindow;
class WXDLLEXPORT wxDocument;
class WXDLLEXPORT wxView;
class WXDLLEXPORT wxDocTemplate;
class WXDLLEXPORT wxDocManager;
class WXDLLEXPORT wxPrintInfo;
class WXDLLEXPORT wxCommand;
class WXDLLEXPORT wxCommandProcessor;
class WXDLLEXPORT wxFileHistory;
class WXDLLIMPORT ostream;
class WXDLLIMPORT istream;
// Document manager flags
#define wxDOC_SDI 1
#define wxDOC_MDI 2
#define wxDOC_NEW 4
#define wxDOC_SILENT 8
#define wxDEFAULT_DOCMAN_FLAGS wxDOC_SDI
// Document template flags
#define wxTEMPLATE_VISIBLE 1
#define wxTEMPLATE_INVISIBLE 2
#define wxDEFAULT_TEMPLATE_FLAGS wxTEMPLATE_VISIBLE
#define wxMAX_FILE_HISTORY 9
class WXDLLEXPORT wxDocument : public wxEvtHandler
{
DECLARE_ABSTRACT_CLASS(wxDocument)
public:
wxDocument(wxDocument *parent = NULL);
~wxDocument(void);
void SetFilename(const wxString& filename, bool notifyViews = FALSE);
inline wxString GetFilename(void) const { return m_documentFile; }
inline void SetTitle(const wxString& title) { m_documentTitle = title; };
inline wxString GetTitle(void) const { return m_documentTitle; }
inline void SetDocumentName(const wxString& name) { m_documentTypeName = name; };
inline wxString GetDocumentName(void) const { return m_documentTypeName; }
// Has the document been saved yet?
inline bool GetDocumentSaved(void) { return m_savedYet; }
inline void SetDocumentSaved(bool saved = TRUE) { m_savedYet = saved; }
virtual bool Close(void);
virtual bool Save(void);
virtual bool SaveAs(void);
virtual bool Revert(void);
virtual ostream& SaveObject(ostream& stream);
virtual istream& LoadObject(istream& stream);
// Called by wxWindows
virtual bool OnSaveDocument(const wxString& filename);
virtual bool OnOpenDocument(const wxString& filename);
virtual bool OnNewDocument(void);
virtual bool OnCloseDocument(void);
// Prompts for saving if about to close a modified document.
// Returns TRUE if ok to close the document (may have saved in the
// meantime, or set modified to FALSE)
virtual bool OnSaveModified(void);
// Called by framework if created automatically by the
// default document manager: gives document a chance to
// initialise and (usually) create a view
virtual bool OnCreate(const wxString& path, long flags);
// By default, creates a base wxCommandProcessor.
virtual wxCommandProcessor *OnCreateCommandProcessor(void);
virtual inline wxCommandProcessor *GetCommandProcessor(void) const { return m_commandProcessor; }
virtual inline void SetCommandProcessor(wxCommandProcessor *proc) { m_commandProcessor = proc; }
// Called after a view is added or removed.
// The default implementation deletes the document if this
// is there are no more views.
virtual void OnChangedViewList(void);
virtual bool DeleteContents(void);
virtual bool Draw(wxDC&);
virtual inline bool IsModified(void) const { return m_documentModified; }
virtual inline void Modify(bool mod) { m_documentModified = mod; }
virtual bool AddView(wxView *view);
virtual bool RemoveView(wxView *view);
inline wxList& GetViews(void) const { return (wxList&) m_documentViews; }
wxView *GetFirstView(void) const;
virtual void UpdateAllViews(wxView *sender = NULL, wxObject *hint = NULL);
// Remove all views (because we're closing the document)
virtual bool DeleteAllViews(void);
// Other stuff
virtual wxDocManager *GetDocumentManager(void) const;
virtual inline wxDocTemplate *GetDocumentTemplate(void) const { return m_documentTemplate; }
virtual inline void SetDocumentTemplate(wxDocTemplate *temp) { m_documentTemplate = temp; }
// Get title, or filename if no title, else [unnamed]
virtual bool GetPrintableName(wxString& buf) const;
// Returns a window that can be used as a parent for document-related
// dialogs. Override if necessary.
virtual wxWindow *GetDocumentWindow(void) const;
protected:
wxList m_documentViews;
wxString m_documentFile;
wxString m_documentTitle;
wxString m_documentTypeName;
wxDocTemplate* m_documentTemplate;
bool m_documentModified;
wxDocument* m_documentParent;
wxCommandProcessor* m_commandProcessor;
bool m_savedYet;
};
class WXDLLEXPORT wxView: public wxEvtHandler
{
DECLARE_ABSTRACT_CLASS(wxView)
public:
wxView(wxDocument *doc = NULL);
~wxView(void);
inline wxDocument *GetDocument(void) const { return m_viewDocument; }
void SetDocument(wxDocument *doc);
inline wxString GetViewName(void) const { return m_viewTypeName; }
void SetViewName(const wxString& name) { m_viewTypeName = name; };
inline wxFrame *GetFrame(void) const { return m_viewFrame ; }
inline void SetFrame(wxFrame *frame) { m_viewFrame = frame; }
virtual void OnActivateView(bool activate, wxView *activeView, wxView *deactiveView);
virtual void OnDraw(wxDC *dc) = 0;
virtual void OnPrint(wxDC *dc, wxObject *info);
virtual void OnUpdate(wxView *sender, wxObject *hint = NULL);
virtual void OnChangeFilename(void);
// Called by framework if created automatically by the
// default document manager class: gives view a chance to
// initialise
virtual bool OnCreate(wxDocument *WXUNUSED(doc), long WXUNUSED(flags)) { return TRUE; };
// Checks if the view is the last one for the document; if so,
// asks user to confirm save data (if modified). If ok,
// deletes itself and returns TRUE.
virtual bool Close(bool deleteWindow = TRUE);
// Override to do cleanup/veto close
virtual bool OnClose(bool deleteWindow);
// Defeat compiler warning
inline bool OnClose(void) { return wxEvtHandler::OnClose(); }
// Extend event processing to search the document's event table
virtual bool ProcessEvent(wxEvent& event);
// A view's window can call this to notify the view it is (in)active.
// The function then notifies the document manager.
virtual void Activate(bool activate);
inline wxDocManager *GetDocumentManager(void) const { return m_viewDocument->GetDocumentManager(); }
#if USE_PRINTING_ARCHITECTURE
virtual wxPrintout *OnCreatePrintout(void);
#endif
protected:
wxDocument* m_viewDocument;
wxString m_viewTypeName;
wxFrame* m_viewFrame;
};
// Represents user interface (and other) properties of documents and views
class WXDLLEXPORT wxDocTemplate: public wxObject
{
DECLARE_CLASS(wxDocTemplate)
friend class WXDLLEXPORT wxDocManager;
public:
// Associate document and view types.
// They're for identifying what view is associated with what
// template/document type
wxDocTemplate(wxDocManager *manager, const wxString& descr, const wxString& filter, const wxString& dir,
const wxString& ext, const wxString& docTypeName, const wxString& viewTypeName,
wxClassInfo *docClassInfo = NULL, wxClassInfo *viewClassInfo = NULL,
long flags = wxDEFAULT_TEMPLATE_FLAGS);
~wxDocTemplate(void);
// By default, these two member functions dynamically creates document
// and view using dynamic instance construction.
// Override these if you need a different method of construction.
virtual wxDocument *CreateDocument(const wxString& path, long flags = 0);
virtual wxView *CreateView(wxDocument *doc, long flags = 0);
inline wxString GetDefaultExtension(void) const { return m_defaultExt; };
inline wxString GetDescription(void) const { return m_description; }
inline wxString GetDirectory(void) const { return m_directory; };
inline wxDocManager *GetDocumentManager(void) const { return m_documentManager; }
inline void SetDocumentManager(wxDocManager *manager) { m_documentManager = manager; }
inline wxString GetFileFilter(void) const { return m_fileFilter; };
inline long GetFlags(void) const { return m_flags; };
virtual wxString GetViewName(void) const { return m_viewTypeName; }
virtual wxString GetDocumentName(void) const { return m_docTypeName; }
inline void SetFileFilter(const wxString& filter) { m_fileFilter = filter; };
inline void SetDirectory(const wxString& dir) { m_directory = dir; };
inline void SetDescription(const wxString& descr) { m_description = descr; };
inline void SetDefaultExtension(const wxString& ext) { m_defaultExt = ext; };
inline void SetFlags(long flags) { m_flags = flags; };
inline bool IsVisible(void) const { return ((m_flags & wxTEMPLATE_VISIBLE) == wxTEMPLATE_VISIBLE); }
protected:
long m_flags;
wxString m_fileFilter;
wxString m_directory;
wxString m_description;
wxString m_defaultExt;
wxString m_docTypeName;
wxString m_viewTypeName;
wxDocManager* m_documentManager;
// For dynamic creation of appropriate instances.
wxClassInfo* m_docClassInfo;
wxClassInfo* m_viewClassInfo;
};
// One object of this class may be created in an application,
// to manage all the templates and documents.
class WXDLLEXPORT wxDocManager: public wxEvtHandler
{
DECLARE_DYNAMIC_CLASS(wxDocManager)
public:
wxDocManager(long flags = wxDEFAULT_DOCMAN_FLAGS, bool initialize = TRUE);
~wxDocManager(void);
virtual bool Initialize(void);
// Handlers for common user commands
// virtual void OldOnMenuCommand(int command);
void OnFileClose(wxCommandEvent& event);
void OnFileNew(wxCommandEvent& event);
void OnFileOpen(wxCommandEvent& event);
void OnFileRevert(wxCommandEvent& event);
void OnFileSave(wxCommandEvent& event);
void OnFileSaveAs(wxCommandEvent& event);
void OnPrint(wxCommandEvent& event);
void OnPrintSetup(wxCommandEvent& event);
void OnPreview(wxCommandEvent& event);
void OnUndo(wxCommandEvent& event);
void OnRedo(wxCommandEvent& event);
#ifdef WXWIN_COMPATIBILITY
virtual wxDocument *CreateDocument(char *WXUNUSED(path), long WXUNUSED(flags = 0)) { return NULL; };
#endif
virtual wxDocument *CreateDocument(const wxString& path, long flags = 0);
virtual wxView *CreateView(wxDocument *doc, long flags = 0);
virtual void DeleteTemplate(wxDocTemplate *temp, long flags = 0);
virtual bool FlushDoc(wxDocument *doc);
virtual wxDocTemplate *MatchTemplate(const wxString& path);
virtual wxDocTemplate *SelectDocumentPath(wxDocTemplate **templates,
int noTemplates, wxString& path, long flags, bool save = FALSE);
virtual wxDocTemplate *SelectDocumentType(wxDocTemplate **templates,
int noTemplates);
virtual wxDocTemplate *SelectViewType(wxDocTemplate **templates,
int noTemplates);
virtual wxDocTemplate *FindTemplateForPath(const wxString& path);
void AssociateTemplate(wxDocTemplate *temp);
void DisassociateTemplate(wxDocTemplate *temp);
wxDocument *GetCurrentDocument(void) const;
inline void SetMaxDocsOpen(int n) { m_maxDocsOpen = n; }
inline int GetMaxDocsOpen(void) const { return m_maxDocsOpen; }
// Add and remove a document from the manager's list
void AddDocument(wxDocument *doc);
void RemoveDocument(wxDocument *doc);
// Clear remaining documents and templates
bool Clear(bool force = TRUE);
// Views or windows should inform the document manager
// when a view is going in or out of focus
virtual void ActivateView(wxView *view, bool activate = TRUE, bool deleting = FALSE);
virtual inline wxView *GetCurrentView(void) const { return m_currentView; }
virtual inline wxList& GetDocuments(void) const { return (wxList&) m_docs; }
// Make a default document name
virtual bool MakeDefaultName(wxString& buf);
virtual wxFileHistory *OnCreateFileHistory(void);
virtual inline wxFileHistory *GetFileHistory(void) const { return m_fileHistory; }
// File history management
virtual void AddFileToHistory(const wxString& file);
virtual int GetNoHistoryFiles(void) const;
virtual wxString GetHistoryFile(int i) const;
virtual void FileHistoryUseMenu(wxMenu *menu);
virtual void FileHistoryLoad(const wxString& resourceFile, const wxString& section);
virtual void FileHistorySave(const wxString& resourceFile, const wxString& section);
protected:
long m_flags;
int m_defaultDocumentNameCounter;
int m_maxDocsOpen;
wxList m_docs;
wxList m_templates;
wxView* m_currentView;
wxFileHistory* m_fileHistory;
DECLARE_EVENT_TABLE()
};
/*
* A default child frame
*/
class WXDLLEXPORT wxDocChildFrame: public wxFrame
{
DECLARE_CLASS(wxDocChildFrame)
public:
wxDocChildFrame(wxDocument *doc, wxView *view, wxFrame *frame, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
const long type = wxDEFAULT_FRAME_STYLE, const wxString& name = "frame");
~wxDocChildFrame(void);
bool OnClose(void);
// Extend event processing to search the view's event table
virtual bool ProcessEvent(wxEvent& event);
// void OldOnMenuCommand(int id);
void OnActivate(wxActivateEvent& event);
inline wxDocument *GetDocument(void) const { return m_childDocument; }
inline wxView *GetView(void) const { return m_childView; }
inline void SetDocument(wxDocument *doc) { m_childDocument = doc; }
inline void SetView(wxView *view) { m_childView = view; }
protected:
wxDocument* m_childDocument;
wxView* m_childView;
DECLARE_EVENT_TABLE()
};
/*
* A default parent frame
*/
class WXDLLEXPORT wxDocParentFrame: public wxFrame
{
DECLARE_CLASS(wxDocParentFrame)
public:
wxDocParentFrame(wxDocManager *manager, wxFrame *frame, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
const long type = wxDEFAULT_FRAME, const wxString& name = "frame");
bool OnClose(void);
// Extend event processing to search the document manager's event table
virtual bool ProcessEvent(wxEvent& event);
// void OldOnMenuCommand(int id);
wxDocManager *GetDocumentManager(void) const { return m_docManager; }
void OnExit(wxCommandEvent& event);
void OnMRUFile(wxCommandEvent& event);
protected:
wxDocManager *m_docManager;
DECLARE_EVENT_TABLE()
};
/*
* Provide simple default printing facilities
*/
#if USE_PRINTING_ARCHITECTURE
class WXDLLEXPORT wxDocPrintout: public wxPrintout
{
DECLARE_DYNAMIC_CLASS(wxDocPrintout)
public:
wxDocPrintout(wxView *view = NULL, const wxString& title = "Printout");
bool OnPrintPage(int page);
bool HasPage(int page);
bool OnBeginDocument(int startPage, int endPage);
void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo);
virtual inline wxView *GetView(void) { return m_printoutView; }
protected:
wxView* m_printoutView;
};
#endif
/*
* Command processing framework
*/
class WXDLLEXPORT wxCommand: public wxObject
{
DECLARE_CLASS(wxCommand)
public:
wxCommand(bool canUndoIt = FALSE, const wxString& name = "");
~wxCommand(void);
// Override this to perform a command
virtual bool Do(void) = 0;
// Override this to undo a command
virtual bool Undo(void) = 0;
virtual inline bool CanUndo(void) const { return m_canUndo; }
virtual inline wxString GetName(void) const { return m_commandName; }
protected:
bool m_canUndo;
wxString m_commandName;
};
class WXDLLEXPORT wxCommandProcessor: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxCommandProcessor)
public:
wxCommandProcessor(int maxCommands = 100);
~wxCommandProcessor(void);
// Pass a command to the processor. The processor calls Do();
// if successful, is appended to the command history unless
// storeIt is FALSE.
virtual bool Submit(wxCommand *command, bool storeIt = TRUE);
virtual bool Undo(void);
virtual bool Redo(void);
virtual bool CanUndo(void);
// Call this to manage an edit menu.
inline void SetEditMenu(wxMenu *menu) { m_commandEditMenu = menu; }
inline wxMenu *GetEditMenu(void) const { return m_commandEditMenu; }
virtual void SetMenuStrings(void);
virtual void Initialize(void);
inline wxList& GetCommands(void) const { return (wxList&) m_commands; }
inline int GetMaxCommands(void) const { return m_maxNoCommands; }
virtual void ClearCommands(void);
protected:
int m_maxNoCommands;
wxList m_commands;
wxNode* m_currentCommand;
wxMenu* m_commandEditMenu;
};
class WXDLLEXPORT wxFileHistory: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxFileHistory)
public:
wxFileHistory(int maxFiles = 9);
~wxFileHistory(void);
// File history management
virtual void AddFileToHistory(const wxString& file);
inline virtual int GetNoHistoryFiles(void) const { return m_fileHistoryN; }
virtual wxString GetHistoryFile(int i) const;
virtual int GetMaxFiles(void) const { return m_fileMaxFiles; }
virtual void FileHistoryUseMenu(wxMenu *menu);
virtual void FileHistoryLoad(const wxString& resourceFile, const wxString& section);
virtual void FileHistorySave(const wxString& resourceFile, const wxString& section);
protected:
// Last n files
char** m_fileHistory;
// Number of files saved
int m_fileHistoryN;
// Menu to maintain
wxMenu* m_fileMenu;
// Max files to maintain
int m_fileMaxFiles;
};
// For compatibility with existing file formats:
// converts from/to a stream to/from a temporary file.
bool WXDLLEXPORT wxTransferFileToStream(const wxString& filename, ostream& stream);
bool WXDLLEXPORT wxTransferStreamToFile(istream& stream, const wxString& filename);
#endif

338
include/wx/dynarray.h Normal file
View File

@ -0,0 +1,338 @@
///////////////////////////////////////////////////////////////////////////////
// Name: dynarray.h
// Purpose: auto-resizable (i.e. dynamic) array support
// Author: Vadim Zeitlin
// Modified by:
// Created: 12.09.97
// RCS-ID: $Id$
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
#ifndef _DYNARRAY_H
#define _DYNARRAY_H
#ifdef __GNUG__
#pragma interface "dynarray.h"
#endif
#include "wx/defs.h"
#include "wx/utils.h"
typedef bool Bool;
/** @name Dynamic arrays and lists
@memo Arrays which grow on demand and do range checking (only in debug)
*/
//@{
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
/**
the initial size by which an array/list grows when an element is added
default value avoids allocate one or two bytes when the array is created
which is rather inefficient
*/
#define WX_ARRAY_DEFAULT_INITIAL_SIZE (16)
// ----------------------------------------------------------------------------
// types
// ----------------------------------------------------------------------------
/**
callback compare function for quick sort
must return -1, 0 or +1 if pItem1 <, = or > pItem2
*/
#ifdef __VISUALC__
#define CMPFUNC_CONV _cdecl
#else // !Visual C++
#define CMPFUNC_CONV
#endif // compiler
typedef int (CMPFUNC_CONV *CMPFUNC)(const void* pItem1, const void* pItem2);
// ----------------------------------------------------------------------------
/**
base class managing data having size of type 'long' (not used directly)
NB: for efficiency this often used class has no virtual functions (hence no
VTBL), even dtor is <B>not</B> virtual. If used as expected it won't
create any problems because ARRAYs from DEFINE_ARRAY have no dtor at all,
so it's not too important if it's not called (this happens when you cast
"SomeArray *" as "BaseArray *" and then delete it)
@memo Base class for template array and list classes
*/
// ----------------------------------------------------------------------------
class wxBaseArray
{
public:
/** @name ctors and dtor */
//@{
/// default ctor
wxBaseArray();
/// copy ctor
wxBaseArray(const wxBaseArray& array);
/// assignment operator
wxBaseArray& operator=(const wxBaseArray& src);
/// not virtual, see above
/// EXCEPT for Gnu compiler to reduce warnings...
#ifdef __GNUG__
virtual
#endif
~wxBaseArray();
//@}
/** @name memory management */
//@{
/// empties the list, but doesn't release memory
void Empty() { m_uiCount = 0; }
/// empties the list and releases memory
void Clear();
/// preallocates memory for given number of items
void Alloc(uint uiSize);
//@}
/** @name simple accessors */
//@{
/// number of elements in the array
uint Count() const { return m_uiCount; }
/// is it empty?
Bool IsEmpty() const { return m_uiCount == 0; }
//@}
protected:
// these methods are protected because if they were public one could
// mistakenly call one of them instead of DEFINE_ARRAY's or LIST's
// type safe methods
/** @name items access */
//@{
/// get item at position uiIndex (range checking is done in debug version)
long& Item(uint uiIndex) const
{ wxASSERT( uiIndex < m_uiCount ); return m_pItems[uiIndex]; }
/// same as Item()
long& operator[](uint uiIndex) const { return Item(uiIndex); }
//@}
/** @name item management */
//@{
/**
Search the element in the array, starting from the either side
@param bFromEnd if TRUE, start from the end
@return index of the first item matched or NOT_FOUND
@see NOT_FOUND
*/
int Index (long lItem, Bool bFromEnd = FALSE) const;
/// add new element at the end
void Add (long lItem);
/// add new element at given position
void Insert(long lItem, uint uiIndex);
/// remove first item matching this value
void Remove(long lItem);
/// remove item by index
void Remove(uint uiIndex);
//@}
/// sort array elements using given compare function
void Sort(CMPFUNC fCmp);
private:
void Grow(); // makes array bigger if needed
uint m_uiSize, // current size of the array
m_uiCount; // current number of elements
long *m_pItems; // pointer to data
};
// ============================================================================
// template classes
// ============================================================================
// ----------------------------------------------------------------------------
// This macro generates a new array class. It is intended for storage of simple
// types of sizeof()<=sizeof(long) or pointers if sizeof(pointer)<=sizeof(long)
//
// NB: it has only inline functions => takes no space at all
// ----------------------------------------------------------------------------
#define _WX_DEFINE_ARRAY(T, name) \
typedef int (CMPFUNC_CONV *CMPFUNC##T)(T *pItem1, T *pItem2); \
class name : public wxBaseArray \
{ \
public: \
name() \
{ wxASSERT( sizeof(T) <= sizeof(long) ); } \
\
name& operator=(const name& src) \
{ ((wxBaseArray *)this)->operator=((const wxBaseArray&)src); \
return *this; } \
\
T& operator[](uint uiIndex) const \
{ return (T&)(wxBaseArray::Item(uiIndex)); } \
T& Item(uint uiIndex) const \
{ return (T&)(wxBaseArray::Item(uiIndex)); } \
\
int Index(T Item, Bool bFromEnd = FALSE) const \
{ return wxBaseArray::Index((long)Item, bFromEnd); } \
\
void Add(T Item) \
{ wxBaseArray::Add((long)Item); } \
void Insert(T Item, uint uiIndex) \
{ wxBaseArray::Insert((long)Item, uiIndex) ; } \
\
void Remove(uint uiIndex) { wxBaseArray::Remove(uiIndex); } \
void Remove(T Item) \
{ int iIndex = Index(Item); \
wxCHECK( iIndex != NOT_FOUND ); \
wxBaseArray::Remove((uint)iIndex); } \
\
void Sort(CMPFUNC##T fCmp) { wxBaseArray::Sort((CMPFUNC)fCmp); } \
}
// ----------------------------------------------------------------------------
// see WX_DECLARE_LIST and WX_DEFINE_LIST
// ----------------------------------------------------------------------------
#define _WX_DECLARE_LIST(T, name) \
typedef int (CMPFUNC_CONV *CMPFUNC##T)(T** pItem1, T** pItem2); \
class name : public wxBaseArray \
{ \
public: \
name() { } \
name(const name& src); \
name& operator=(const name& src); \
\
~name(); \
\
T& operator[](uint uiIndex) const \
{ return *(T*)wxBaseArray::Item(uiIndex); } \
T& Item(uint uiIndex) const \
{ return *(T*)wxBaseArray::Item(uiIndex); } \
\
int Index(const T& Item, Bool bFromEnd = FALSE) const; \
\
void Add(const T& Item); \
void Add(const T* pItem) \
{ wxBaseArray::Add((long)pItem); } \
\
void Insert(const T& Item, uint uiIndex); \
void Insert(const T* pItem, uint uiIndex) \
{ wxBaseArray::Insert((long)pItem, uiIndex); } \
\
void Empty(); \
\
T* Detach(uint uiIndex) \
{ T* p = (T*)wxBaseArray::Item(uiIndex); \
wxBaseArray::Remove(uiIndex); return p; } \
void Remove(uint uiIndex); \
\
void Sort(CMPFUNC##T fCmp) { wxBaseArray::Sort((CMPFUNC)fCmp); } \
\
private: \
void DoCopy(const name& src); \
}
// ----------------------------------------------------------------------------
/** @name Macros for definition of dynamic arrays and lists
These macros are ugly (especially if you look in the sources ;-), but they
allow us to define 'template' classes without actually using templates.
<BR>
<BR>
Range checking is performed in debug build for both arrays and lists. Type
checking is done at compile-time. Warning: arrays <I>never</I> shrink, they
only grow, so loading 10 millions in an array only to delete them 2 lines
below is <I>not</I> recommended. However, it does free memory when it's
destroyed, so if you destroy array also, it's ok.
*/
// ----------------------------------------------------------------------------
//@{
/**
This macro generates a new array class. It is intended for storage of simple
types of sizeof()<=sizeof(long) or pointers if sizeof(pointer)<=sizeof(long)
<BR>
NB: it has only inline functions => takes no space at all
<BR>
@memo declare and define array class 'name' containing elements of type 'T'
*/
#define WX_DEFINE_ARRAY(T, name) typedef T _A##name; \
_WX_DEFINE_ARRAY(_A##name, name)
/**
This macro generates a new list class which owns the objects it contains,
i.e. it will delete them when it is destroyed. An element is of type T*,
but arguments of type T& are taken (see below!) and T& is returned.
<BR>
Don't use this for simple types such as "int" or "long"!
You _may_ use it for "double" but it's awfully inefficient.
<BR>
<BR>
Note on Add/Insert functions:
<BR>
1) function(T*) gives the object to the list, i.e. it will delete the
object when it's removed or in the list's dtor
<BR>
2) function(T&) will create a copy of the object and work with it
<BR>
<BR>
Also:
<BR>
1) Remove() will delete the object after removing it from the list
<BR>
2) Detach() just removes the object from the list (returning pointer to it)
<BR>
<BR>
NB1: Base type T should have an accessible copy ctor if Add(T&) is used,
<BR>
NB2: Never ever cast a list to it's base type: as dtor is <B>not</B> virtual
it will provoke memory leaks
<BR>
<BR>
some functions of this class are not inline, so it takes some space to
define new class from this template.
@memo declare list class 'name' containing elements of type 'T'
*/
#define WX_DECLARE_LIST(T, name) typedef T _L##name; \
_WX_DECLARE_LIST(_L##name, name)
/**
To use a list class you must
<ll>
<li>#include "dynarray.h"
<li>DECLARE_LIST(element_type, list_class_name)
<li>#include "listimpl.cpp"
<li>DEFINE_LIST(list_class_name) // same as above!
</ll>
<BR><BR>
This is necessary because at the moment of DEFINE_LIST class element_type
must be fully defined (i.e. forward declaration is not enough), while
DECLARE_LIST may be done anywhere. The separation of two allows to break
cicrcular dependencies with classes which have member variables of list
type.
@memo define (must include listimpl.cpp!) list class 'name'
*/
#define WX_DEFINE_LIST(name) "don't forget to include listimpl.cpp!"
//@}
// ----------------------------------------------------------------------------
/** @name Some commonly used predefined arrays */
// # overhead if not used?
// ----------------------------------------------------------------------------
//@{
/** @name ArrayInt */
WX_DEFINE_ARRAY(int, wxArrayInt);
/** @name ArrayLong */
WX_DEFINE_ARRAY(long, wxArrayLong);
/** @name ArrayPtrVoid */
WX_DEFINE_ARRAY(void *, wxArrayPtrVoid);
//@}
//@}
#endif // _DYNARRAY_H

1199
include/wx/event.h Normal file

File diff suppressed because it is too large Load Diff

159
include/wx/file.h Normal file
View File

@ -0,0 +1,159 @@
/////////////////////////////////////////////////////////////////////////////
// Name: file.cpp
// Purpose: wxFile - encapsulates low-level "file descriptor"
// wxTempFile - safely replace the old file
// Author: Vadim Zeitlin
// Modified by:
// Created: 29/01/98
// RCS-ID: $Id$
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef __FILEH__
#define __FILEH__
#ifdef __GNUG__
#pragma interface "file.h"
#endif
// ----------------------------------------------------------------------------
// simple types
// ----------------------------------------------------------------------------
#include <wx/filefn.h>
// define off_t
#include <sys/types.h>
#ifdef _MSC_VER
#define off_t _off_t
#endif
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// error return value for Seek() functions
const off_t ofsInvalid = (off_t)-1;
// ----------------------------------------------------------------------------
// class wxFile: raw file IO
//
// NB: for space efficiency this class has no virtual functions, including
// dtor which is _not_ virtual, so it shouldn't be used as a base class.
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxFile
{
public:
// more file constants
// -------------------
// opening mode
enum OpenMode { read, write, read_write };
// standard values for file descriptor
enum { fd_invalid = -1, fd_stdin, fd_stdout, fd_stderr };
// seek type
enum SeekMode { FromStart, FromEnd, FromCurrent };
// static functions
// ----------------
static bool Exists(const char *sz); // also checks it's a regular file
// ctors
// -----
// def ctor
wxFile() { m_fd = fd_invalid; }
// open specified file (may fail, use IsOpened())
wxFile(const char *szFileName, OpenMode mode = read);
// attach to (already opened) file
wxFile(int fd) { m_fd = fd; }
// open/close
bool Create(const char *szFileName, bool bOverwrite = FALSE);
bool Open(const char *szFileName, OpenMode mode = read);
void Attach(int fd) { Close(); m_fd = fd; }
inline void Close(); // Close is a NOP if not opened
// read/write (unbuffered)
// returns number of bytes read or ofsInvalid on error
off_t Read(void *pBuf, off_t nCount);
// returns true on success
bool Write(const void *pBuf, uint nCount);
// returns true on success
bool Write(const wxString& str) { return Write(str.c_str(), str.Len()); }
// flush data not yet written
bool Flush();
// file pointer operations (return ofsInvalid on failure)
// move ptr ofs bytes related to start/current off_t/end of file
off_t Seek(off_t ofs, SeekMode mode = FromStart);
// move ptr to ofs bytes before the end
off_t SeekEnd(off_t ofs = 0) { return Seek(ofs, FromEnd); }
// get current off_t
off_t Tell() const;
// get current file length
off_t Length() const;
// simple accessors
// is file opened?
bool IsOpened() const { return m_fd != fd_invalid; }
// is end of file reached?
bool Eof() const;
// dtor closes the file if opened
~wxFile();
private:
// copy ctor and assignment operator are private because
// it doesn't make sense to copy files this way:
// attempt to do it will provoke a compile-time error.
wxFile(const wxFile&);
wxFile& operator=(const wxFile&);
int m_fd; // file descriptor or INVALID_FD if not opened
};
// ----------------------------------------------------------------------------
// class wxTempFile: if you want to replace another file, create an instance
// of wxTempFile passing the name of the file to be replaced to the ctor. Then
// you can write to wxTempFile and call Commit() function to replace the old
// file (and close this one) or call Discard() to cancel the modification. If
// you call neither of them, dtor will call Discard().
// ----------------------------------------------------------------------------
class wxTempFile
{
public:
// ctors
// default
wxTempFile() { }
// associates the temp file with the file to be replaced and opens it
wxTempFile(const wxString& strName);
// open the temp file (strName is the name of file to be replaced)
bool Open(const wxString& strName);
// is the file opened?
bool IsOpened() const { return m_file.IsOpened(); }
// I/O (both functions return true on success, false on failure)
bool Write(const void *p, uint n) { return m_file.Write(p, n); }
bool Write(const wxString& str) { return m_file.Write(str); }
// different ways to close the file
// validate changes and delete the old file of name m_strName
bool Commit();
// discard changes
void Discard();
// dtor calls Discard() if file is still opened
~wxTempFile();
private:
wxString m_strName, // name of the file to replace in Commit()
m_strTemp; // temporary file name
wxFile m_file; // the temporary file
};
#endif
// __FILEH__

13
include/wx/filedlg.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __FILEDLGH_BASE__
#define __FILEDLGH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/filedlg.h"
#elif defined(__MOTIF__)
#include "wx/xt/filedlg.h"
#elif defined(__GTK__)
#include "wx/gtk/filedlg.h"
#endif
#endif
// __FILEDLGH_BASE__

166
include/wx/filefn.h Normal file
View File

@ -0,0 +1,166 @@
/////////////////////////////////////////////////////////////////////////////
// Name: filefn.h
// Purpose: File- and directory-related functions
// Author: Julian Smart
// Modified by:
// Created: 29/01/98
// RCS-ID: $Id$
// Copyright: (c) 1998 Julian Smart
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef __FILEFNH__
#define __FILEFNH__
#ifdef __GNUG__
#pragma interface "filefn.h"
#endif
#include "wx/list.h"
bool WXDLLEXPORT wxFileExists(const wxString& filename);
#define FileExists wxFileExists
// does the path exist? (may have or not '/' or '\\' at the end)
bool WXDLLEXPORT wxPathExists(const char *pszPathName);
#define wxDirExists wxPathExists
#define DirExists wxDirExists
bool WXDLLEXPORT wxIsAbsolutePath(const wxString& filename);
#define IsAbsolutePath wxIsAbsolutePath
// Get filename
char* WXDLLEXPORT wxFileNameFromPath(char *path);
wxString WXDLLEXPORT wxFileNameFromPath(const wxString& path);
#define FileNameFromPath wxFileNameFromPath
// Get directory
char* WXDLLEXPORT wxPathOnly(char *path);
wxString WXDLLEXPORT wxPathOnly(const wxString& path);
#define PathOnly wxPathOnly
// wxString version
wxString WXDLLEXPORT wxRealPath(const wxString& path);
void WXDLLEXPORT wxDos2UnixFilename(char *s);
#define Dos2UnixFilename wxDos2UnixFilename
void WXDLLEXPORT wxUnix2DosFilename(char *s);
#define Unix2DosFilename wxUnix2DosFilename
// Strip the extension, in situ
void WXDLLEXPORT wxStripExtension(char *buffer);
// Get a temporary filename, opening and closing the file.
char* WXDLLEXPORT wxGetTempFileName(const wxString& prefix, char *buf = NULL);
// Expand file name (~/ and ${OPENWINHOME}/ stuff)
char* WXDLLEXPORT wxExpandPath(char *dest, const char *path);
// Contract w.r.t environment (</usr/openwin/lib, OPENWHOME> -> ${OPENWINHOME}/lib)
// and make (if under the home tree) relative to home
// [caller must copy-- volatile]
char* WXDLLEXPORT wxContractPath (const wxString& filename,
const wxString& envname = "", const wxString& user = "");
// Destructive removal of /./ and /../ stuff
char* WXDLLEXPORT wxRealPath(char *path);
// Allocate a copy of the full absolute path
char* WXDLLEXPORT wxCopyAbsolutePath(const wxString& path);
// Get first file name matching given wild card.
// Flags are reserved for future use.
#define wxFILE 1
#define wxDIR 2
char* WXDLLEXPORT wxFindFirstFile(const char *spec, int flags = wxFILE);
char* WXDLLEXPORT wxFindNextFile(void);
// Does the pattern contain wildcards?
bool WXDLLEXPORT wxIsWild(const wxString& pattern);
// Does the pattern match the text (usually a filename)?
// If dot_special is TRUE, doesn't match * against . (eliminating
// `hidden' dot files)
bool WXDLLEXPORT wxMatchWild(const wxString& pattern, const wxString& text, bool dot_special = TRUE);
// Concatenate two files to form third
bool WXDLLEXPORT wxConcatFiles(const wxString& file1, const wxString& file2, const wxString& file3);
// Copy file1 to file2
bool WXDLLEXPORT wxCopyFile(const wxString& file1, const wxString& file2);
// Remove file
bool WXDLLEXPORT wxRemoveFile(const wxString& file);
// Rename file
bool WXDLLEXPORT wxRenameFile(const wxString& file1, const wxString& file2);
// Get current working directory.
// If buf is NULL, allocates space using new, else
// copies into buf.
// IMPORTANT NOTE getcwd is know not to work under some releases
// of Win32s 1.3, according to MS release notes!
char* WXDLLEXPORT wxGetWorkingDirectory(char *buf = NULL, int sz = 1000);
// Set working directory
bool WXDLLEXPORT wxSetWorkingDirectory(const wxString& d);
// Make directory
bool WXDLLEXPORT wxMkdir(const wxString& dir);
// Remove directory. Flags reserved for future use.
bool WXDLLEXPORT wxRmdir(const wxString& dir, int flags = 0);
// separators in file names
#define FILE_SEP_EXT '.'
#define FILE_SEP_DSK ':'
#define FILE_SEP_PATH_DOS '\\'
#define FILE_SEP_PATH_UNIX '/'
// separator in the path list (as in PATH environment variable)
// NB: these are strings and not characters on purpose!
#define PATH_SEP_DOS ";"
#define PATH_SEP_UNIX ":"
// platform independent versions
#ifdef __UNIX__
#define FILE_SEP_PATH FILE_SEP_PATH_UNIX
#define PATH_SEP PATH_SEP_UNIX
#else // Windows
#define FILE_SEP_PATH FILE_SEP_PATH_DOS
#define PATH_SEP PATH_SEP_DOS
#endif // Unix/Windows
// is the char a path separator?
inline bool wxIsPathSeparator(char c)
{ return c == FILE_SEP_PATH_DOS || c == FILE_SEP_PATH_UNIX; }
// does the string ends with path separator?
bool WXDLLEXPORT wxEndsWithPathSeparator(const char *pszFileName);
// find a file in a list of directories, returns false if not found
bool WXDLLEXPORT wxFindFileInPath(wxString *pStr, const char *pszPath, const char *pszFile);
// Path searching
class WXDLLEXPORT wxPathList: public wxStringList
{
DECLARE_DYNAMIC_CLASS(wxPathList)
public:
void AddEnvList(const wxString& envVariable); // Adds all paths in environment variable
void Add(const wxString& path);
wxString FindValidPath(const wxString& filename); // Find the first full path
// for which the file exists
wxString FindAbsoluteValidPath(const wxString& filename); // Find the first full path
// for which the file exists; ensure it's an absolute
// path that gets returned.
void EnsureFileAccessible(const wxString& path); // Given full path and filename,
// add path to list
bool Member(const wxString& path);
};
#endif
// __FILEFNH__

13
include/wx/font.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __FONTH_BASE__
#define __FONTH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/font.h"
#elif defined(__MOTIF__)
#include "wx/xt/font.h"
#elif defined(__GTK__)
#include "wx/gtk/font.h"
#endif
#endif
// __FONTH_BASE__

13
include/wx/fontdlg.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __FONTDLGH_BASE__
#define __FONTDLGH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/fontdlg.h"
#elif defined(__MOTIF__)
#include "wx/generic/fontdlgg.h"
#elif defined(__GTK__)
#include "wx/generic/fontdlgg.h"
#endif
#endif
// __FONTDLGH_BASE__

13
include/wx/frame.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __FRAMEH_BASE__
#define __FRAMEH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/frame.h"
#elif defined(__MOTIF__)
#include "wx/xt/frame.h"
#elif defined(__GTK__)
#include "wx/gtk/frame.h"
#endif
#endif
// __FRAMEH_BASE__

13
include/wx/gauge.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __GAUGEH_BASE__
#define __GAUGEH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/gauge.h"
#elif defined(__MOTIF__)
#include "wx/xt/gauge.h"
#elif defined(__GTK__)
#include "wx/gtk/gauge.h"
#endif
#endif
// __GAUGEH_BASE__

335
include/wx/gdicmn.h Normal file
View File

@ -0,0 +1,335 @@
/////////////////////////////////////////////////////////////////////////////
// Name: gdicmn.h
// Purpose: Common GDI classes, types and declarations
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GDICMNH__
#define __GDICMNH__
#ifdef __GNUG__
#pragma interface "gdicmn.h"
#endif
#include "wx/object.h"
#include "wx/list.h"
#include "wx/hash.h"
#include "wx/setup.h"
#ifdef __WINDOWS__
#include "wx/msw/colour.h"
#elif defined(__MOTIF__)
#include "wx/xt/colour.h"
#elif defined(__GTK__)
#include "wx/gtk/colour.h"
#endif
// Standard cursors
typedef enum {
wxCURSOR_ARROW = 1,
wxCURSOR_BULLSEYE,
wxCURSOR_CHAR,
wxCURSOR_CROSS,
wxCURSOR_HAND,
wxCURSOR_IBEAM,
wxCURSOR_LEFT_BUTTON,
wxCURSOR_MAGNIFIER,
wxCURSOR_MIDDLE_BUTTON,
wxCURSOR_NO_ENTRY,
wxCURSOR_PAINT_BRUSH,
wxCURSOR_PENCIL,
wxCURSOR_POINT_LEFT,
wxCURSOR_POINT_RIGHT,
wxCURSOR_QUESTION_ARROW,
wxCURSOR_RIGHT_BUTTON,
wxCURSOR_SIZENESW,
wxCURSOR_SIZENS,
wxCURSOR_SIZENWSE,
wxCURSOR_SIZEWE,
wxCURSOR_SIZING,
wxCURSOR_SPRAYCAN,
wxCURSOR_WAIT,
wxCURSOR_WATCH,
wxCURSOR_BLANK
#ifdef __X__
/* Not yet implemented for Windows */
, wxCURSOR_CROSS_REVERSE,
wxCURSOR_DOUBLE_ARROW,
wxCURSOR_BASED_ARROW_UP,
wxCURSOR_BASED_ARROW_DOWN
#endif
} _standard_cursors_t;
class WXDLLEXPORT wxSize: public wxObject
{
public:
long x;
long y;
inline wxSize(void) { x = 0; y = 0; }
inline wxSize(long xx, long yy) { x = xx; y = yy; }
inline wxSize(const wxSize& sz) { x = sz.x; y = sz.y; }
inline void operator = (const wxSize& sz) { x = sz.x; y = sz.y; }
inline void Set(long xx, long yy) { x = xx; y = yy; }
inline long GetX() const { return x; }
inline long GetY() const { return y; }
};
// Point
class WXDLLEXPORT wxRealPoint: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxRealPoint)
public:
double x;
double y;
inline wxRealPoint(void) { x = 0.0; y = 0.0; };
inline wxRealPoint(double the_x, double the_y) { x = the_x; y = the_y; };
inline void operator = (const wxRealPoint& pt) { x = pt.x; y = pt.y; }
};
class WXDLLEXPORT wxPoint: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxPoint)
public:
long x;
long y;
inline wxPoint(void) { x = 0; y = 0; };
wxPoint(long the_x, long the_y) { x = the_x; y = the_y; };
inline void operator = (const wxPoint& pt) { x = pt.x; y = pt.y; }
};
#if WXWIN_COMPATIBILITY
#define wxIntPoint wxPoint
#define wxRectangle wxRect
#endif
class WXDLLEXPORT wxRect : public wxObject {
DECLARE_DYNAMIC_CLASS(wxRect)
public:
wxRect(void) ;
wxRect(const long x, const long y, const long w, const long h);
wxRect(const wxPoint& topLeft, const wxPoint& bottomRight);
wxRect(const wxPoint& pos, const wxSize& size);
wxRect(const wxRect& rect);
inline long GetX(void) const { return x; }
inline void SetX(const long X) { x = X; }
inline long GetY(void) const { return y; }
inline void SetY(const long Y) { y = Y; }
inline long GetWidth() const { return width; }
inline void SetWidth(const long w) { width = w; }
inline long GetHeight() const { return height; }
inline void SetHeight(const long h) { height = h; }
inline wxPoint GetPosition(void) { return wxPoint(x, y); }
inline wxSize GetSize(void) { return wxSize(width, height); }
inline long GetLeft(void) const { return x; }
inline long GetTop(void) const { return y; }
inline long GetBottom(void) const { return y + height; }
inline long GetRight(void) const { return x + width; }
wxRect& operator = (const wxRect& rect);
bool operator == (const wxRect& rect);
bool operator != (const wxRect& rect);
public:
long x, y, width, height;
};
class WXDLLEXPORT wxBrush;
class WXDLLEXPORT wxPen;
class WXDLLEXPORT wxBitmap;
class WXDLLEXPORT wxIcon;
class WXDLLEXPORT wxCursor;
class WXDLLEXPORT wxFont;
class WXDLLEXPORT wxPalette;
class WXDLLEXPORT wxPalette;
/*
* Bitmap flags
*/
// Hint to indicate filetype
#define wxBITMAP_TYPE_BMP 1
#define wxBITMAP_TYPE_BMP_RESOURCE 2
#define wxBITMAP_TYPE_ICO 3
#define wxBITMAP_TYPE_ICO_RESOURCE 4
#define wxBITMAP_TYPE_CUR 5
#define wxBITMAP_TYPE_CUR_RESOURCE 6
#define wxBITMAP_TYPE_XBM 7
#define wxBITMAP_TYPE_XBM_DATA 8
#define wxBITMAP_TYPE_XPM 9
#define wxBITMAP_TYPE_XPM_DATA 10
#define wxBITMAP_TYPE_TIF 11
#define wxBITMAP_TYPE_TIF_RESOURCE 12
#define wxBITMAP_TYPE_GIF 13
#define wxBITMAP_TYPE_GIF_RESOURCE 14
#define wxBITMAP_TYPE_PNG 15
#define wxBITMAP_TYPE_PNG_RESOURCE 16
#define wxBITMAP_TYPE_ANY 50
#define wxBITMAP_TYPE_RESOURCE wxBITMAP_TYPE_BMP_RESOURCE
class WXDLLEXPORT wxBitmap;
class WXDLLEXPORT wxCursor;
class WXDLLEXPORT wxIcon;
// Management of pens, brushes and fonts
class WXDLLEXPORT wxPenList: public wxList
{
DECLARE_DYNAMIC_CLASS(wxPenList)
public:
inline wxPenList(void)
{ }
~wxPenList(void);
void AddPen(wxPen *pen);
void RemovePen(wxPen *pen);
wxPen *FindOrCreatePen(const wxColour& colour, const int width, const int style);
wxPen *FindOrCreatePen(const wxString& colour, const int width, const int style);
};
class WXDLLEXPORT wxBrushList: public wxList
{
DECLARE_DYNAMIC_CLASS(wxBrushList)
public:
inline wxBrushList(void)
{ }
~wxBrushList(void);
void AddBrush(wxBrush *brush);
void RemoveBrush(wxBrush *brush);
wxBrush *FindOrCreateBrush(const wxColour& colour, const int style);
wxBrush *FindOrCreateBrush(const wxString& colour, const int style);
};
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
class WXDLLEXPORT wxFontList: public wxList
{
DECLARE_DYNAMIC_CLASS(wxFontList)
public:
inline wxFontList(void)
{ }
~wxFontList(void);
void AddFont(wxFont *font);
void RemoveFont(wxFont *font);
wxFont *FindOrCreateFont(const int pointSize, const int family, const int style, const int weight,
const bool underline = FALSE, const wxString& face = wxEmptyString);
};
class WXDLLEXPORT wxColourDatabase: public wxList
{
DECLARE_CLASS(wxColourDatabase)
public:
wxColourDatabase(int type);
~wxColourDatabase(void) ;
// Not const because it may add a name to the database
wxColour *FindColour(const wxString& colour) ;
wxString FindName(const wxColour& colour) const;
void Initialize(void);
};
class WXDLLEXPORT wxBitmapList: public wxList
{
DECLARE_DYNAMIC_CLASS(wxBitmapList)
public:
wxBitmapList(void);
~wxBitmapList(void);
void AddBitmap(wxBitmap *bitmap);
void RemoveBitmap(wxBitmap *bitmap);
};
// Lists of GDI objects
WXDLLEXPORT_DATA(extern wxPenList*) wxThePenList;
WXDLLEXPORT_DATA(extern wxBrushList*) wxTheBrushList;
WXDLLEXPORT_DATA(extern wxFontList*) wxTheFontList;
WXDLLEXPORT_DATA(extern wxBitmapList*) wxTheBitmapList;
// Stock objects
WXDLLEXPORT_DATA(extern wxFont*) wxNORMAL_FONT;
WXDLLEXPORT_DATA(extern wxFont*) wxSMALL_FONT;
WXDLLEXPORT_DATA(extern wxFont*) wxITALIC_FONT;
WXDLLEXPORT_DATA(extern wxFont*) wxSWISS_FONT;
WXDLLEXPORT_DATA(extern wxPen*) wxRED_PEN;
WXDLLEXPORT_DATA(extern wxPen*) wxCYAN_PEN;
WXDLLEXPORT_DATA(extern wxPen*) wxGREEN_PEN;
WXDLLEXPORT_DATA(extern wxPen*) wxBLACK_PEN;
WXDLLEXPORT_DATA(extern wxPen*) wxWHITE_PEN;
WXDLLEXPORT_DATA(extern wxPen*) wxTRANSPARENT_PEN;
WXDLLEXPORT_DATA(extern wxPen*) wxBLACK_DASHED_PEN;
WXDLLEXPORT_DATA(extern wxPen*) wxGREY_PEN;
WXDLLEXPORT_DATA(extern wxPen*) wxMEDIUM_GREY_PEN;
WXDLLEXPORT_DATA(extern wxPen*) wxLIGHT_GREY_PEN;
WXDLLEXPORT_DATA(extern wxBrush*) wxBLUE_BRUSH;
WXDLLEXPORT_DATA(extern wxBrush*) wxGREEN_BRUSH;
WXDLLEXPORT_DATA(extern wxBrush*) wxWHITE_BRUSH;
WXDLLEXPORT_DATA(extern wxBrush*) wxBLACK_BRUSH;
WXDLLEXPORT_DATA(extern wxBrush*) wxGREY_BRUSH;
WXDLLEXPORT_DATA(extern wxBrush*) wxMEDIUM_GREY_BRUSH;
WXDLLEXPORT_DATA(extern wxBrush*) wxLIGHT_GREY_BRUSH;
WXDLLEXPORT_DATA(extern wxBrush*) wxTRANSPARENT_BRUSH;
WXDLLEXPORT_DATA(extern wxBrush*) wxCYAN_BRUSH;
WXDLLEXPORT_DATA(extern wxBrush*) wxRED_BRUSH;
WXDLLEXPORT_DATA(extern wxColour*) wxBLACK;
WXDLLEXPORT_DATA(extern wxColour*) wxWHITE;
WXDLLEXPORT_DATA(extern wxColour*) wxRED;
WXDLLEXPORT_DATA(extern wxColour*) wxBLUE;
WXDLLEXPORT_DATA(extern wxColour*) wxGREEN;
WXDLLEXPORT_DATA(extern wxColour*) wxCYAN;
WXDLLEXPORT_DATA(extern wxColour*) wxLIGHT_GREY;
// 'Null' objects
WXDLLEXPORT_DATA(extern wxBitmap) wxNullBitmap;
WXDLLEXPORT_DATA(extern wxIcon) wxNullIcon;
WXDLLEXPORT_DATA(extern wxCursor) wxNullCursor;
WXDLLEXPORT_DATA(extern wxPen) wxNullPen;
WXDLLEXPORT_DATA(extern wxBrush) wxNullBrush;
WXDLLEXPORT_DATA(extern wxPalette) wxNullPalette;
WXDLLEXPORT_DATA(extern wxFont) wxNullFont;
WXDLLEXPORT_DATA(extern wxColour) wxNullColour;
// Stock cursors types
WXDLLEXPORT_DATA(extern wxCursor*) wxSTANDARD_CURSOR;
WXDLLEXPORT_DATA(extern wxCursor*) wxHOURGLASS_CURSOR;
WXDLLEXPORT_DATA(extern wxCursor*) wxCROSS_CURSOR;
WXDLLEXPORT_DATA(extern wxColourDatabase*) wxTheColourDatabase;
extern void WXDLLEXPORT wxInitializeStockObjects(void);
extern void WXDLLEXPORT wxDeleteStockObjects(void);
extern bool WXDLLEXPORT wxColourDisplay(void);
// Returns depth of screen
extern int WXDLLEXPORT wxDisplayDepth(void);
extern void WXDLLEXPORT wxDisplaySize(int *width, int *height);
extern void WXDLLEXPORT wxSetCursor(const wxCursor& cursor);
// Useful macro for create icons portably
#ifdef __WINDOWS__
# define wxICON(X) wxIcon(X##_icon);
#elif defined(__X__)
# define wxICON(X) wxIcon(X##_bits, X##_width, X##_height);
#else
# define wxICON wxIcon
#endif
/*
Example:
#define wxbuild_icon "wxbuild"
wxIcon *icon = new wxICON(wxbuild);
*/
#endif
// __GDICMNH__

13
include/wx/gdiobj.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __GDIOBJH_BASE__
#define __GDIOBJH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/gdiobj.h"
#elif defined(__MOTIF__)
#include "wx/xt/gdiobj.h"
#elif defined(__GTK__)
#include "wx/gtk/gdiobj.h"
#endif
#endif
// __GDIOBJH_BASE__

View File

@ -0,0 +1,100 @@
/////////////////////////////////////////////////////////////////////////////
// Name: choicdgg.h
// Purpose: Generic choice dialogs
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __CHOICEDLGH_G__
#define __CHOICEDLGH_G__
#ifdef __GNUG__
#pragma interface "choicdgg.h"
#endif
#include "wx/setup.h"
#include "wx/dialog.h"
#define wxCHOICE_HEIGHT 150
#define wxCHOICE_WIDTH 200
#define wxID_LISTBOX 3000
class WXDLLEXPORT wxSingleChoiceDialog: public wxDialog
{
DECLARE_DYNAMIC_CLASS(wxSingleChoiceDialog)
public:
wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption,
const int n, const wxString *choices, char **clientData = NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption,
const wxStringList& choices, char **clientData = NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
bool Create(wxWindow *parent, const wxString& message, const wxString& caption,
const int n, const wxString *choices, char **clientData = NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
bool Create(wxWindow *parent, const wxString& message, const wxString& caption,
const wxStringList& choices, char **clientData = NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
inline int GetSelection(void) const { return m_selection; }
inline wxString GetStringSelection(void) const { return m_stringSelection; }
inline char *GetSelectionClientData(void) const { return m_clientData; }
void OnOK(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
protected:
long m_dialogStyle;
int m_selection;
wxString m_stringSelection;
char* m_clientData;
};
wxString WXDLLEXPORT wxGetSingleChoice(const wxString& message, const wxString& caption,
const int n, const wxString *choices, wxWindow *parent = NULL,
const int x = -1, const int y = -1, const bool centre = TRUE,
const int width = wxCHOICE_WIDTH, const int height = wxCHOICE_HEIGHT);
wxString WXDLLEXPORT wxGetSingleChoice(const wxString& message, const wxString& caption,
const int n, char *choices[], wxWindow *parent = NULL,
const int x = -1, const int y = -1, const bool centre = TRUE,
const int width = wxCHOICE_WIDTH, const int height = wxCHOICE_HEIGHT);
// Same as above but gets position in list of strings, instead of string,
// or -1 if no selection
int WXDLLEXPORT wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
const int n, const wxString *choices, wxWindow *parent = NULL,
const int x = -1, const int y = -1, const bool centre = TRUE,
const int width = wxCHOICE_WIDTH, const int height = wxCHOICE_HEIGHT);
int WXDLLEXPORT wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
const int n, char *choices[], wxWindow *parent = NULL,
const int x = -1, const int y = -1, const bool centre = TRUE,
const int width = wxCHOICE_WIDTH, const int height = wxCHOICE_HEIGHT);
// Return client data instead
char* WXDLLEXPORT wxGetSingleChoiceData(const wxString& message, const wxString& caption,
const int n, const wxString *choices, char **client_data,
wxWindow *parent = NULL, const int x = -1, const int y = -1,
const bool centre = TRUE,
const int width = wxCHOICE_WIDTH, const int height = wxCHOICE_HEIGHT);
char* WXDLLEXPORT wxGetSingleChoiceData(const wxString& message, const wxString& caption,
const int n, char *choices[], char **client_data,
wxWindow *parent = NULL, const int x = -1, const int y = -1,
const bool centre = TRUE,
const int width = wxCHOICE_WIDTH, const int height = wxCHOICE_HEIGHT);
/*
int WXDLLEXPORT wxGetMultipleChoice(const wxString& message, const wxString& caption,
const int n, const wxString *choices,
const int nsel, int * selection,
wxWindow *parent = NULL, const int x = -1 , const int y = -1, const bool centre = TRUE,
const int width = wxCHOICE_WIDTH, const int height = wxCHOICE_HEIGHT);
*/
#endif

View File

@ -0,0 +1,121 @@
/////////////////////////////////////////////////////////////////////////////
// Name: colrdlgg.h
// Purpose: wxGenericColourDialog
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __COLORDLGH_G__
#define __COLORDLGH_G__
#ifdef __GNUG__
#pragma interface "colrdlgg.h"
#endif
#include "wx/setup.h"
#include "wx/gdicmn.h"
#include "wx/dialog.h"
#include "wx/cmndata.h"
#define wxID_ADD_CUSTOM 3000
#define wxID_RED_SLIDER 3001
#define wxID_GREEN_SLIDER 3002
#define wxID_BLUE_SLIDER 3003
class WXDLLEXPORT wxSlider;
class WXDLLEXPORT wxGenericColourDialog: public wxDialog
{
DECLARE_DYNAMIC_CLASS(wxGenericColourDialog)
protected:
wxColourData colourData;
wxWindow *dialogParent;
// Area reserved for grids of colours
wxRectangle standardColoursRect;
wxRectangle customColoursRect;
wxRectangle singleCustomColourRect;
// Size of each colour rectangle
wxIntPoint smallRectangleSize;
// For single customizable colour
wxIntPoint customRectangleSize;
// Grid spacing (between rectangles)
int gridSpacing;
// Section spacing (between left and right halves of dialog box)
int sectionSpacing;
// 48 'standard' colours
wxColour standardColours[48];
// 16 'custom' colours
wxColour customColours[16];
// One single custom colour (use sliders)
wxColour singleCustomColour;
// Which colour is selected? An index into one of the two areas.
int colourSelection;
int whichKind; // 1 for standard colours, 2 for custom colours,
wxSlider *redSlider;
wxSlider *greenSlider;
wxSlider *blueSlider;
int buttonY;
int okButtonX;
int customButtonX;
// static bool colourDialogCancelled;
public:
wxGenericColourDialog(void);
wxGenericColourDialog(wxWindow *parent, wxColourData *data = NULL);
~wxGenericColourDialog(void);
bool Create(wxWindow *parent, wxColourData *data = NULL);
int ShowModal(void);
wxColourData GetColourData(void) { return colourData; }
// Internal functions
void OnMouseEvent(wxMouseEvent& event);
void OnPaint(wxPaintEvent& event);
bool OnClose(void);
virtual void CalculateMeasurements(void);
virtual void CreateWidgets(void);
virtual void InitializeColours(void);
virtual void PaintBasicColours(wxDC& dc);
virtual void PaintCustomColours(wxDC& dc);
virtual void PaintCustomColour(wxDC& dc);
virtual void PaintHighlight(wxDC& dc, bool draw);
virtual void OnBasicColourClick(int which);
virtual void OnCustomColourClick(int which);
/*
virtual void OnOk(void);
virtual void OnCancel(void);
virtual void OnAddCustom(void);
*/
void OnAddCustom(wxCommandEvent& event);
void OnRedSlider(wxCommandEvent& event);
void OnGreenSlider(wxCommandEvent& event);
void OnBlueSlider(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
};
typedef wxGenericColourDialog wxColourDialog;
#endif

View File

@ -0,0 +1,94 @@
/////////////////////////////////////////////////////////////////////////////
// Name: fontdlgg.h
// Purpose: wxGenericFontDialog
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __FONTDLGH_G__
#define __FONTDLGH_G__
#ifdef __GNUG__
#pragma interface "fontdlgg.h"
#endif
#include "wx/setup.h"
#include "wx/gdicmn.h"
#include "wx/font.h"
#include "wx/dialog.h"
#include "wx/cmndata.h"
/*
* FONT DIALOG
*/
class WXDLLEXPORT wxChoice;
class WXDLLEXPORT wxText;
class WXDLLEXPORT wxCheckBox;
#define wxID_FONT_UNDERLINE 3000
#define wxID_FONT_STYLE 3001
#define wxID_FONT_WEIGHT 3002
#define wxID_FONT_FAMILY 3003
#define wxID_FONT_COLOUR 3004
#define wxID_FONT_SIZE 3005
class WXDLLEXPORT wxGenericFontDialog: public wxDialog
{
DECLARE_DYNAMIC_CLASS(wxGenericFontDialog)
protected:
wxFontData fontData;
wxFont dialogFont;
wxWindow *dialogParent;
// Area reserved for font display
wxRectangle fontRect;
wxChoice *familyChoice;
wxChoice *styleChoice;
wxChoice *weightChoice;
wxChoice *colourChoice;
wxCheckBox *underLineCheckBox;
wxChoice *pointSizeChoice;
// static bool fontDialogCancelled;
public:
wxGenericFontDialog(void);
wxGenericFontDialog(wxWindow *parent, wxFontData *data = NULL);
~wxGenericFontDialog(void);
bool Create(wxWindow *parent, wxFontData *data = NULL);
int ShowModal(void);
inline wxFontData& GetFontData(void) { return fontData; }
// Internal functions
void OnPaint(wxPaintEvent& event);
bool OnClose(void);
virtual void CreateWidgets(void);
virtual void InitializeFont(void);
virtual void PaintFontBackground(wxDC& dc);
virtual void PaintFont(wxDC& dc);
void OnChangeFont(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
};
char* WXDLLEXPORT wxFontFamilyIntToString(int family);
char* WXDLLEXPORT wxFontWeightIntToString(int weight);
char* WXDLLEXPORT wxFontStyleIntToString(int style);
int WXDLLEXPORT wxFontFamilyStringToInt(char *family);
int WXDLLEXPORT wxFontWeightStringToInt(char *weight);
int WXDLLEXPORT wxFontStyleStringToInt(char *style);
#endif

319
include/wx/generic/gridg.h Normal file
View File

@ -0,0 +1,319 @@
/////////////////////////////////////////////////////////////////////////////
// Name: gridg.h
// Purpose: wxGenericGrid
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GRIDH_G__
#define __GRIDH_G__
#ifdef __GNUG__
#pragma interface "gridg.h"
#endif
#include "wx/defs.h"
#include "wx/panel.h"
#include "wx/string.h"
#include "wx/scrolbar.h"
#define wxGRID_DEFAULT_EDIT_WIDTH 300
#define wxGRID_DEFAULT_EDIT_HEIGHT 27
#define wxGRID_DEFAULT_EDIT_X 5
#define wxGRID_DEFAULT_EDIT_Y 1
#define wxGRID_DEFAULT_SHEET_TOP 31
#define wxGRID_DEFAULT_SHEET_LEFT 0
#define wxGRID_DEFAULT_CELL_HEIGHT 20
#define wxGRID_DEFAULT_CELL_WIDTH 80
#define wxGRID_DEFAULT_VERTICAL_LABEL_WIDTH 40
#define wxGRID_DEFAULT_HORIZONAL_LABEL_HEIGHT 20
#ifndef wxLEFT
#define wxLEFT 0x0400
#endif
#ifndef wxRIGHT
#define wxRIGHT 0x0800
#endif
#define WXGENERIC_GRID_VERSION 0.4
class WXDLLEXPORT wxGridCell;
class WXDLLEXPORT wxGenericGrid: public wxPanel
{
DECLARE_DYNAMIC_CLASS(wxGenericGrid)
protected:
wxTextCtrl *textItem;
wxScrollBar *hScrollBar;
wxScrollBar *vScrollBar;
int wCursorRow;
int wCursorColumn;
wxRectangle CurrentRect;
bool currentRectVisible;
wxGridCell ***gridCells;
wxGridCell **rowLabelCells;
wxGridCell **colLabelCells;
bool bEditCreated;
bool editable;
int totalRows;
int totalCols;
// Row and column we're currently looking at
int scrollPosX;
int scrollPosY;
// Dimensions
int leftOfSheet;
int topOfSheet;
int rightOfSheet; // Calculated from colWidths
int bottomOfSheet; // Calculated from rowHeights
int totalGridWidth; // Total 'virtual' size
int totalGridHeight;
int cellHeight; // For now, a default
int verticalLabelWidth;
int horizontalLabelHeight;
int verticalLabelAlignment;
int horizontalLabelAlignment;
int cellAlignment;
short *colWidths; // Dynamically allocated
short *rowHeights; // Dynamically allocated
int scrollWidth; // Vert. scroll width, horiz. scroll height
// Colours
wxColour cellTextColour;
wxColour cellBackgroundColour;
wxFont *cellTextFont;
wxColour labelTextColour;
wxColour labelBackgroundColour;
wxBrush *labelBackgroundBrush;
wxFont *labelTextFont;
wxPen *divisionPen;
// Position of Edit control
wxRectangle editControlPosition;
// Drag status
int dragStatus;
int dragRowOrCol;
int dragStartPosition;
int dragLastPosition;
static wxCursor *horizontalSashCursor;
static wxCursor *verticalSashCursor;
// Don't refresh whilst this is > 0
int batchCount;
public:
wxGenericGrid(void);
inline wxGenericGrid(wxWindow *parent, int x, int y, int width, int height, const long style = 0, char *name = "grid")
{
Create(parent, -1, wxPoint(x, y), wxSize(width, height), style, name);
}
inline wxGenericGrid(wxWindow *parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, const long style = 0, const wxString& name = "grid")
{
Create(parent, id, pos, size, style, name);
}
~wxGenericGrid(void);
void OnPaint(wxPaintEvent& event);
void OnMouseEvent(wxMouseEvent& event);
void OnSize(wxSizeEvent& event);
bool Create(wxWindow *parent, const wxWindowID, const wxPoint& pos, const wxSize& size, const long style = 0, const wxString& name = "grid");
bool CreateGrid(int nRows, int nCols, wxString **cellValues = NULL, short *widths = NULL,
short defaultWidth = wxGRID_DEFAULT_CELL_WIDTH, short defaultHeight = wxGRID_DEFAULT_CELL_HEIGHT);
void ClearGrid(void);
virtual wxGridCell *GetCell(int row, int col);
inline wxGridCell ***GetCells(void) { return gridCells; }
bool InsertCols(int pos = 0, int n = 1, bool updateLabels = TRUE);
bool InsertRows(int pos = 0, int n = 1, bool updateLabels = TRUE);
bool AppendCols(int n = 1, bool updateLabels = TRUE);
bool AppendRows(int n = 1, bool updateLabels = TRUE);
bool DeleteCols(int pos = 0, int n = 1, bool updateLabels = TRUE);
bool DeleteRows(int pos = 0, int n = 1, bool updateLabels = TRUE);
// Cell accessors
void SetCellValue(const wxString& val, int row, int col);
wxString& GetCellValue(int row, int col);
void SetCellAlignment(int flag, int row, int col);
void SetCellAlignment(int flag);
int GetCellAlignment(int row, int col);
int GetCellAlignment(void);
void SetCellTextColour(const wxColour& val, int row, int col);
void SetCellTextColour(const wxColour& col);
wxColour& GetCellTextColour(int row, int col);
inline wxColour& GetCellTextColour(void) { return cellTextColour; }
void SetCellBackgroundColour(const wxColour& col);
void SetCellBackgroundColour(const wxColour& colour, int row, int col);
inline wxColour& GetCellBackgroundColour(void) { return cellBackgroundColour; }
wxColour& GetCellBackgroundColour(int row, int col);
inline wxFont *GetCellTextFont(void) { return cellTextFont; }
wxFont *GetCellTextFont(int row, int col);
void SetCellTextFont(wxFont *fnt);
void SetCellTextFont(wxFont *fnt, int row, int col);
wxBitmap *GetCellBitmap(int row, int col);
void SetCellBitmap(wxBitmap *bitmap, int row, int col);
// Size accessors
void SetColumnWidth(int col, int width);
int GetColumnWidth(int col);
void SetRowHeight(int row, int height);
int GetRowHeight(int row);
// Label accessors
void SetLabelSize(int orientation, int sz);
int GetLabelSize(int orientation);
void SetLabelAlignment(int orientation, int alignment);
int GetLabelAlignment(int orientation);
wxGridCell *GetLabelCell(int orientation, int pos);
void SetLabelValue(int orientation, const wxString& val, int pos);
wxString& GetLabelValue(int orientation, int pos);
void SetLabelTextColour(const wxColour& colour);
void SetLabelBackgroundColour(const wxColour& colour);
inline wxColour& GetLabelTextColour(void) { return labelTextColour; }
inline wxColour& GetLabelBackgroundColour(void) { return labelBackgroundColour; }
inline wxFont *GetLabelTextFont(void) { return labelTextFont; }
inline void SetLabelTextFont(wxFont *fnt) { labelTextFont = fnt; }
// Miscellaneous accessors
inline int GetCursorRow(void) { return wCursorRow; }
inline int GetCursorColumn(void) { return wCursorColumn; }
void SetGridCursor(int row, int col);
inline int GetRows(void) { return totalRows; }
inline int GetCols(void) { return totalCols; }
inline int GetScrollPosX(void) { return scrollPosX; }
inline int GetScrollPosY(void) { return scrollPosY; }
inline void SetScrollPosX(int pos) { scrollPosX = pos; }
inline void SetScrollPosY(int pos) { scrollPosY = pos; }
inline wxTextCtrl *GetTextItem(void) { return textItem; }
inline wxScrollBar *GetHorizScrollBar(void) { return hScrollBar; }
inline wxScrollBar *GetVertScrollBar(void) { return vScrollBar; }
inline bool GetEditable(void) { return editable; }
void SetEditable(bool edit);
inline wxRectangle& GetCurrentRect(void) { return CurrentRect; }
inline bool CurrentCellVisible(void) { return currentRectVisible; }
inline void SetDividerPen(wxPen *pen) { divisionPen = pen; }
inline wxPen *GetDividerPen(void) { return divisionPen; }
// High-level event handling
// Override e.g. to check value of current cell; but call
// base member for default processing.
virtual void OnSelectCellImplementation(wxDC *dc, int row, int col);
virtual void OnSelectCell(int WXUNUSED(row), int WXUNUSED(col)) {};
// Override to create your own class of grid cell
virtual wxGridCell *OnCreateCell(void);
// Override to change labels e.g. creation of grid, inserting/deleting a row/col.
// By default, auto-labels the grid.
virtual void OnChangeLabels(void);
// Override to change the label of the edit field when selecting a cell
// By default, sets it to e.g. A12
virtual void OnChangeSelectionLabel(void);
// Override for event processing
virtual void OnCellChange(int WXUNUSED(row), int WXUNUSED(col)) {};
virtual void OnCellLeftClick(int WXUNUSED(row), int WXUNUSED(col), int WXUNUSED(x), int WXUNUSED(y), bool WXUNUSED(control), bool WXUNUSED(shift)) {};
virtual void OnCellRightClick(int WXUNUSED(row), int WXUNUSED(col), int WXUNUSED(x), int WXUNUSED(y), bool WXUNUSED(control), bool WXUNUSED(shift)) {};
virtual void OnLabelLeftClick(int WXUNUSED(row), int WXUNUSED(col), int WXUNUSED(x), int WXUNUSED(y), bool WXUNUSED(control), bool WXUNUSED(shift)) {};
virtual void OnLabelRightClick(int WXUNUSED(row), int WXUNUSED(col), int WXUNUSED(x), int WXUNUSED(y), bool WXUNUSED(control), bool WXUNUSED(shift)) {};
// Activation: call from wxFrame::OnActivate
void OnActivate(bool active);
// Miscellaneous
void AdjustScrollbars(void);
void UpdateDimensions(void);
/* INTERNAL
*/
void SetCurrentRect (int Row, int Column, int canvasW = -1, int canvasH = -1);
void HighlightCell (wxDC *dc);
void DrawCellText(void);
void SetGridClippingRegion(wxDC *dc);
virtual bool CellHitTest(int x, int y, int *row, int *col);
virtual bool LabelSashHitTest(int x, int y, int *orientation, int *rowOrCol, int *startPos);
virtual bool LabelHitTest(int x, int y, int *row, int *col);
// Painting
virtual void DrawLabelAreas(wxDC *dc);
virtual void DrawEditableArea(wxDC *dc);
virtual void DrawGridLines(wxDC *dc);
virtual void DrawColumnLabels(wxDC *dc);
virtual void DrawColumnLabel(wxDC *dc, wxRectangle *rect, int col);
virtual void DrawRowLabels(wxDC *dc);
virtual void DrawRowLabel(wxDC *dc, wxRectangle *rect, int row);
virtual void DrawCells(wxDC *dc);
virtual void DrawCellValue(wxDC *dc, wxRectangle *rect, int row, int col);
virtual void DrawCellBackground(wxDC *dc, wxRectangle *rect, int row, int col);
virtual void DrawTextRect(wxDC *dc, const wxString& text, wxRectangle *rect, int flag);
virtual void DrawBitmapRect(wxDC *dc, wxBitmap *bitmap, wxRectangle *rect, int flag);
// Refresh cell and optionally set the text field
void RefreshCell(int row, int col, bool setText = FALSE);
// Don't refresh within the outer pair of these.
inline void BeginBatch(void) { batchCount ++; }
inline void EndBatch(void) { batchCount --; }
inline int GetBatchCount(void) { return batchCount; }
void OnText(wxCommandEvent& ev);
void OnGridScroll(wxScrollEvent& ev);
DECLARE_EVENT_TABLE()
};
#define wxGRID_TEXT_CTRL 2000
#define wxGRID_HSCROLL 2001
#define wxGRID_VSCROLL 2002
class WXDLLEXPORT wxGridCell: public wxObject
{
public:
wxString textValue;
wxFont *font;
wxColour textColour;
wxColour backgroundColour;
wxBrush *backgroundBrush;
wxBitmap *cellBitmap;
int alignment;
wxGridCell(wxGenericGrid *window = NULL);
~wxGridCell(void);
virtual wxString& GetTextValue(void) { return textValue; }
virtual void SetTextValue(const wxString& str) { textValue = str; }
inline wxFont *GetFont(void) { return font; }
inline void SetFont(wxFont *f) { font = f; }
inline wxColour& GetTextColour(void) { return textColour; }
inline void SetTextColour(const wxColour& colour) { textColour = colour; }
inline wxColour& GetBackgroundColour(void) { return backgroundColour; }
void SetBackgroundColour(const wxColour& colour);
inline wxBrush *GetBackgroundBrush(void) { return backgroundBrush; }
inline int GetAlignment(void) { return alignment; }
inline void SetAlignment(int align) { alignment = align; }
inline wxBitmap *GetCellBitmap(void) { return cellBitmap; }
inline void SetCellBitmap(wxBitmap *bitmap) { cellBitmap = bitmap; }
};
class WXDLLEXPORT wxGrid: public wxGenericGrid
{
public:
wxGrid(void):wxGenericGrid() {}
wxGrid(wxWindow *parent, int x=-1, int y=-1, int width=-1, int height=-1,
long style=0, char *name = "gridWindow"):
wxGenericGrid(parent, x, y, width, height, style, name)
{
}
};
#endif

View File

@ -0,0 +1,127 @@
/////////////////////////////////////////////////////////////////////////////
// Name: helpxlp.h
// Purpose: Help system: wxHelp implementation
// Author: Julian Smart
// Modified by:
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
/* sccsid[] = "@(#)wx_help.h 1.2 5/9/94" */
#ifndef __HELPXLPH__
#define __HELPXLPH__
#ifdef __GNUG__
#pragma interface "helpxlp.h"
#endif
#include <stdio.h>
#include "wx/wx.h"
#if USE_HELP
#include "wx/helpbase.h"
#ifdef __WINDOWS__
#include "wx/dde.h"
#else
// Or whatever it'll be called
#include "wx/ipctcp.h"
#endif
class WXDLLEXPORT wxXLPHelpController;
// Connection class for implementing the connection between the
// wxHelp process and the application
class WXDLLEXPORT wxXLPHelpConnection: public
#ifdef __WINDOWS__
wxDDEConnection
#else
wxTCPConnection
#endif
{
friend class wxXLPHelpController;
DECLARE_DYNAMIC_CLASS(wxXLPHelpConnection)
public:
wxXLPHelpConnection(wxXLPHelpController *instance);
bool OnDisconnect(void);
private:
wxXLPHelpController *helpInstance;
};
// Connection class for implementing the client process
// controlling the wxHelp process
class WXDLLEXPORT wxXLPHelpClient: public
#ifdef __WINDOWS__
wxDDEClient
#else
wxTCPClient
#endif
{
DECLARE_CLASS(wxXLPHelpClient)
friend class WXDLLEXPORT wxXLPHelpController;
public:
wxXLPHelpClient(wxXLPHelpController* c) { m_controller = c; }
wxConnectionBase *OnMakeConnection(void)
{ return new wxXLPHelpConnection(m_controller);
}
protected:
wxXLPHelpController* m_controller;
};
// An application can have one or more instances of wxHelp,
// represented by an object of this class.
// Nothing happens on initial creation; the application
// must call a member function to display help.
// If the instance of wxHelp is already active, that instance
// will be used for subsequent help.
class WXDLLEXPORT wxXLPHelpController: public wxHelpControllerBase
{
friend class WXDLLEXPORT wxXLPHelpConnection;
DECLARE_CLASS(wxXLPHelpController)
public:
wxXLPHelpController(void);
~wxXLPHelpController(void);
// Must call this to set the filename and server name
virtual bool Initialize(const wxString& file, int server = -1);
// If file is "", reloads file given in Initialize
virtual bool LoadFile(const wxString& file = "");
virtual bool DisplayContents(void);
virtual bool DisplaySection(int sectionNo);
virtual bool DisplayBlock(long blockNo);
virtual bool KeywordSearch(const wxString& k);
virtual bool Quit(void);
virtual void OnQuit(void);
// Private
bool Run(void);
protected:
wxString helpFile;
wxString helpHost;
int helpServer;
bool helpRunning;
wxXLPHelpConnection* helpConnection;
wxXLPHelpClient helpClient;
};
#endif // USE_HELP
#endif
// __HELPXLPH__

View File

@ -0,0 +1,67 @@
/////////////////////////////////////////////////////////////////////////////
// Name: imaglist.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __IMAGELISTH_G__
#define __IMAGELISTH_G__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/gdicmn.h"
#include "wx/bitmap.h"
#include "wx/dc.h"
/*
* wxImageList is used for wxListCtrl, wxTreeCtrl. These controls refer to
* images for their items by an index into an image list.
* A wxImageList is capable of creating images with optional masks from
* a variety of sources - a single bitmap plus a colour to indicate the mask,
* two bitmaps, or an icon.
*
* Image lists can also create and draw images used for drag and drop functionality.
* This is not yet implemented in wxImageList. We need to discuss a generic API
* for doing drag and drop and see whether it ties in with the Win95 view of it.
* See below for candidate functions and an explanation of how they might be
* used.
*/
// Flags for Draw
#define wxIMAGELIST_DRAW_NORMAL 0x0001
#define wxIMAGELIST_DRAW_TRANSPARENT 0x0002
#define wxIMAGELIST_DRAW_SELECTED 0x0004
#define wxIMAGELIST_DRAW_FOCUSED 0x0008
class wxImageList: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxImageList)
public:
wxImageList(void);
~wxImageList(void);
bool Create(void);
int GetImageCount(void) const;
int Add( const wxBitmap &bitmap );
bool Replace( const int index, const wxBitmap &bitmap );
bool Remove( const int index );
bool RemoveAll(void);
bool GetSize( const int index, int &width, int &height ) const;
bool Draw(const int index, wxDC& dc, const int x, const int y,
const int flags = wxIMAGELIST_DRAW_NORMAL, const bool solidBackground = FALSE );
private:
wxList m_images;
};
#endif // __IMAGELISTH_G__

View File

@ -0,0 +1,649 @@
/////////////////////////////////////////////////////////////////////////////
// Name: listctrl.h
// Purpose: Generic list control
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __LISTCTRLH_G__
#define __LISTCTRLH_G__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/imaglist.h"
#include "wx/control.h"
#include "wx/timer.h"
#include "wx/dcclient.h"
#include "wx/scrolwin.h"
#include "wx/settings.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxListItem;
class wxListEvent;
class wxListCtrl;
//-----------------------------------------------------------------------------
// internal classes
//-----------------------------------------------------------------------------
class wxListHeaderData;
class wxListItemData;
class wxListLineData;
class wxListHeaderWindow;
class wxListMainWindow;
class wxListRenameTimer;
//class wxListTextCtrl;
//-----------------------------------------------------------------------------
// types
//-----------------------------------------------------------------------------
// type of compare function for wxListCtrl sort operation
typedef int (*wxListCtrlCompare)(const long item1, const long item2, long sortData);
//-----------------------------------------------------------------------------
// wxListCtrl flags
//-----------------------------------------------------------------------------
#define wxLC_ICON 0x0004
#define wxLC_SMALL_ICON 0x0008
#define wxLC_LIST 0x0010
#define wxLC_REPORT 0x0020
#define wxLC_ALIGN_TOP 0x0040
#define wxLC_ALIGN_LEFT 0x0080
#define wxLC_AUTOARRANGE 0x0100 // not supported in wxGLC
#define wxLC_USER_TEXT 0x0200 // not supported in wxGLC (how does it work?)
#define wxLC_EDIT_LABELS 0x0400
#define wxLC_NO_HEADER 0x0800 // not supported in wxGLC
#define wxLC_NO_SORT_HEADER 0x1000 // not supported in wxGLC
#define wxLC_SINGLE_SEL 0x2000
#define wxLC_SORT_ASCENDING 0x4000
#define wxLC_SORT_DESCENDING 0x8000 // not supported in wxGLC
#define wxLC_MASK_TYPE (wxLC_ICON | wxLC_SMALL_ICON | wxLC_LIST | wxLC_REPORT)
#define wxLC_MASK_ALIGN (wxLC_ALIGN_TOP | wxLC_ALIGN_LEFT)
#define wxLC_MASK_SORT (wxLC_SORT_ASCENDING | wxLC_SORT_DESCENDING)
// Omitted because (a) too much detail (b) not enough style flags
// #define wxLC_NO_SCROLL
// #define wxLC_NO_LABEL_WRAP
// #define wxLC_OWNERDRAW_FIXED
// #define wxLC_SHOW_SEL_ALWAYS
// Mask flags to tell app/GUI what fields of wxListItem are valid
#define wxLIST_MASK_STATE 0x0001
#define wxLIST_MASK_TEXT 0x0002
#define wxLIST_MASK_IMAGE 0x0004
#define wxLIST_MASK_DATA 0x0008
#define wxLIST_SET_ITEM 0x0010
#define wxLIST_MASK_WIDTH 0x0020
#define wxLIST_MASK_FORMAT 0x0040
// State flags for indicating the state of an item
#define wxLIST_STATE_DONTCARE 0x0000
#define wxLIST_STATE_DROPHILITED 0x0001 // not supported in wxGLC
#define wxLIST_STATE_FOCUSED 0x0002
#define wxLIST_STATE_SELECTED 0x0004
#define wxLIST_STATE_CUT 0x0008 // not supported in wxGLC
// Hit test flags, used in HitTest // wxGLC suppots 20 and 80
#define wxLIST_HITTEST_ABOVE 0x0001 // Above the client area.
#define wxLIST_HITTEST_BELOW 0x0002 // Below the client area.
#define wxLIST_HITTEST_NOWHERE 0x0004 // In the client area but below the last item.
#define wxLIST_HITTEST_ONITEMICON 0x0020 // On the bitmap associated with an item.
#define wxLIST_HITTEST_ONITEMLABEL 0x0080 // On the label (string) associated with an item.
#define wxLIST_HITTEST_ONITEMRIGHT 0x0100 // In the area to the right of an item.
#define wxLIST_HITTEST_ONITEMSTATEICON 0x0200 // On the state icon for a tree view item that is in a user-defined state.
#define wxLIST_HITTEST_TOLEFT 0x0400 // To the right of the client area.
#define wxLIST_HITTEST_TORIGHT 0x0800 // To the left of the client area.
#define wxLIST_HITTEST_ONITEM (wxLIST_HITTEST_ONITEMICON | wxLIST_HITTEST_ONITEMLABEL | wxLIST_HITTEST_ONITEMSTATEICON)
// Flags for GetNextItem // always wxLIST_NEXT_ALL in wxGLC
enum {
wxLIST_NEXT_ABOVE, // Searches for an item above the specified item
wxLIST_NEXT_ALL, // Searches for subsequent item by index
wxLIST_NEXT_BELOW, // Searches for an item below the specified item
wxLIST_NEXT_LEFT, // Searches for an item to the left of the specified item
wxLIST_NEXT_RIGHT, // Searches for an item to the right of the specified item
};
// Alignment flags for Arrange // always wxLIST_ALIGN_LEFT in wxGLC
enum {
wxLIST_ALIGN_DEFAULT,
wxLIST_ALIGN_LEFT,
wxLIST_ALIGN_TOP,
wxLIST_ALIGN_SNAP_TO_GRID
};
// Column format // always wxLIST_FORMAT_LEFT in wxGLC
enum {
wxLIST_FORMAT_LEFT,
wxLIST_FORMAT_RIGHT,
wxLIST_FORMAT_CENTRE,
wxLIST_FORMAT_CENTER = wxLIST_FORMAT_CENTRE
};
// Autosize values for SetColumnWidth
enum {
wxLIST_AUTOSIZE = -1, // always 80 in wxGLC (what else?)
wxLIST_AUTOSIZE_USEHEADER = -2
};
// Flag values for GetItemRect
enum {
wxLIST_RECT_BOUNDS,
wxLIST_RECT_ICON,
wxLIST_RECT_LABEL
};
// Flag values for FindItem // not supported by wxGLC
enum {
wxLIST_FIND_UP,
wxLIST_FIND_DOWN,
wxLIST_FIND_LEFT,
wxLIST_FIND_RIGHT
};
// Flag values for Set/GetImageList
enum {
wxIMAGE_LIST_NORMAL, // Normal icons
wxIMAGE_LIST_SMALL, // Small icons
wxIMAGE_LIST_STATE // State icons: unimplemented (see WIN32 documentation)
// not implemented in wxGLC (see non-existing documentation..)
};
//-----------------------------------------------------------------------------
// wxListItem
//-----------------------------------------------------------------------------
class wxListItem: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxListItem)
public:
long m_mask; // Indicates what fields are valid
long m_itemId; // The zero-based item position
int m_col; // Zero-based column, if in report mode
long m_state; // The state of the item
long m_stateMask; // Which flags of m_state are valid (uses same flags)
wxString m_text; // The label/header text
int m_image; // The zero-based index into an image list
long m_data; // App-defined data
wxColour *m_colour; // only wxGLC, not supported by Windows ;->
// For columns only
int m_format; // left, right, centre
int m_width; // width of column
wxListItem(void);
};
//-----------------------------------------------------------------------------
// wxListEvent
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxListEvent: public wxCommandEvent
{
DECLARE_DYNAMIC_CLASS(wxListEvent)
public:
wxListEvent(WXTYPE commandType = 0, int id = 0);
int m_code;
long m_itemIndex;
long m_oldItemIndex;
int m_col;
bool m_cancelled;
wxPoint m_pointDrag;
wxListItem m_item;
};
typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&);
#define EVT_LIST_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_LIST_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
#define EVT_LIST_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_LIST_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
#define EVT_LIST_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
#define EVT_LIST_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_LIST_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
#define EVT_LIST_DELETE_ITEM(id, fn) { wxEVT_COMMAND_LIST_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
#define EVT_LIST_DELETE_ALL_ITEMS(id, fn) { wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
#define EVT_LIST_GET_INFO(id, fn) { wxEVT_COMMAND_LIST_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
#define EVT_LIST_SET_INFO(id, fn) { wxEVT_COMMAND_LIST_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
#define EVT_LIST_ITEM_SELECTED(id, fn) { wxEVT_COMMAND_LIST_ITEM_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
#define EVT_LIST_ITEM_DESELECTED(id, fn) { wxEVT_COMMAND_LIST_ITEM_DESELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
#define EVT_LIST_KEY_DOWN(id, fn) { wxEVT_COMMAND_LIST_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
#define EVT_LIST_INSERT_ITEM(id, fn) { wxEVT_COMMAND_LIST_INSERT_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
#define EVT_LIST_COL_CLICK(id, fn) { wxEVT_COMMAND_LIST_COL_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
//-----------------------------------------------------------------------------
// wxListItemData (internal)
//-----------------------------------------------------------------------------
class wxListItemData : public wxObject
{
DECLARE_DYNAMIC_CLASS(wxListItemData);
protected:
wxString m_text;
int m_image;
long m_data;
int m_xpos,m_ypos;
int m_width,m_height;
wxColour *m_colour;
public:
wxListItemData(void);
wxListItemData( const wxListItem &info );
void SetItem( const wxListItem &info );
void SetText( const wxString &s );
void SetImage( const int image );
void SetData( const long data );
void SetPosition( const int x, const int y );
void SetSize( const int width, const int height );
void SetColour( wxColour *col );
bool HasImage(void) const;
bool HasText(void) const;
bool IsHit( const int x, const int y ) const;
void GetText( wxString &s );
int GetX( void ) const;
int GetY( void ) const;
int GetWidth(void) const;
int GetHeight(void) const;
int GetImage(void) const;
void GetItem( wxListItem &info );
wxColour *GetColour(void);
};
//-----------------------------------------------------------------------------
// wxListHeaderData (internal)
//-----------------------------------------------------------------------------
class wxListHeaderData : public wxObject
{
DECLARE_DYNAMIC_CLASS(wxListHeaderData);
protected:
long m_mask;
int m_image;
wxString m_text;
int m_format;
int m_width;
int m_xpos,m_ypos;
int m_height;
public:
wxListHeaderData(void);
wxListHeaderData( const wxListItem &info );
void SetItem( const wxListItem &item );
void SetPosition( const int x, const int y );
void SetWidth( const int w );
void SetFormat( const int format );
void SetHeight( const int h );
bool HasImage(void) const;
bool HasText(void) const;
bool IsHit( const int x, const int y ) const;
void GetItem( wxListItem &item );
void GetText( wxString &s );
int GetImage(void) const;
int GetWidth(void) const;
int GetFormat(void) const;
};
//-----------------------------------------------------------------------------
// wxListLineData (internal)
//-----------------------------------------------------------------------------
class wxListLineData : public wxObject
{
DECLARE_DYNAMIC_CLASS(wxListLineData);
protected:
wxList m_items;
wxRectangle m_bound_all;
wxRectangle m_bound_label;
wxRectangle m_bound_icon;
wxRectangle m_bound_hilight;
int m_mode;
bool m_hilighted;
wxBrush *m_hilightBrush;
int m_spacing;
wxListMainWindow *m_owner;
void DoDraw( wxPaintDC *dc, const bool hilight, const bool paintBG );
public:
wxListLineData( void ) {};
wxListLineData( wxListMainWindow *owner, const int mode, wxBrush *hilightBrush );
void CalculateSize( wxPaintDC *dc, const int spacing );
void SetPosition( wxPaintDC *dc, const int x, const int y, const int window_width );
void SetColumnPosition( const int index, const int x );
void GetSize( int &width, int &height );
void GetExtent( int &x, int &y, int &width, int &height );
void GetLabelExtent( int &x, int &y, int &width, int &height );
long IsHit( const int x, const int y );
void InitItems( const int num );
void SetItem( const int index, const wxListItem &info );
void GetItem( const int index, wxListItem &info );
void GetText( const int index, wxString &s );
void SetText( const int index, const wxString s );
int GetImage( const int index );
void GetRect( wxRectangle &rect );
void Hilight( const bool on );
void ReverseHilight( void );
void DrawRubberBand( wxPaintDC *dc, const bool on );
void Draw( wxPaintDC *dc );
bool IsInRect( const int x, const int y, const wxRectangle &rect );
bool IsHilighted( void );
void AssignRect( wxRectangle &dest, const int x, const int y, const int width, const int height );
void AssignRect( wxRectangle &dest, const wxRectangle &source );
};
//-----------------------------------------------------------------------------
// wxListHeaderWindow (internal)
//-----------------------------------------------------------------------------
class wxListHeaderWindow : public wxWindow
{
DECLARE_DYNAMIC_CLASS(wxListHeaderWindow)
protected:
wxListMainWindow *m_owner;
wxCursor *m_currentCursor;
wxCursor *m_resizeCursor;
public:
wxListHeaderWindow( void );
wxListHeaderWindow( wxWindow *win, const wxWindowID id, wxListMainWindow *owner,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = 0, const wxString &name = "columntitles" );
void DoDrawRect( wxPaintDC *dc, int x, int y, int w, int h );
void OnPaint( wxPaintEvent &event );
void OnMouse( wxMouseEvent &event );
void OnSetFocus( wxFocusEvent &event );
DECLARE_EVENT_TABLE()
};
//-----------------------------------------------------------------------------
// wxListRenameTimer (internal)
//-----------------------------------------------------------------------------
class wxListRenameTimer: public wxTimer
{
private:
wxListMainWindow *m_owner;
public:
wxListRenameTimer( wxListMainWindow *owner );
void Notify();
};
/*
//-----------------------------------------------------------------------------
// wxListTextCtrl (internal)
//-----------------------------------------------------------------------------
class wxListTextCtrl: public wxTextCtrl
{
DECLARE_DYNAMIC_CLASS(wxListTextCtrl);
private:
bool *m_accept;
wxString *m_res;
wxListMainWindow *m_owner;
public:
wxListTextCtrl(void) : wxTextCtrl() {};
wxListTextCtrl( wxWindow *parent, const char *value = "",
bool *accept, wxString *res, wxListMainWindow *owner,
int x = -1, int y = -1, int w = -1, int h = -1, int style = 0, char *name = "rawtext" ) :
wxTextCtrl( parent, value, x, y, w, h, style, name )
{
m_res = res;
m_accept = accept;
m_owner = owner;
};
void OnChar( wxKeyEvent &event )
{
if (event.keyCode == WXK_RETURN)
{
(*m_accept) = TRUE;
(*m_res) = GetValue();
m_owner->OnRenameAccept();
// Show( FALSE );
delete this;
return;
};
if (event.keyCode == WXK_ESCAPE)
{
(*m_accept) = FALSE;
(*m_res) = "";
// Show( FALSE );
delete this;
return;
};
};
void OnKillFocus(void)
{
(*m_accept) = FALSE;
(*m_res) = "";
// Show( FALSE );
delete this;
return;
};
};
*/
//-----------------------------------------------------------------------------
// wxListMainWindow (internal)
//-----------------------------------------------------------------------------
class wxListMainWindow: public wxScrolledWindow
{
DECLARE_DYNAMIC_CLASS(wxListMainWindow);
public:
long m_mode;
wxList m_lines;
wxList m_columns;
wxListLineData *m_current;
int m_visibleLines;
wxBrush *m_hilightBrush;
wxColour *m_hilightColour;
wxFont *m_myFont;
int m_xScroll,m_yScroll;
bool m_dirty;
wxImageList *m_small_image_list;
wxImageList *m_normal_image_list;
int m_small_spacing;
int m_normal_spacing;
bool m_hasFocus;
bool m_usedKeys;
bool m_lastOnSame;
wxTimer *m_renameTimer;
// wxListTextCtrl *m_text;
bool m_renameAccept;
wxString m_renameRes;
bool m_isCreated;
bool m_isDragging;
public:
wxListMainWindow(void);
wxListMainWindow( wxWindow *parent, const wxWindowID id,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = 0, const wxString &name = "listctrl" );
~wxListMainWindow(void);
void RefreshLine( wxListLineData *line );
void OnPaint( wxPaintEvent &event );
void HilightAll( const bool on );
void ActivateLine( wxListLineData *line );
void SendNotify( wxListLineData *line, long command );
void FocusLine( wxListLineData *line );
void UnfocusLine( wxListLineData *line );
void SelectLine( wxListLineData *line );
void DeselectLine( wxListLineData *line );
void DeleteLine( wxListLineData *line );
void RenameLine( wxListLineData *line, const wxString &newName );
void OnRenameTimer(void);
void OnRenameAccept(void);
void OnMouse( wxMouseEvent &event );
void MoveToFocus( void );
void OnArrowChar( wxListLineData *newCurrent, bool shiftDown );
void OnChar( wxKeyEvent &event );
void OnSetFocus( wxFocusEvent &event );
void OnKillFocus( wxFocusEvent &event );
void OnSize( wxSizeEvent &event );
wxFont *GetMyFont( void );
void DrawImage( int index, wxPaintDC *dc, int x, int y );
void GetImageSize( int index, int &width, int &height );
int GetIndexOfLine( const wxListLineData *line );
int GetTextLength( wxString &s ); // should be const
void SetImageList( wxImageList *imageList, const int which );
void SetItemSpacing( const int spacing, const bool isSmall = FALSE );
int GetItemSpacing( const bool isSmall = FALSE );
void SetColumn( const int col, wxListItem &item );
void SetColumnWidth( const int col, const int width );
void GetColumn( const int col, wxListItem &item );
int GetColumnWidth( const int vol );
int GetColumnCount( void );
int GetCountPerPage( void );
void SetItem( wxListItem &item );
void GetItem( wxListItem &item );
void SetItemState( const long item, const long state, const long stateMask );
int GetItemState( const long item, const long stateMask );
int GetItemCount( void );
void GetItemRect( const long index, wxRectangle &rect );
int GetSelectedItemCount( void );
void SetMode( const long mode );
long GetMode( void ) const;
void CalculatePositions( void );
void RealizeChanges(void);
long GetNextItem( const long item, int geometry, int state );
void DeleteItem( const long index );
void DeleteAllItems( void );
void DeleteColumn( const int col );
void DeleteEverything( void );
void EnsureVisible( const long index );
long FindItem(const long start, const wxString& str, const bool partial = FALSE );
long FindItem(const long start, const long data);
long HitTest( const int x, const int y, int &flags );
void InsertItem( wxListItem &item );
void InsertColumn( const long col, wxListItem &item );
void SortItems( wxListCtrlCompare fn, long data );
virtual bool OnListNotify( wxListEvent &event );
DECLARE_EVENT_TABLE()
};
//-----------------------------------------------------------------------------
// wxListCtrl
//-----------------------------------------------------------------------------
class wxListCtrl: public wxControl
{
DECLARE_DYNAMIC_CLASS(wxListCtrl);
public:
wxListCtrl(void);
wxListCtrl( wxWindow *parent, const wxWindowID id,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = 0, const wxString &name = "listctrl" );
~wxListCtrl(void);
bool Create( wxWindow *parent, const wxWindowID id,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = 0, const wxString &name = "listctrl" );
void OnSize( wxSizeEvent &event );
void SetBackgroundColour( const wxColour& col );
bool GetColumn( const int col, wxListItem& item );
bool SetColumn( const int col, wxListItem& item );
int GetColumnWidth( const int col );
bool SetColumnWidth( const int col, const int width);
int GetCountPerPage(void); // not the same in wxGLC as in Windows, I think
// wxText& GetEditControl(void) const; // not supported in wxGLC
bool GetItem( wxListItem& info );
bool SetItem( wxListItem& info ) ;
long SetItem( const long index, const int col, const wxString& label, const int imageId = -1 );
int GetItemState( const long item, const long stateMask );
bool SetItemState( const long item, const long state, const long stateMask);
bool SetItemImage( const long item, const int image, const int selImage);
wxString GetItemText( const long item );
void SetItemText( const long item, const wxString& str );
long GetItemData( const long item );
bool SetItemData( const long item, long data );
bool GetItemRect( const long item, wxRectangle& rect, const int code = wxLIST_RECT_BOUNDS ); // not supported in wxGLC
bool GetItemPosition( const long item, wxPoint& pos ) const; // not supported in wxGLC
bool SetItemPosition( const long item, const wxPoint& pos ); // not supported in wxGLC
int GetItemCount(void);
int GetItemSpacing( bool isSmall );
int GetSelectedItemCount(void);
// wxColour GetTextColour(void) const; // wxGLC has colours for every Item (see wxListItem)
// void SetTextColour(const wxColour& col);
long GetTopItem(void);
void SetSingleStyle( const long style, const bool add = TRUE ) ;
void SetWindowStyleFlag(const long style);
void RecreateWindow(void) {};
void RealizeChanges( void ); // whereas this is much needed in wxGLC
long GetNextItem(const long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE);
wxImageList *GetImageList(const int which);
void SetImageList(wxImageList *imageList, const int which) ;
bool Arrange( const int flag = wxLIST_ALIGN_DEFAULT ); // always wxLIST_ALIGN_LEFT in wxGLC
bool DeleteItem( const long item );
bool DeleteAllItems(void) ;
bool DeleteColumn( const int col );
// wxText& Edit(const long item) ; // not supported in wxGLC
bool EnsureVisible( const long item );
long FindItem(const long start, const wxString& str, const bool partial = FALSE );
long FindItem(const long start, const long data);
long FindItem(const long start, const wxPoint& pt, const int direction); // not supported in wxGLC
long HitTest(const wxPoint& point, int& flags);
long InsertItem(wxListItem& info);
long InsertItem(const long index, const wxString& label);
long InsertItem(const long index, const int imageIndex);
long InsertItem(const long index, const wxString& label, const int imageIndex);
long InsertColumn(const long col, wxListItem& info);
long InsertColumn(const long col, const wxString& heading, const int format = wxLIST_FORMAT_LEFT,
const int width = -1);
bool ScrollList(const int dx, const int dy);
bool SortItems(wxListCtrlCompare fn, long data);
bool Update(const long item);
virtual bool OnListNotify(wxListEvent& WXUNUSED(event)) { return FALSE; }
void SetDropTarget( wxDropTarget *dropTarget )
{ m_mainWin->SetDropTarget( dropTarget ); };
wxDropTarget *GetDropTarget() const
{ return m_mainWin->GetDropTarget(); };
protected:
// wxListTextCtrl m_textCtrl;
wxImageList *m_imageListNormal;
wxImageList *m_imageListSmall;
wxImageList *m_imageListState; // what's that ?
wxListHeaderWindow *m_headerWin;
wxListMainWindow *m_mainWin;
DECLARE_EVENT_TABLE()
};
#endif // __LISTCTRLH_G__

View File

@ -0,0 +1,52 @@
/////////////////////////////////////////////////////////////////////////////
// Name: msgdlgg.h
// Purpose: Generic wxMessageDialog
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __MSGDLGH_G__
#define __MSGDLGH_G__
#ifdef __GNUG__
#pragma interface "msgdlgg.h"
#endif
#include "wx/setup.h"
#include "wx/dialog.h"
// type is an 'or' (|) of wxOK, wxCANCEL, wxYES_NO
// Returns wxYES/NO/OK/CANCEL
WXDLLEXPORT_DATA(extern const char*) wxMessageBoxCaptionStr;
class WXDLLEXPORT wxGenericMessageDialog: public wxDialog
{
DECLARE_DYNAMIC_CLASS(wxGenericMessageDialog)
protected:
long m_dialogStyle;
public:
wxGenericMessageDialog(wxWindow *parent, const wxString& message, const wxString& caption = wxMessageBoxCaptionStr,
long style = wxOK|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
void OnYes(wxCommandEvent& event);
void OnNo(wxCommandEvent& event);
void OnCancel(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
};
#ifndef __WINDOWS__
#define wxMessageDialog wxGenericMessageDialog
int wxMessageBox(const wxString& message, const wxString& caption = wxMessageBoxCaptionStr,
const long style = wxOK|wxCENTRE, wxWindow *parent = NULL, const int x = -1, const int y = -1);
#endif
#endif
// __MSGDLGH_G__

View File

@ -0,0 +1,69 @@
/////////////////////////////////////////////////////////////////////////////
// Name: panelg.h
// Purpose: wxPanel: similar to wxWindows but is coloured as for a dialog
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __PANELH_G__
#define __PANELH_G__
#ifdef __GNUG__
#pragma interface "panelg.h"
#endif
#include "wx/window.h"
WXDLLEXPORT_DATA(extern const char*) wxPanelNameStr;
// Dialog boxes
class WXDLLEXPORT wxPanel: public wxWindow
{
DECLARE_DYNAMIC_CLASS(wxPanel)
public:
wxPanel(void);
// Old-style constructor
inline wxPanel(wxWindow *parent,
const int x = -1, const int y= -1, const int width = 500, const int height = 500,
const long style = wxTAB_TRAVERSAL | wxNO_BORDER,
const wxString& name = wxPanelNameStr)
{
Create(parent, -1, wxPoint(x, y), wxSize(width, height), style, name);
}
// Constructor
inline wxPanel(wxWindow *parent, const wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const long style = wxTAB_TRAVERSAL | wxNO_BORDER,
const wxString& name = wxPanelNameStr)
{
Create(parent, id, pos, size, style, name);
}
bool Create(wxWindow *parent, const wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const long style = wxTAB_TRAVERSAL | wxNO_BORDER,
const wxString& name = wxPanelNameStr);
void OnPaint(wxPaintEvent& event);
// Sends an OnInitDialog event, which in turns transfers data to
// to the dialog via validators.
virtual void InitDialog(void);
// Responds to colour changes
void OnSysColourChanged(wxSysColourChangedEvent& event);
DECLARE_EVENT_TABLE()
};
#endif
// __PANELH_G__

View File

@ -0,0 +1,57 @@
/////////////////////////////////////////////////////////////////////////////
// Name: printps.h
// Purpose: wxPostScriptPrinter, wxPostScriptPrintPreview
// wxGenericPageSetupDialog
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __PRINTPSH__
#define __PRINTPSH__
#ifdef __GNUG__
#pragma interface "printps.h"
#endif
#include "wx/prntbase.h"
/*
* Represents the printer: manages printing a wxPrintout object
*/
class WXDLLEXPORT wxPostScriptPrinter: public wxPrinterBase
{
DECLARE_DYNAMIC_CLASS(wxPostScriptPrinter)
public:
wxPostScriptPrinter(wxPrintData *data = NULL);
~wxPostScriptPrinter(void);
virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = TRUE);
virtual bool PrintDialog(wxWindow *parent);
virtual bool Setup(wxWindow *parent);
};
/*
* wxPrintPreview
* Programmer creates an object of this class to preview a wxPrintout.
*/
class WXDLLEXPORT wxPostScriptPrintPreview: public wxPrintPreviewBase
{
DECLARE_CLASS(wxPostScriptPrintPreview)
public:
wxPostScriptPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting = NULL, wxPrintData *data = NULL);
~wxPostScriptPrintPreview(void);
virtual bool Print(bool interactive);
virtual void DetermineScaling(void);
};
#endif
// __PRINTPSH__

View File

@ -0,0 +1,145 @@
/////////////////////////////////////////////////////////////////////////////
// Name: prntdlgg.h
// Purpose: wxGenericPrintDialog, wxGenericPrintSetupDialog,
// wxGenericPageSetupDialog
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __PRINTDLGH_G_
#define __PRINTDLGH_G_
#ifdef __GNUG__
#pragma interface "prntdlgg.h"
#endif
#include "wx/defs.h"
#include "wx/dialog.h"
#include "wx/dc.h"
#include "wx/cmndata.h"
#include "wx/postscrp.h"
class WXDLLEXPORT wxTextCtrl;
class WXDLLEXPORT wxButton;
class WXDLLEXPORT wxCheckBox;
class WXDLLEXPORT wxChoice;
class WXDLLEXPORT wxStaticText;
class WXDLLEXPORT wxRadioBox;
/*
* Simulated Print and Print Setup dialogs
* for non-Windows platforms (and Windows using PostScript print/preview)
*/
#define wxPRINTID_STATIC 10
#define wxPRINTID_RANGE 11
#define wxPRINTID_FROM 12
#define wxPRINTID_TO 13
#define wxPRINTID_COPIES 14
#define wxPRINTID_PRINTTOFILE 15
#define wxPRINTID_SETUP 16
class WXDLLEXPORT wxGenericPrintDialog: public wxDialog
{
DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog)
public:
wxStaticText *printerMessage;
wxButton *setupButton;
wxButton *helpButton;
wxRadioBox *rangeRadioBox;
wxTextCtrl *fromText;
wxTextCtrl *toText;
wxTextCtrl *noCopiesText;
wxCheckBox *printToFileCheckBox;
wxCheckBox *collateCopiesCheckBox;
wxPrintData printData;
wxGenericPrintDialog(wxWindow *parent, wxPrintData* data);
~wxGenericPrintDialog(void);
void OnSetup(wxCommandEvent& event);
void OnRange(wxCommandEvent& event);
void OnOK(wxCommandEvent& event);
virtual bool TransferDataFromWindow(void);
virtual bool TransferDataToWindow(void);
virtual int ShowModal(void);
inline wxPrintData& GetPrintData(void) { return printData; }
wxDC *GetPrintDC(void);
DECLARE_EVENT_TABLE()
};
#define wxPRINTID_PRINTCOLOUR 10
#define wxPRINTID_ORIENTATION 11
#define wxPRINTID_COMMAND 12
#define wxPRINTID_OPTIONS 13
#define wxPRINTID_PAPERSIZE 14
class WXDLLEXPORT wxGenericPrintSetupDialog: public wxDialog
{
DECLARE_CLASS(wxGenericPrintSetupDialog)
public:
wxRadioBox *orientationRadioBox;
wxTextCtrl *printerCommandText;
wxTextCtrl *printerOptionsText;
wxCheckBox *colourCheckBox;
wxChoice *paperTypeChoice;
wxPrintSetupData printData;
wxGenericPrintSetupDialog(wxWindow *parent, wxPrintSetupData* data);
~wxGenericPrintSetupDialog(void);
virtual bool TransferDataFromWindow(void);
virtual bool TransferDataToWindow(void);
wxChoice *CreatePaperTypeChoice(int* x, int* y);
inline wxPrintSetupData& GetPrintData(void) { return printData; }
};
#define wxPRINTID_LEFTMARGIN 30
#define wxPRINTID_RIGHTMARGIN 31
#define wxPRINTID_TOPMARGIN 32
#define wxPRINTID_BOTTOMMARGIN 33
class WXDLLEXPORT wxGenericPageSetupDialog: public wxDialog
{
DECLARE_CLASS(wxGenericPageSetupDialog)
public:
wxButton *printerButton;
wxRadioBox *orientationRadioBox;
wxTextCtrl *marginLeftText;
wxTextCtrl *marginTopText;
wxTextCtrl *marginRightText;
wxTextCtrl *marginBottomText;
wxChoice *paperTypeChoice;
static bool pageSetupDialogCancelled;
wxPageSetupData pageData;
wxGenericPageSetupDialog(wxWindow *parent, wxPageSetupData* data = NULL);
~wxGenericPageSetupDialog(void);
virtual bool TransferDataFromWindow(void);
virtual bool TransferDataToWindow(void);
void OnPrinter(wxCommandEvent& event);
wxChoice *CreatePaperTypeChoice(int* x, int* y);
inline wxPageSetupData& GetPageSetupData(void) { return pageData; }
DECLARE_EVENT_TABLE()
};
#endif
// __PRINTDLGH_G__

View File

@ -0,0 +1,141 @@
/////////////////////////////////////////////////////////////////////////////
// Name: scrolwin.h
// Purpose: wxScrolledWindow class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef __SCROLWINH_G__
#define __SCROLWINH_G__
#ifdef __GNUG__
#pragma interface "scrolwin.h"
#endif
#include "wx/window.h"
WXDLLEXPORT_DATA(extern const char*) wxPanelNameStr;
class WXDLLEXPORT wxScrolledWindow: public wxWindow
{
DECLARE_ABSTRACT_CLASS(wxScrolledWindow)
public:
wxScrolledWindow(void);
inline wxScrolledWindow(wxWindow *parent, const wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const long style = wxHSCROLL|wxVSCROLL,
const wxString& name = wxPanelNameStr)
{
Create(parent, id, pos, size, style, name);
}
inline ~wxScrolledWindow(void) {}
bool Create(wxWindow *parent, const wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const long style = wxHSCROLL|wxVSCROLL,
const wxString& name = wxPanelNameStr);
// Set client size
// Should take account of scrollbars
// virtual void SetClientSize(const int width, const int size);
// Is the window retained?
// inline bool IsRetained(void) const;
// Number of pixels per user unit (0 or -1 for no scrollbar)
// Length of virtual canvas in user units
// Length of page in user units
virtual void SetScrollbars(const int pixelsPerUnitX, const int pixelsPerUnitY,
const int noUnitsX, const int noUnitsY,
const int xPos = 0, const int yPos = 0,
const bool noRefresh = FALSE );
// Physically scroll the window
virtual void Scroll(const int x_pos, const int y_pos);
#if WXWIN_COMPATIBILITY
virtual void GetScrollUnitsPerPage(int *x_page, int *y_page) const;
#endif
int GetScrollPageSize(int orient) const ;
void SetScrollPageSize(int orient, int pageSize);
virtual void GetScrollPixelsPerUnit(int *x_unit, int *y_unit) const;
// Enable/disable Windows scrolling in either direction.
// If TRUE, wxWindows scrolls the canvas and only a bit of
// the canvas is invalidated; no Clear() is necessary.
// If FALSE, the whole canvas is invalidated and a Clear() is
// necessary. Disable for when the scroll increment is used
// to actually scroll a non-constant distance
virtual void EnableScrolling(const bool x_scrolling, const bool y_scrolling);
// Get the view start
virtual void ViewStart(int *x, int *y) const;
// Actual size in pixels when scrolling is taken into account
virtual void GetVirtualSize(int *x, int *y) const;
virtual void CalcScrolledPosition(const int x, const int y, int *xx, int *yy) const ;
virtual void CalcUnscrolledPosition(const int x, const int y, float *xx, float *yy) const ;
// Adjust the scrollbars
virtual void AdjustScrollbars(void);
/*
#if WXWIN_COMPATIBILITY
virtual void OldOnScroll(wxCommandEvent& WXUNUSED(event));
virtual void OldOnPaint(void); // Called when needs painting
virtual void OldOnSize(int width, int height); // Called on resize
virtual void OldOnMouseEvent(wxMouseEvent& event); // Called on mouse event
virtual void OldOnChar(wxKeyEvent& event); // Called on character event
#endif
*/
void OnScroll(wxScrollEvent& event);
void OnSize(wxSizeEvent& event);
void OnPaint(wxPaintEvent& event);
// Override this function to draw the graphic.
virtual void OnDraw(wxDC& WXUNUSED(dc)) {};
// Override this function if you don't want to have wxScrolledWindow
// automatically change the origin according to the scroll position.
virtual void PrepareDC(wxDC& dc);
public:
////////////////////////////////////////////////////////////////////////
//// IMPLEMENTATION
// Calculate scroll increment
virtual int CalcScrollInc(wxScrollEvent& event);
////////////////////////////////////////////////////////////////////////
//// PROTECTED DATA
protected:
int m_xScrollPixelsPerLine;
int m_yScrollPixelsPerLine;
bool m_xScrollingEnabled;
bool m_yScrollingEnabled;
int m_xScrollPosition;
int m_yScrollPosition;
int m_xScrollLines;
int m_yScrollLines;
int m_xScrollLinesPerPage;
int m_yScrollLinesPerPage;
DECLARE_EVENT_TABLE()
};
////////////////////////////////////////////////////////////////////////
//// INLINES
#endif
// __SCROLWINH_G__

View File

@ -0,0 +1,180 @@
/////////////////////////////////////////////////////////////////////////////
// Name: splitter.h
// Purpose: wxSplitterWindow class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef __SPLITTERH_G__
#define __SPLITTERH_G__
#ifdef __GNUG__
#pragma interface "splitter.h"
#endif
#include "wx/defs.h"
#include "wx/window.h"
#include "wx/string.h"
#define WXSPLITTER_VERSION 1.0
#define wxSPLIT_HORIZONTAL 1
#define wxSPLIT_VERTICAL 2
#define wxSPLIT_DRAG_NONE 0
#define wxSPLIT_DRAG_DRAGGING 1
#define wxSPLIT_DRAG_LEFT_DOWN 2
/*
* wxSplitterWindow maintains one or two panes, with
* an optional vertical or horizontal split which
* can be used with the mouse or programmatically.
*/
// TODO:
// 1) Perhaps make the borders sensitive to dragging in order to create a split.
// The MFC splitter window manages scrollbars as well so is able to
// put sash buttons on the scrollbars, but we probably don't want to go down
// this path.
// 2) for wxWindows 2.0, we must find a way to set the WS_CLIPCHILDREN style
// to prevent flickering. (WS_CLIPCHILDREN doesn't work in all cases so can't be
// standard).
class WXDLLEXPORT wxSplitterWindow: public wxWindow
{
DECLARE_DYNAMIC_CLASS(wxSplitterWindow)
public:
////////////////////////////////////////////////////////////////////////////
// Public API
// Default constructor
wxSplitterWindow(void);
// Normal constructor
wxSplitterWindow(wxWindow *parent, const wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const long style = wxSP_3D, const wxString& name = "splitter");
~wxSplitterWindow(void);
// Gets the only or left/top pane
inline wxWindow *GetWindow1(void) { return m_windowOne; }
// Gets the right/bottom pane
inline wxWindow *GetWindow2(void) { return m_windowTwo; }
// Sets the split mode
inline void SetSplitMode(const int mode) { m_splitMode = mode; }
// Gets the split mode
inline int GetSplitMode(void) const { return m_splitMode; };
// Initialize with one window
void Initialize(wxWindow *window);
// Associates the given window with window 2, drawing the appropriate sash
// and changing the split mode.
// Does nothing and returns FALSE if the window is already split.
// A sashPosition of -1 means choose a default sash position.
bool SplitVertically(wxWindow *window1, wxWindow *window2, const int sashPosition = -1);
bool SplitHorizontally(wxWindow *window1, wxWindow *window2, const int sashPosition = -1);
// Removes the specified (or second) window from the view
// Doesn't actually delete the window.
bool Unsplit(wxWindow *toRemove = NULL);
// Is the window split?
inline bool IsSplit(void) const { return (m_windowTwo != NULL); }
// Sets the sash size
inline void SetSashSize(const int width) { m_sashSize = width; }
// Sets the border size
inline void SetBorderSize(const int width) { m_borderSize = width; }
// Gets the sash size
inline int GetSashSize(void) const { return m_sashSize; }
// Gets the border size
inline int GetBorderSize(void) const { return m_borderSize; }
// Set the sash position
void SetSashPosition(const int position, const bool redaw = TRUE);
// Gets the sash position
inline int GetSashPosition(void) const { return m_sashPosition; }
// If this is zero, we can remove panes by dragging the sash.
inline void SetMinimumPaneSize(const int min) { m_minimumPaneSize = min; }
inline int GetMinimumPaneSize(void) const { return m_minimumPaneSize; }
// If the sash is moved to an extreme position, a subwindow
// is removed from the splitter window, and the app is
// notified. The app should delete or hide the window.
virtual void OnUnsplit(wxWindow *removed) { removed->Show(FALSE); }
// Called when the sash is double-clicked.
// The default behaviour is to remove the sash if the
// minimum pane size is zero.
virtual void OnDoubleClickSash(int x, int y);
////////////////////////////////////////////////////////////////////////////
// Implementation
// Paints the border and sash
void OnPaint(wxPaintEvent& event);
// Handles mouse events
void OnMouseEvent(wxMouseEvent& ev);
// Adjusts the panes
void OnSize(wxSizeEvent& event);
// Draws borders
void DrawBorders(wxDC& dc);
// Draws the sash
void DrawSash(wxDC& dc);
// Draws the sash tracker (for whilst moving the sash)
void DrawSashTracker(const int x, const int y);
// Tests for x, y over sash
bool SashHitTest(const int x, const int y, const int tolerance = 2);
// Resizes subwindows
void SizeWindows(void);
// Initialize colours
void InitColours(void);
protected:
int m_splitMode;
wxWindow* m_windowOne;
wxWindow* m_windowTwo;
int m_dragMode;
int m_oldX;
int m_oldY;
int m_borderSize;
int m_sashSize; // Sash width or height
int m_sashPosition; // Number of pixels from left or top
int m_firstX;
int m_firstY;
int m_minimumPaneSize;
wxCursor* m_sashCursorWE;
wxCursor* m_sashCursorNS;
wxPen* m_sashTrackerPen;
wxPen* m_lightShadowPen;
wxPen* m_mediumShadowPen;
wxPen* m_darkShadowPen;
wxPen* m_hilightPen;
wxBrush* m_faceBrush;
wxPen* m_facePen;
DECLARE_EVENT_TABLE()
};
#endif

View File

@ -0,0 +1,92 @@
/////////////////////////////////////////////////////////////////////////////
// Name: statusbr.h
// Purpose: wxStatusBar class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef __STATUSBRH_G__
#define __STATUSBRH_G__
#ifdef __GNUG__
#pragma interface "statusbr.h"
#endif
#include "wx/window.h"
WXDLLEXPORT_DATA(extern const char*) wxPanelNameStr;
class WXDLLEXPORT wxStatusBar: public wxWindow
{
DECLARE_DYNAMIC_CLASS(wxStatusBar)
public:
wxStatusBar(void);
inline wxStatusBar(wxWindow *parent, const wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const long style = 0,
const wxString& name = wxPanelNameStr)
{
Create(parent, id, pos, size, style, name);
}
~wxStatusBar(void);
bool Create(wxWindow *parent, const wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const long style = 0,
const wxString& name = wxPanelNameStr);
// Create status line
virtual void SetFieldsCount(const int number=1, const int *widths = NULL);
inline int GetFieldsCount(void) const { return m_nFields; }
// Set status line text
virtual void SetStatusText(const wxString& text, const int number = 0);
virtual wxString GetStatusText(const int number = 0) const;
// Set status line widths
virtual void SetStatusWidths(const int n, const int *widths_field);
virtual void DrawFieldText(wxDC& dc, const int i);
virtual void DrawField(wxDC& dc, const int i);
// Get the position and size of the field's internal bounding rectangle
virtual bool GetFieldRect(const int i, wxRectangle& rect) const;
inline int GetBorderX(void) const { return m_borderX; }
inline int GetBorderY(void) const { return m_borderY; }
inline void SetBorderX(const int x);
inline void SetBorderY(const int y);
////////////////////////////////////////////////////////////////////////
// Implementation
void OnPaint(wxPaintEvent& event);
virtual void InitColours(void);
// Responds to colour changes
void OnSysColourChanged(wxSysColourChangedEvent& event);
protected:
int * m_statusWidths;
int m_nFields;
wxString * m_statusStrings;
int m_borderX;
int m_borderY;
wxFont m_defaultStatusBarFont;
wxPen m_mediumShadowPen;
wxPen m_hilightPen;
DECLARE_EVENT_TABLE()
};
#endif
// __STATUSBRH_G__

343
include/wx/generic/tabg.h Normal file
View File

@ -0,0 +1,343 @@
/////////////////////////////////////////////////////////////////////////////
// Name: tabg.h
// Purpose: Generic tabbed dialogs
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __TABGH_G__
#define __TABGH_G__
#ifdef __GNUG__
#pragma interface "tabg.h"
#endif
#define WXTAB_VERSION 1.1
#include "wx/hash.h"
#include "wx/string.h"
class wxTabView;
/*
* A wxTabControl is the internal and visual representation
* of the tab.
*/
class wxTabControl: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxTabControl)
public:
wxTabControl(wxTabView *v = NULL);
~wxTabControl(void);
virtual void OnDraw(wxDC& dc, bool lastInRow);
inline void SetLabel(const wxString& str) { m_controlLabel = str; }
inline wxString GetLabel(void) const { return m_controlLabel; }
inline void SetFont(wxFont *f) { m_labelFont = f; }
inline wxFont *GetFont(void) const { return m_labelFont; }
inline void SetSelected(bool sel) { m_isSelected = sel; }
inline bool IsSelected(void) const { return m_isSelected; }
inline void SetPosition(int x, int y) { m_offsetX = x; m_offsetY = y; }
inline void SetSize(int x, int y) { m_width = x; m_height = y; }
inline void SetRowPosition(int r) { m_rowPosition = r; }
inline int GetRowPosition() const { return m_rowPosition; }
inline void SetColPosition(int c) { m_colPosition = c; }
inline int GetColPosition() const { return m_colPosition; }
inline int GetX(void) const { return m_offsetX; }
inline int GetY(void) const { return m_offsetY; }
inline int GetWidth(void) const { return m_width; }
inline int GetHeight(void) const { return m_height; }
inline int GetId(void) const { return m_id; }
inline void SetId(int i) { m_id = i; }
virtual bool HitTest(int x, int y) const ;
protected:
wxTabView* m_view;
wxString m_controlLabel;
bool m_isSelected;
wxFont* m_labelFont;
int m_offsetX; // Offsets from top-left of tab view area (the area below the tabs)
int m_offsetY;
int m_width;
int m_height;
int m_id;
int m_rowPosition; // Position in row from 0
int m_colPosition; // Position in col from 0
};
/*
* Each wxTabLayer is a list of tabs. E.g. there
* are 3 layers in the MS Word Options dialog.
*/
class wxTabLayer: public wxList
{
DECLARE_DYNAMIC_CLASS(wxTabLayer)
public:
wxTabLayer(void)
{
}
};
/*
* The wxTabView controls and draws the tabbed object
*/
#define wxTAB_STYLE_DRAW_BOX 1 // Draws 3D boxes round tab layers
#define wxTAB_STYLE_COLOUR_INTERIOR 2 // Colours interior of tabs, otherwise draws outline
class wxTabView: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxTabView)
public:
wxTabView(long style = wxTAB_STYLE_DRAW_BOX | wxTAB_STYLE_COLOUR_INTERIOR);
~wxTabView();
inline int GetNumberOfLayers() const { return m_layers.Number(); }
inline wxList& GetLayers() { return m_layers; }
inline void SetWindow(wxWindow* wnd) { m_window = wnd; }
inline wxWindow* GetWindow(void) const { return m_window; }
// Automatically positions tabs
wxTabControl *AddTab(int id, const wxString& label, wxTabControl *existingTab = NULL);
void ClearTabs(bool deleteTabs = TRUE);
// Layout tabs (optional, e.g. if resizing window)
void Layout(void);
// Draw all tabs
virtual void Draw(wxDC& dc);
// Process mouse event, return FALSE if we didn't process it
virtual bool OnEvent(wxMouseEvent& event);
// Called when a tab is activated
virtual void OnTabActivate(int activateId, int deactivateId);
// Allows vetoing
virtual bool OnTabPreActivate(int WXUNUSED(activateId), int WXUNUSED(deactivateId) ) { return TRUE; };
// Allows use of application-supplied wxTabControl classes.
virtual wxTabControl *OnCreateTabControl(void) { return new wxTabControl(this); }
void SetHighlightColour(const wxColour& col);
void SetShadowColour(const wxColour& col);
void SetBackgroundColour(const wxColour& col);
inline void SetTextColour(const wxColour& col) { m_textColour = col; }
inline wxColour GetHighlightColour(void) const { return m_highlightColour; }
inline wxColour GetShadowColour(void) const { return m_shadowColour; }
inline wxColour GetBackgroundColour(void) const { return m_backgroundColour; }
inline wxColour GetTextColour(void) const { return m_textColour; }
inline wxPen *GetHighlightPen(void) const { return m_highlightPen; }
inline wxPen *GetShadowPen(void) const { return m_shadowPen; }
inline wxPen *GetBackgroundPen(void) const { return m_backgroundPen; }
inline wxBrush *GetBackgroundBrush(void) const { return m_backgroundBrush; }
inline void SetViewRect(const wxRectangle& rect) { m_tabViewRect = rect; }
inline wxRect GetViewRect(void) const { return m_tabViewRect; }
// Calculate tab width to fit to view, and optionally adjust the view
// to fit the tabs exactly.
int CalculateTabWidth(int noTabs, bool adjustView = FALSE);
inline void SetTabStyle(long style) { m_tabStyle = style; }
inline long GetTabStyle(void) const { return m_tabStyle; }
inline void SetTabSize(int w, int h) { m_tabWidth = w; m_tabHeight = h; }
inline int GetTabWidth(void) const { return m_tabWidth; }
inline int GetTabHeight(void) const { return m_tabHeight; }
inline void SetTabSelectionHeight(int h) { m_tabSelectionHeight = h; }
inline int GetTabSelectionHeight(void) const { return m_tabSelectionHeight; }
inline int GetTopMargin(void) const { return m_topMargin; }
inline void SetTopMargin(int margin) { m_topMargin = margin; }
void SetTabSelection(int sel, bool activateTool = TRUE);
inline int GetTabSelection() const { return m_tabSelection; }
// Find tab control for id
wxTabControl *FindTabControlForId(int id) const ;
// Find tab control for layer, position (starting from zero)
wxTabControl *FindTabControlForPosition(int layer, int position) const ;
inline int GetHorizontalTabOffset() const { return m_tabHorizontalOffset; }
inline int GetHorizontalTabSpacing() const { return m_tabHorizontalSpacing; }
inline void SetHorizontalTabOffset(int sp) { m_tabHorizontalOffset = sp; }
inline void SetHorizontalTabSpacing(int sp) { m_tabHorizontalSpacing = sp; }
inline void SetVerticalTabTextSpacing(int s) { m_tabVerticalTextSpacing = s; }
inline int GetVerticalTabTextSpacing() const { return m_tabVerticalTextSpacing; }
inline wxFont *GetTabFont() const { return m_tabFont; }
inline void SetTabFont(wxFont *f) { m_tabFont = f; }
inline wxFont *GetSelectedTabFont() const { return m_tabSelectedFont; }
inline void SetSelectedTabFont(wxFont *f) { m_tabSelectedFont = f; }
// Find the node and the column at which this control is positioned.
wxNode *FindTabNodeAndColumn(wxTabControl *control, int *col) const ;
// Do the necessary to change to this tab
virtual bool ChangeTab(wxTabControl *control);
// Move the selected tab to the bottom layer, if necessary,
// without calling app activation code
bool MoveSelectionTab(wxTabControl *control);
inline int GetNumberOfTabs() const { return m_noTabs; }
protected:
// List of layers, from front to back.
wxList m_layers;
// Selected tab
int m_tabSelection;
// Usual tab height
int m_tabHeight;
// The height of the selected tab
int m_tabSelectionHeight;
// Usual tab width
int m_tabWidth;
// Space between tabs
int m_tabHorizontalSpacing;
// Space between top of normal tab and text
int m_tabVerticalTextSpacing;
// Horizontal offset of each tab row above the first
int m_tabHorizontalOffset;
// The distance between the bottom of the first tab row
// and the top of the client area (i.e. the margin)
int m_topMargin;
// The position and size of the view above which the tabs are placed.
// I.e., the internal client area of the sheet.
wxRect m_tabViewRect;
// Bitlist of styles
long m_tabStyle;
// Colours
wxColour m_highlightColour;
wxColour m_shadowColour;
wxColour m_backgroundColour;
wxColour m_textColour;
// Pen and brush cache
wxPen* m_highlightPen;
wxPen* m_shadowPen;
wxPen* m_backgroundPen;
wxBrush* m_backgroundBrush;
wxFont* m_tabFont;
wxFont* m_tabSelectedFont;
int m_noTabs;
wxWindow* m_window;
};
/*
* A dialog box class that is tab-friendly
*/
class wxTabbedDialog: public wxDialog
{
DECLARE_DYNAMIC_CLASS(wxTabbedDialog)
public:
wxTabbedDialog(wxWindow *parent, const wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const long windowStyle = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxDialogNameStr);
~wxTabbedDialog(void);
inline wxTabView *GetTabView() const { return m_tabView; }
inline void SetTabView(wxTabView *v) { m_tabView = v; }
void OnCloseWindow(wxCloseEvent& event);
void OnMouseEvent(wxMouseEvent& event);
void OnPaint(wxPaintEvent& event);
protected:
wxTabView* m_tabView;
DECLARE_EVENT_TABLE()
};
/*
* A panel class that is tab-friendly
*/
class wxTabbedPanel: public wxPanel
{
DECLARE_DYNAMIC_CLASS(wxTabbedPanel)
public:
wxTabbedPanel(wxWindow *parent, const wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const long windowStyle = 0, const wxString& name = wxPanelNameStr);
~wxTabbedPanel(void);
inline wxTabView *GetTabView() const { return m_tabView; }
inline void SetTabView(wxTabView *v) { m_tabView = v; }
void OnMouseEvent(wxMouseEvent& event);
void OnPaint(wxPaintEvent& event);
protected:
wxTabView* m_tabView;
DECLARE_EVENT_TABLE()
};
class wxPanelTabView: public wxTabView
{
DECLARE_DYNAMIC_CLASS(wxPanelTabView)
public:
wxPanelTabView(wxPanel *pan, long style = wxTAB_STYLE_DRAW_BOX | wxTAB_STYLE_COLOUR_INTERIOR);
~wxPanelTabView(void);
// Called when a tab is activated
virtual void OnTabActivate(int activateId, int deactivateId);
// Specific to this class
void AddTabWindow(int id, wxWindow *window);
wxWindow *GetTabWindow(int id) const ;
void ClearWindows(bool deleteWindows = TRUE);
inline wxWindow *GetCurrentWindow() const { return m_currentWindow; }
void ShowWindowForTab(int id);
protected:
// List of panels, one for each tab. Indexed
// by tab ID.
wxList m_tabWindows;
wxWindow* m_currentWindow;
wxPanel* m_panel;
};
#endif

View File

@ -0,0 +1,51 @@
/////////////////////////////////////////////////////////////////////////////
// Name: textdlgg.h
// Purpose: wxStatusBar class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef __TEXTDLGH_G__
#define __TEXTDLGH_G__
#ifdef __GNUG__
#pragma interface "textdlgg.h"
#endif
#include "wx/setup.h"
#include "wx/dialog.h"
// Handy dialog functions (will be converted into classes at some point)
WXDLLEXPORT_DATA(extern const char*) wxGetTextFromUserPromptStr;
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
#define wxID_TEXT 3000
class WXDLLEXPORT wxTextEntryDialog: public wxDialog
{
DECLARE_DYNAMIC_CLASS(wxTextEntryDialog)
protected:
long m_dialogStyle;
wxString m_value;
public:
wxTextEntryDialog(wxWindow *parent, const wxString& message, const wxString& caption = wxGetTextFromUserPromptStr,
const wxString& value = wxEmptyString, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
inline void SetValue(const wxString& val) { m_value = val; }
inline wxString GetValue(void) const { return m_value; }
void OnOK(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
};
wxString WXDLLEXPORT wxGetTextFromUser(const wxString& message, const wxString& caption = wxGetTextFromUserPromptStr,
const wxString& default_value = wxEmptyString, wxWindow *parent = NULL,
int x = -1, int y = -1, bool centre = TRUE);
#endif
// __TEXTDLGH_G__

View File

@ -0,0 +1,300 @@
/*
* Author: Robert Roebling
*
* Copyright: (C) 1997,1998 Robert Roebling
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the wxWindows Licence, which
* you have received with this library (see Licence.htm).
*
*/
#ifndef __GTKTREECTRLH_G__
#define __GTKTREECTRLH_G__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/string.h"
#include "wx/list.h"
#include "wx/control.h"
#include "wx/event.h"
#include "wx/imaglist.h"
#include "wx/scrolwin.h"
#include "wx/dcclient.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxTreeItem;
class wxTreeEvent;
class wxGenericTreeItem;
class wxTreeCtrl;
//-----------------------------------------------------------------------------
// constants
//-----------------------------------------------------------------------------
// WXDLLEXPORT extern const char *wxTreeNameStr;
#define wxTREE_MASK_HANDLE 0x0001
#define wxTREE_MASK_STATE 0x0002
#define wxTREE_MASK_TEXT 0x0004
#define wxTREE_MASK_IMAGE 0x0008
#define wxTREE_MASK_SELECTED_IMAGE 0x0010
#define wxTREE_MASK_CHILDREN 0x0020
#define wxTREE_MASK_DATA 0x0040
#define wxTREE_STATE_BOLD 0x0001
#define wxTREE_STATE_DROPHILITED 0x0002
#define wxTREE_STATE_EXPANDED 0x0004
#define wxTREE_STATE_EXPANDEDONCE 0x0008
#define wxTREE_STATE_FOCUSED 0x0010
#define wxTREE_STATE_SELECTED 0x0020
#define wxTREE_STATE_CUT 0x0040
#define wxTREE_HITTEST_ABOVE 0x0001 // Above the client area.
#define wxTREE_HITTEST_BELOW 0x0002 // Below the client area.
#define wxTREE_HITTEST_NOWHERE 0x0004 // In the client area but below the last item.
#define wxTREE_HITTEST_ONITEMBUTTON 0x0010 // On the button associated with an item.
#define wxTREE_HITTEST_ONITEMICON 0x0020 // On the bitmap associated with an item.
#define wxTREE_HITTEST_ONITEMINDENT 0x0040 // In the indentation associated with an item.
#define wxTREE_HITTEST_ONITEMLABEL 0x0080 // On the label (string) associated with an item.
#define wxTREE_HITTEST_ONITEMRIGHT 0x0100 // In the area to the right of an item.
#define wxTREE_HITTEST_ONITEMSTATEICON 0x0200 // On the state icon for a tree view item that is in a user-defined state.
#define wxTREE_HITTEST_TOLEFT 0x0400 // To the right of the client area.
#define wxTREE_HITTEST_TORIGHT 0x0800 // To the left of the client area.
#define wxTREE_HITTEST_ONITEM (wxTREE_HITTEST_ONITEMICON | wxTREE_HITTEST_ONITEMLABEL wxTREE_HITTEST_ONITEMSTATEICON)
// Flags for GetNextItem
enum {
wxTREE_NEXT_CARET, // Retrieves the currently selected item.
wxTREE_NEXT_CHILD, // Retrieves the first child item. The hItem parameter must be NULL.
wxTREE_NEXT_DROPHILITE, // Retrieves the item that is the target of a drag-and-drop operation.
wxTREE_NEXT_FIRSTVISIBLE, // Retrieves the first visible item.
wxTREE_NEXT_NEXT, // Retrieves the next sibling item.
wxTREE_NEXT_NEXTVISIBLE, // Retrieves the next visible item that follows the specified item.
wxTREE_NEXT_PARENT, // Retrieves the parent of the specified item.
wxTREE_NEXT_PREVIOUS, // Retrieves the previous sibling item.
wxTREE_NEXT_PREVIOUSVISIBLE, // Retrieves the first visible item that precedes the specified item.
wxTREE_NEXT_ROOT // Retrieves the first child item of the root item of which the specified item is a part.
};
// Flags for ExpandItem
enum {
wxTREE_EXPAND_EXPAND,
wxTREE_EXPAND_COLLAPSE,
wxTREE_EXPAND_COLLAPSE_RESET,
wxTREE_EXPAND_TOGGLE
};
// Flags for InsertItem
enum {
wxTREE_INSERT_LAST = -1,
wxTREE_INSERT_FIRST = -2,
wxTREE_INSERT_SORT = -3
};
/* defined in "wx/event.h"
wxEVT_COMMAND_TREE_BEGIN_DRAG,
wxEVT_COMMAND_TREE_BEGIN_RDRAG,
wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT,
wxEVT_COMMAND_TREE_END_LABEL_EDIT,
wxEVT_COMMAND_TREE_DELETE_ITEM,
wxEVT_COMMAND_TREE_GET_INFO,
wxEVT_COMMAND_TREE_SET_INFO,
wxEVT_COMMAND_TREE_ITEM_EXPANDED,
wxEVT_COMMAND_TREE_ITEM_EXPANDING,
wxEVT_COMMAND_TREE_SEL_CHANGED,
wxEVT_COMMAND_TREE_SEL_CHANGING,
wxEVT_COMMAND_TREE_KEY_DOWN
*/
//-----------------------------------------------------------------------------
// wxTreeItem
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxTreeItem: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxTreeItem)
public:
long m_mask;
long m_itemId;
long m_state;
long m_stateMask;
wxString m_text;
int m_image;
int m_selectedImage;
int m_children;
long m_data;
wxTreeItem(void);
};
//-----------------------------------------------------------------------------
// wxTreeEvent
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxTreeEvent: public wxCommandEvent
{
DECLARE_DYNAMIC_CLASS(wxTreeEvent)
public:
wxTreeEvent(WXTYPE commandType = 0, int id = 0);
int m_code;
wxTreeItem m_item;
long m_oldItem;
wxPoint m_pointDrag;
};
typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&);
#define EVT_TREE_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
#define EVT_TREE_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
#define EVT_TREE_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
#define EVT_TREE_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
#define EVT_TREE_DELETE_ITEM(id, fn) { wxEVT_COMMAND_TREE_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
#define EVT_TREE_GET_INFO(id, fn) { wxEVT_COMMAND_TREE_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
#define EVT_TREE_SET_INFO(id, fn) { wxEVT_COMMAND_TREE_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
#define EVT_TREE_ITEM_EXPANDED(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
#define EVT_TREE_ITEM_EXPANDING(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
#define EVT_TREE_SEL_CHANGED(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
#define EVT_TREE_SEL_CHANGING(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
#define EVT_TREE_KEY_DOWN(id, fn) { wxEVT_COMMAND_TREE_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
//-----------------------------------------------------------------------------
// wxGenericTreeItem
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxGenericTreeItem: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxGenericTreeItem)
public:
long m_itemId;
long m_state;
wxString m_text;
int m_image;
int m_selectedImage;
// int m_children;
bool m_hasChildren;
long m_data;
int m_x,m_y;
int m_height,m_width;
int m_xCross,m_yCross;
int m_level;
wxList m_children;
wxGenericTreeItem *m_parent;
bool m_hasHilight;
wxGenericTreeItem(void) {};
wxGenericTreeItem( wxGenericTreeItem *parent );
wxGenericTreeItem( wxGenericTreeItem *parent, const wxTreeItem& item, wxDC *dc );
void SetItem( const wxTreeItem &item, wxDC *dc );
void SetText( const wxString &text, wxDC *dc );
void Reset(void);
void GetItem( wxTreeItem &item ) const;
void AddChild( const wxTreeItem &item );
bool HasChildren(void);
bool HasPlus(void);
int NumberOfVisibleDescendents(void);
int NumberOfVisibleChildren(void);
wxGenericTreeItem *FindItem( long itemId ) const;
void AddChild( wxGenericTreeItem *child );
void SetCross( int x, int y );
void GetSize( int &x, int &y );
long HitTest( const wxPoint& point, int &flags );
void PrepareEvent( wxTreeEvent &event );
void SendKeyDown( wxWindow *target );
void SendSelected( wxWindow *target );
void SendDelete( wxWindow *target );
void SendExpand( wxWindow *target );
void SetHilight( bool set = TRUE );
bool HasHilight(void);
};
//-----------------------------------------------------------------------------
// wxTreeCtrl
//-----------------------------------------------------------------------------
class wxTreeCtrl: public wxScrolledWindow
{
DECLARE_DYNAMIC_CLASS(wxTreeCtrl)
public:
wxTreeCtrl(void);
wxTreeCtrl(wxWindow *parent, const wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const long style = wxTR_HAS_BUTTONS,
const wxString& name = "wxTreeCtrl" );
~wxTreeCtrl(void);
bool Create(wxWindow *parent, const wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const long style = wxTR_HAS_BUTTONS,
const wxString& name = "wxTreeCtrl");
int GetCount(void) const;
long InsertItem( const long parent, const wxString& label, const int image = -1,
const int selImage = -1, const long insertAfter = wxTREE_INSERT_LAST );
long InsertItem( const long parent, wxTreeItem &info, const long insertAfter = wxTREE_INSERT_LAST );
bool DeleteAllItems(void);
bool ExpandItem( const long item, const int action );
bool GetItem( wxTreeItem &info ) const;
long GetItemData( const long item ) const;
wxString GetItemText( const long item ) const;
long GetParent( const long item ) const;
long GetRootItem(void) const;
long GetSelection(void) const;
bool SelectItem( const long item ) const;
bool ItemHasChildren( const long item ) const;
void SetIndent( const int indent );
int GetIndent(void) const;
bool SetItem( wxTreeItem &info );
bool SetItemData( const long item, const long data );
bool SetItemText( const long item, const wxString &text );
long HitTest( const wxPoint& point, int &flags );
void AdjustMyScrollbars(void);
void PaintLevel( wxGenericTreeItem *item, wxPaintDC &dc, int level, int &y );
void OnPaint( const wxPaintEvent &event );
void OnSetFocus( const wxFocusEvent &event );
void OnKillFocus( const wxFocusEvent &event );
void OnChar( wxKeyEvent &event );
void OnMouse( const wxMouseEvent &event );
private:
wxGenericTreeItem *m_anchor;
wxGenericTreeItem *m_current;
bool m_hasFocus;
int m_xScroll,m_yScroll;
int m_indent;
long m_lastId;
int m_lineHeight;
wxPen m_dottedPen;
bool m_isCreated;
wxPaintDC *m_dc;
wxBrush *m_hilightBrush;
void CalculateLevel( wxGenericTreeItem *item, wxPaintDC &dc, int level, int &y );
void CalculatePositions(void);
wxGenericTreeItem *FindItem( const long itemId ) const;
void RefreshLine( wxGenericTreeItem *item );
DECLARE_EVENT_TABLE()
};
#endif
// __GTKTREECTRLH_G__

11
include/wx/grid.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef __GRIDH_BASE__
#define __GRIDH_BASE__
#include "wx/generic/gridg.h"
#ifndef wxGrid
#define wxGrid wxGenericGrid
#endif
#endif
// __GRIDH_BASE__

113
include/wx/gtk/app.h Normal file
View File

@ -0,0 +1,113 @@
/////////////////////////////////////////////////////////////////////////////
// Name: app.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKAPPH__
#define __GTKAPPH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/window.h"
#include "wx/frame.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxApp;
class wxLog;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern wxApp *wxTheApp;
//-----------------------------------------------------------------------------
// global functions
//-----------------------------------------------------------------------------
void wxExit(void);
bool wxYield(void);
//-----------------------------------------------------------------------------
// constants
//-----------------------------------------------------------------------------
#define wxPRINT_WINDOWS 1
#define wxPRINT_POSTSCRIPT 2
//-----------------------------------------------------------------------------
// wxApp
//-----------------------------------------------------------------------------
class wxApp: public wxEvtHandler
{
DECLARE_DYNAMIC_CLASS(wxApp)
public:
wxApp(void);
~wxApp(void);
static void SetInitializerFunction(wxAppInitializerFunction fn) { m_appInitFn = fn; }
static wxAppInitializerFunction GetInitializerFunction(void) { return m_appInitFn; }
virtual bool OnInit(void);
virtual bool OnInitGui(void);
virtual int OnRun(void);
virtual bool OnIdle(void);
virtual int OnExit(void);
wxWindow *GetTopWindow(void);
void SetTopWindow( wxWindow *win );
virtual int MainLoop(void);
void ExitMainLoop(void);
bool Initialized(void);
virtual bool Pending(void);
virtual void Dispatch(void);
void DeletePendingObjects(void);
inline wxString GetAppName(void) const {
if (m_appName != "")
return m_appName;
else return m_className;
}
inline void SetAppName(const wxString& name) { m_appName = name; };
inline wxString GetClassName(void) const { return m_className; }
inline void SetClassName(const wxString& name) { m_className = name; }
inline void SetExitOnFrameDelete(bool flag) { m_exitOnFrameDelete = flag; }
inline bool GetExitOnFrameDelete(void) const { return m_exitOnFrameDelete; }
void SetPrintMode(int WXUNUSED(mode) ) {};
int GetPrintMode(void) const { return wxPRINT_POSTSCRIPT; };
static void CommonInit(void);
static void CommonCleanUp(void);
// override this function to create default log target of arbitrary
// user-defined classv (default implementation creates a wxLogGui object)
virtual wxLog *CreateLogTarget();
bool m_initialized;
bool m_exitOnFrameDelete;
gint m_idleTag;
wxWindow *m_topWindow;
wxString m_appName;
wxString m_className;
int argc;
char **argv;
static wxAppInitializerFunction m_appInitFn;
};
#endif // __GTKAPPH__

118
include/wx/gtk/bitmap.h Normal file
View File

@ -0,0 +1,118 @@
/////////////////////////////////////////////////////////////////////////////
// Name: bitmap.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKBITMAPH__
#define __GTKBITMAPH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/palette.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxDC;
class wxPaintDC;
class wxMemoryDC;
class wxToolBarGTK;
class wxMask;
class wxBitmap;
//-----------------------------------------------------------------------------
// wxMask
//-----------------------------------------------------------------------------
class wxMask: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxMask)
public:
wxMask(void);
wxMask( const wxBitmap& bitmap, const wxColour& colour );
wxMask( const wxBitmap& bitmap, const int paletteIndex );
wxMask( const wxBitmap& bitmap );
~wxMask(void);
private:
friend wxBitmap;
friend wxDC;
friend wxPaintDC;
friend wxToolBarGTK;
GdkBitmap *GetBitmap(void) const;
protected:
GdkBitmap *m_bitmap;
};
//-----------------------------------------------------------------------------
// wxBitmap
//-----------------------------------------------------------------------------
class wxBitmap: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxBitmap)
public:
wxBitmap(void);
wxBitmap( const int width, const int height, const int depth = -1 );
wxBitmap( char **bits );
wxBitmap( const wxBitmap& bmp );
wxBitmap( const wxBitmap* bmp );
wxBitmap( const wxString &filename, const int type );
~wxBitmap(void);
wxBitmap& operator = ( const wxBitmap& bmp );
bool operator == ( const wxBitmap& bmp );
bool operator != ( const wxBitmap& bmp );
bool Ok(void) const;
int GetHeight(void) const;
int GetWidth(void) const;
int GetDepth(void) const;
void SetHeight( const int height );
void SetWidth( const int width );
void SetDepth( const int depth );
wxMask *GetMask(void) const;
void SetMask( wxMask *mask );
bool SaveFile( const wxString &name, const int type, wxPalette *palette = NULL );
bool LoadFile( const wxString &name, const int type );
wxPalette *GetPalette(void) const;
wxPalette *GetColourMap(void) const
{ return GetPalette(); };
private:
friend wxDC;
friend wxPaintDC;
friend wxMemoryDC;
friend wxToolBarGTK;
GdkPixmap *GetPixmap(void) const;
// no data :-)
};
#endif // __GTKBITMAPH__

34
include/wx/gtk/bmpbuttn.h Normal file
View File

@ -0,0 +1,34 @@
/////////////////////////////////////////////////////////////////////////////
// Name: bmpbutton.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __BMPBUTTONH__
#define __BMPBUTTONH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxBitmapButton;
//-----------------------------------------------------------------------------
// wxBitmapButton
//-----------------------------------------------------------------------------
#endif // __BMPBUTTONH__

60
include/wx/gtk/brush.h Normal file
View File

@ -0,0 +1,60 @@
/////////////////////////////////////////////////////////////////////////////
// Name: brush.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKBRUSHH__
#define __GTKBRUSHH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/gdiobj.h"
#include "wx/bitmap.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxBrush;
//-----------------------------------------------------------------------------
// wxBrush
//-----------------------------------------------------------------------------
class wxBrush: public wxGDIObject
{
DECLARE_DYNAMIC_CLASS(wxBrush)
public:
wxBrush(void);
wxBrush( const wxColour &colour, const int style );
wxBrush( const wxString &colourName, const int style );
wxBrush( const wxBitmap &stippleBitmap );
wxBrush( const wxBrush &brush );
wxBrush( const wxBrush *brush );
~wxBrush(void);
wxBrush& operator = ( const wxBrush& brush );
bool operator == ( const wxBrush& brush );
bool operator != ( const wxBrush& brush );
bool Ok(void) const;
int GetStyle(void) const;
wxColour &GetColour(void) const;
wxBitmap *GetStipple(void) const;
// no data :-)
};
#endif // __GTKBRUSHH__

58
include/wx/gtk/button.h Normal file
View File

@ -0,0 +1,58 @@
/////////////////////////////////////////////////////////////////////////////
// Name: button.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKBUTTONH__
#define __GTKBUTTONH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxButton;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char *wxButtonNameStr;
//-----------------------------------------------------------------------------
// wxButton
//-----------------------------------------------------------------------------
class wxButton: public wxControl
{
DECLARE_DYNAMIC_CLASS(wxButton)
public:
wxButton(void);
wxButton( wxWindow *parent, wxWindowID id, const wxString &label,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = 0, const wxString &name = wxButtonNameStr );
bool Create( wxWindow *parent, wxWindowID id, const wxString &label,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = 0, const wxString &name = wxButtonNameStr );
void SetDefault(void);
void SetLabel( const wxString &label );
wxString GetLabel(void) const;
};
#endif // __GTKBUTTONH__

57
include/wx/gtk/checkbox.h Normal file
View File

@ -0,0 +1,57 @@
/////////////////////////////////////////////////////////////////////////////
// Name: checkbox.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKCHECKBOXH__
#define __GTKCHECKBOXH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxCheckBox;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char *wxCheckBoxNameStr;
//-----------------------------------------------------------------------------
// wxCheckBox
//-----------------------------------------------------------------------------
class wxCheckBox: public wxControl
{
DECLARE_DYNAMIC_CLASS(wxCheckBox)
public:
wxCheckBox(void);
wxCheckBox( wxWindow *parent, wxWindowID id, const wxString &label,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = 0, const wxString &name = wxCheckBoxNameStr );
bool Create( wxWindow *parent, wxWindowID id, const wxString &label,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = 0, const wxString &name = wxCheckBoxNameStr );
void SetValue( const bool state );
bool GetValue(void) const;
};
#endif // __GTKCHECKBOXH__

68
include/wx/gtk/choice.h Normal file
View File

@ -0,0 +1,68 @@
/////////////////////////////////////////////////////////////////////////////
// Name: choice.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKCHOICEH__
#define __GTKCHOICEH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxChoice;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char *wxChoiceNameStr;
//-----------------------------------------------------------------------------
// wxChoice
//-----------------------------------------------------------------------------
class wxChoice: public wxControl
{
DECLARE_DYNAMIC_CLASS(wxChoice)
public:
wxChoice(void);
wxChoice( wxWindow *parent, const wxWindowID id,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const int n = 0, const wxString choices[] = NULL,
const long style = 0, const wxString &name = wxChoiceNameStr );
bool Create( wxWindow *parent, const wxWindowID id,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const int n = 0, const wxString choices[] = NULL,
const long style = 0, const wxString &name = wxChoiceNameStr );
void Append( const wxString &item );
void Clear(void);
int FindString( const wxString &string ) const;
int GetColumns(void) const;
int GetSelection(void);
wxString GetString( const int n ) const;
wxString GetStringSelection(void) const;
int Number(void) const;
void SetColumns( const int n = 1 );
void SetSelection( const int n );
void SetStringSelection( const wxString &string );
};
#endif // __GTKCHOICEH__

76
include/wx/gtk/colour.h Normal file
View File

@ -0,0 +1,76 @@
/////////////////////////////////////////////////////////////////////////////
// Name: colour.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKCOLOURH__
#define __GTKCOLOURH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/gdiobj.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxDC;
class wxPaintDC;
class wxBitmap;
class wxWindow;
class wxColour;
//-----------------------------------------------------------------------------
// wxColour
//-----------------------------------------------------------------------------
class wxColour: public wxGDIObject
{
DECLARE_DYNAMIC_CLASS(wxColour)
public:
wxColour(void);
wxColour( char red, char green, char blue );
wxColour( const wxString &colourName );
wxColour( const wxColour& col );
wxColour( const wxColour* col );
~wxColour(void);
wxColour& operator = ( const wxColour& col );
wxColour& operator = ( const wxString& colourName );
bool operator == ( const wxColour& col );
bool operator != ( const wxColour& col );
void Set( const unsigned char red, const unsigned char green, const unsigned char blue );
unsigned char Red(void) const;
unsigned char Green(void) const;
unsigned char Blue(void) const;
bool Ok(void) const;
private:
public:
friend wxDC;
friend wxPaintDC;
friend wxBitmap;
friend wxWindow;
void CalcPixel( GdkColormap *cmap );
int GetPixel(void);
GdkColor *GetColor(void);
// no data :-)
};
#endif // __GTKCOLOURH__

34
include/wx/gtk/combobox.h Normal file
View File

@ -0,0 +1,34 @@
/////////////////////////////////////////////////////////////////////////////
// Name: combobox.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKCOMBOBOXH__
#define __GTKCOMBOBOXH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxComboBox;
//-----------------------------------------------------------------------------
// wxComboBox
//-----------------------------------------------------------------------------
#endif // __GTKCOMBOBOXH__

51
include/wx/gtk/control.h Normal file
View File

@ -0,0 +1,51 @@
/////////////////////////////////////////////////////////////////////////////
// Name: control.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKCONTROLH__
#define __GTKCONTROLH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/window.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxControl;
//-----------------------------------------------------------------------------
// wxControl
//-----------------------------------------------------------------------------
class wxControl: public wxWindow
{
DECLARE_DYNAMIC_CLASS(wxControl)
public:
wxControl(void);
wxControl( wxWindow *parent, wxWindowID id,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = 0, const wxString &name = wxPanelNameStr );
virtual void Command( wxCommandEvent &event );
virtual void SetLabel( const wxString &label );
virtual wxString GetLabel(void) const;
wxString m_label;
};
#endif // __GTKCONTROLH__

61
include/wx/gtk/cursor.h Normal file
View File

@ -0,0 +1,61 @@
/////////////////////////////////////////////////////////////////////////////
// Name: cursor.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKCURSORH__
#define __GTKCURSORH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/gdicmn.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxWindow;
class wxCursor;
//-----------------------------------------------------------------------------
// wxCursor
//-----------------------------------------------------------------------------
class wxCursor: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxCursor)
public:
wxCursor(void);
wxCursor( const int cursorId );
wxCursor( const wxCursor &cursor );
wxCursor( const wxCursor *cursor );
~wxCursor(void);
wxCursor& operator = ( const wxCursor& cursor );
bool operator == ( const wxCursor& cursor );
bool operator != ( const wxCursor& cursor );
bool Ok(void) const;
private:
public:
friend wxWindow;
GdkCursor *GetCursor(void) const;
// no data :-)
};
#endif // __GTKCURSORH__

306
include/wx/gtk/dc.h Normal file
View File

@ -0,0 +1,306 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dc.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKDCH__
#define __GTKDCH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/gdicmn.h"
#include "wx/pen.h"
#include "wx/brush.h"
#include "wx/icon.h"
#include "wx/font.h"
#include "wx/gdicmn.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxDC;
//-----------------------------------------------------------------------------
// constants
//-----------------------------------------------------------------------------
#define MM_TEXT 0
#define MM_ISOTROPIC 1
#define MM_ANISOTROPIC 2
#define MM_LOMETRIC 3
#define MM_HIMETRIC 4
#define MM_TWIPS 5
#define MM_POINTS 6
#define MM_METRIC 7
//-----------------------------------------------------------------------------
// global variables
//-----------------------------------------------------------------------------
extern int wxPageNumber;
//-----------------------------------------------------------------------------
// wxDC
//-----------------------------------------------------------------------------
class wxDC: public wxObject
{
DECLARE_ABSTRACT_CLASS(wxDC)
public:
wxDC(void);
~wxDC(void);
void BeginDrawing(void) {};
void EndDrawing(void) {};
virtual bool Ok(void) const { return m_ok; };
virtual void FloodFill( long x1, long y1, wxColour *col, int style=wxFLOOD_SURFACE ) = 0;
virtual bool GetPixel( long x1, long y1, wxColour *col ) const = 0;
virtual void DrawLine( long x1, long y1, long x2, long y2 ) = 0;
virtual void CrossHair( long x, long y ) = 0;
virtual void DrawArc( long x1, long y1, long x2, long y2, double xc, double yc );
virtual void DrawEllipticArc( long x, long y, long width, long height, double sa, double ea ) = 0;
virtual void DrawPoint( long x, long y ) = 0;
virtual void DrawPoint( wxPoint& point );
virtual void DrawLines( int n, wxPoint points[], long xoffset = 0, long yoffset = 0 ) = 0;
virtual void DrawLines( wxList *points, long xoffset = 0, long yoffset = 0 );
virtual void DrawPolygon( int n, wxPoint points[], long xoffset = 0, long yoffset = 0,
int fillStyle=wxODDEVEN_RULE ) = 0;
virtual void DrawPolygon( wxList *lines, long xoffset = 0, long yoffset = 0,
int fillStyle=wxODDEVEN_RULE );
virtual void DrawRectangle( long x, long y, long width, long height ) = 0;
virtual void DrawRoundedRectangle( long x, long y, long width, long height, double radius = 20.0 ) = 0;
virtual void DrawEllipse( long x, long y, long width, long height ) = 0;
virtual void DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 );
virtual void DrawSpline( wxList *points );
virtual void DrawSpline( int n, wxPoint points[] );
virtual bool CanDrawBitmap(void) const = 0;
virtual void DrawIcon( const wxIcon &icon, long x, long y, bool useMask=FALSE );
void DrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask=FALSE )
{ DrawIcon( *((wxIcon*)(&bmp)), x, y, useMask ); }
virtual bool Blit( long xdest, long ydest, long width, long height,
wxDC *source, long xsrc, long ysrc, int logical_func = wxCOPY, bool useMask=FALSE ) = 0;
virtual void DrawText( const wxString &text, long x, long y, bool use16 = FALSE ) = 0;
virtual bool CanGetTextExtent(void) const = 0;
virtual void GetTextExtent( const wxString &string, long *width, long *height,
long *descent = NULL, long *externalLeading = NULL,
wxFont *theFont = NULL, bool use16 = FALSE ) = 0;
virtual long GetCharWidth(void) = 0;
virtual long GetCharHeight(void) = 0;
virtual void Clear(void) = 0;
virtual void SetFont( const wxFont &font ) = 0;
virtual wxFont *GetFont(void) { return &m_font; };
virtual void SetPen( const wxPen &pen ) = 0;
virtual wxPen *GetPen(void) { return &m_pen; };
virtual void SetBrush( const wxBrush &brush ) = 0;
virtual wxBrush *GetBrush(void) { return &m_brush; };
virtual void SetLogicalFunction( int function ) = 0;
virtual int GetLogicalFunction(void) { return m_logicalFunction; };
virtual void SetTextForeground( const wxColour &col );
virtual void SetTextBackground( const wxColour &col );
virtual wxColour& GetTextBackground(void) const { return (wxColour&)m_textBackgroundColour; };
virtual wxColour& GetTextForeground(void) const { return (wxColour&)m_textForegroundColour; };
virtual void SetBackgroundMode( int mode ) = 0;
virtual int GetBackgroundMode(void) { return m_backgroundMode; };
virtual void SetPalette( const wxPalette& palette ) = 0;
void SetColourMap( const wxPalette& palette ) { SetPalette(palette); };
// the first two must be overridden and called
virtual void SetClippingRegion( long x, long y, long width, long height );
virtual void DestroyClippingRegion(void);
virtual void GetClippingBox( long *x, long *y, long *width, long *height ) const;
virtual inline long MinX(void) const { return m_minX; }
virtual inline long MaxX(void) const { return m_maxX; }
virtual inline long MinY(void) const { return m_minY; }
virtual inline long MaxY(void) const { return m_maxY; }
virtual void GetSize( int* width, int* height ) const;
inline wxSize GetSize(void) const { int w, h; GetSize(&w, &h); return wxSize(w, h); }
virtual void GetSizeMM( long* width, long* height ) const;
virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return TRUE; };
virtual void EndDoc(void) {};
virtual void StartPage(void) {};
virtual void EndPage(void) {};
virtual void SetMapMode( int mode );
virtual int GetMapMode(void) const { return m_mappingMode; };
virtual void SetUserScale( double x, double y );
virtual void GetUserScale( double *x, double *y );
virtual void SetLogicalScale( double x, double y );
virtual void GetLogicalScale( double *x, double *y );
virtual void SetLogicalOrigin( long x, long y );
virtual void GetLogicalOrigin( long *x, long *y );
virtual void SetDeviceOrigin( long x, long y );
virtual void GetDeviceOrigin( long *x, long *y );
virtual void SetInternalDeviceOrigin( long x, long y );
virtual void GetInternalDeviceOrigin( long *x, long *y );
virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
virtual void SetOptimization( bool WXUNUSED(optimize) ) {};
virtual bool GetOptimization(void) { return m_optimize; };
virtual long DeviceToLogicalX(long x) const;
virtual long DeviceToLogicalY(long y) const;
virtual long DeviceToLogicalXRel(long x) const;
virtual long DeviceToLogicalYRel(long y) const;
virtual long LogicalToDeviceX(long x) const;
virtual long LogicalToDeviceY(long y) const;
virtual long LogicalToDeviceXRel(long x) const;
virtual long LogicalToDeviceYRel(long y) const;
public:
void CalcBoundingBox( long x, long y );
void ComputeScaleAndOrigin(void);
long XDEV2LOG(long x) const
{
long new_x = x - m_deviceOriginX;
if (new_x > 0)
return (long)((double)(new_x) / m_scaleX + 0.5) * m_signX + m_logicalOriginX;
else
return (long)((double)(new_x) / m_scaleX - 0.5) * m_signX + m_logicalOriginX;
}
long XDEV2LOGREL(long x) const
{
if (x > 0)
return (long)((double)(x) / m_scaleX + 0.5);
else
return (long)((double)(x) / m_scaleX - 0.5);
}
long YDEV2LOG(long y) const
{
long new_y = y - m_deviceOriginY;
if (new_y > 0)
return (long)((double)(new_y) / m_scaleY + 0.5) * m_signY + m_logicalOriginY;
else
return (long)((double)(new_y) / m_scaleY - 0.5) * m_signY + m_logicalOriginY;
}
long YDEV2LOGREL(long y) const
{
if (y > 0)
return (long)((double)(y) / m_scaleY + 0.5);
else
return (long)((double)(y) / m_scaleY - 0.5);
}
long XLOG2DEV(long x) const
{
long new_x = x - m_logicalOriginX;
if (new_x > 0)
return (long)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX;
else
return (long)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX;
}
long XLOG2DEVREL(long x) const
{
if (x > 0)
return (long)((double)(x) * m_scaleX + 0.5);
else
return (long)((double)(x) * m_scaleX - 0.5);
}
long YLOG2DEV(long y) const
{
long new_y = y - m_logicalOriginY;
if (new_y > 0)
return (long)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY;
else
return (long)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY;
}
long YLOG2DEVREL(long y) const
{
if (y > 0)
return (long)((double)(y) * m_scaleY + 0.5);
else
return (long)((double)(y) * m_scaleY - 0.5);
}
virtual void DrawOpenSpline( wxList *points ) = 0;
public:
bool m_ok;
bool m_colour;
// not sure, what these mean
bool m_clipping; // Is clipping on right now ?
bool m_isInteractive; // Is GetPixel possible ?
bool m_autoSetting; // wxMSW only ?
bool m_dontDelete; // wxMSW only ?
bool m_optimize; // wxMSW only ?
wxString m_filename; // Not sure where this belongs.
wxPen m_pen;
wxBrush m_brush;
wxBrush m_backgroundBrush;
wxColour m_textForegroundColour;
wxColour m_textBackgroundColour;
wxFont m_font;
int m_logicalFunction;
int m_backgroundMode;
int m_textAlignment; // gone in wxWin 2.0 ?
int m_mappingMode;
// not sure what for, but what is a mm on a screen you don't know the size of?
double m_mm_to_pix_x,m_mm_to_pix_y;
long m_internalDeviceOriginX,m_internalDeviceOriginY; // If un-scrolled is non-zero or
// d.o. changes with scrolling.
// Set using SetInternalDeviceOrigin().
long m_externalDeviceOriginX,m_externalDeviceOriginY; // To be set by external classes
// such as wxScrolledWindow
// using SetDeviceOrigin()
long m_deviceOriginX,m_deviceOriginY; // Sum of the two above.
long m_logicalOriginX,m_logicalOriginY; // User defined.
double m_scaleX,m_scaleY;
double m_logicalScaleX,m_logicalScaleY;
double m_userScaleX,m_userScaleY;
long m_signX,m_signY;
bool m_needComputeScaleX,m_needComputeScaleY; // not yet used
float m_scaleFactor; // wxPSDC wants to have this. Will disappear.
long m_clipX1,m_clipY1,m_clipX2,m_clipY2;
long m_minX,m_maxX,m_minY,m_maxY;
};
#endif // __GTKDCH__

107
include/wx/gtk/dcclient.h Normal file
View File

@ -0,0 +1,107 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dcclient.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKDCCLIENTH__
#define __GTKDCCLIENTH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/dc.h"
#include "wx/window.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxPaintDC;
typedef wxPaintDC wxClientDC;
typedef wxPaintDC wxWindowDC;
//-----------------------------------------------------------------------------
// wxPaintDC
//-----------------------------------------------------------------------------
class wxPaintDC: public wxDC
{
DECLARE_DYNAMIC_CLASS(wxPaintDC)
public:
wxPaintDC(void);
wxPaintDC( wxWindow *win );
~wxPaintDC(void);
virtual void FloodFill( long x1, long y1, wxColour *col, int style=wxFLOOD_SURFACE );
virtual bool GetPixel( long x1, long y1, wxColour *col ) const;
virtual void DrawLine( long x1, long y1, long x2, long y2 );
virtual void CrossHair( long x, long y );
virtual void DrawArc( long x1, long y1, long x2, long y2, double xc, double yc );
virtual void DrawEllipticArc( long x, long y, long width, long height, double sa, double ea );
virtual void DrawPoint( long x, long y );
virtual void DrawLines( int n, wxPoint points[], long xoffset = 0, long yoffset = 0 );
virtual void DrawLines( wxList *points, long xoffset = 0, long yoffset = 0 );
virtual void DrawPolygon( int n, wxPoint points[], long xoffset = 0, long yoffset = 0,
int fillStyle=wxODDEVEN_RULE );
virtual void DrawPolygon( wxList *lines, long xoffset = 0, long yoffset = 0,
int fillStyle=wxODDEVEN_RULE );
virtual void DrawRectangle( long x, long y, long width, long height );
virtual void DrawRoundedRectangle( long x, long y, long width, long height, double radius = 20.0 );
virtual void DrawEllipse( long x, long y, long width, long height );
virtual bool CanDrawBitmap(void) const;
virtual void DrawIcon( const wxIcon &icon, long x, long y, bool useMask=FALSE );
virtual bool Blit( long xdest, long ydest, long width, long height,
wxDC *source, long xsrc, long ysrc, int logical_func = wxCOPY, bool useMask=FALSE );
virtual void DrawText( const wxString &text, long x, long y, bool use16 = FALSE );
virtual bool CanGetTextExtent(void) const;
virtual void GetTextExtent( const wxString &string, long *width, long *height,
long *descent = NULL, long *externalLeading = NULL,
wxFont *theFont = NULL, bool use16 = FALSE );
virtual long GetCharWidth(void);
virtual long GetCharHeight(void);
virtual void Clear(void);
virtual void SetFont( const wxFont &font );
virtual void SetPen( const wxPen &pen );
virtual void SetBrush( const wxBrush &brush );
virtual void SetLogicalFunction( int function );
virtual void SetTextForeground( const wxColour &col );
virtual void SetTextBackground( const wxColour &col );
virtual void SetBackgroundMode( int mode );
virtual void SetPalette( const wxPalette& palette );
virtual void SetClippingRegion( long x, long y, long width, long height );
virtual void DestroyClippingRegion(void);
virtual void DrawOpenSpline( wxList *points );
public: // shouldn't be public
GdkWindow *m_window;
GdkGC *m_penGC;
GdkGC *m_brushGC;
GdkGC *m_textGC;
GdkGC *m_bgGC;
GdkColormap *m_cmap;
void SetUpDC(void);
GdkWindow *GetWindow(void);
};
#endif // __GTKDCCLIENTH__

49
include/wx/gtk/dcmemory.h Normal file
View File

@ -0,0 +1,49 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dcmemory.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKDCMEMORYH__
#define __GTKDCMEMORYH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/dcclient.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxMemoryDC;
//-----------------------------------------------------------------------------
// wxMemoryDC
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxMemoryDC: public wxPaintDC
{
DECLARE_DYNAMIC_CLASS(wxMemoryDC)
public:
wxMemoryDC(void);
wxMemoryDC( wxDC *dc ); // Create compatible DC
~wxMemoryDC(void);
virtual void SelectObject( const wxBitmap& bitmap );
void GetSize( int *width, int *height );
private:
wxBitmap m_selected;
};
#endif
// __GTKDCMEMORYH__

32
include/wx/gtk/dcscreen.h Normal file
View File

@ -0,0 +1,32 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dcscreen.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKDCSCREENH__
#define __GTKDCSCREENH__
#include "wx/dcclient.h"
class WXDLLEXPORT wxScreenDC: public wxPaintDC
{
DECLARE_DYNAMIC_CLASS(wxScreenDC)
public:
wxScreenDC(void);
~wxScreenDC(void);
static bool StartDrawingOnTop( wxWindow *window );
static bool StartDrawingOnTop( wxRectangle *rect = NULL );
static bool EndDrawingOnTop(void);
};
#endif
// __GTKDCSCREENH__

95
include/wx/gtk/dialog.h Normal file
View File

@ -0,0 +1,95 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dialog.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKDIALOGH__
#define __GTKDIALOGH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/event.h"
#include "wx/window.h"
//-----------------------------------------------------------------------------
// forward decls
//-----------------------------------------------------------------------------
class wxRadioBox;
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxDialog;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char *wxDialogNameStr;
//-----------------------------------------------------------------------------
// wxDialog
//-----------------------------------------------------------------------------
class wxDialog: public wxWindow
{
DECLARE_DYNAMIC_CLASS(wxDialog)
public:
wxDialog(void);
wxDialog( wxWindow *parent, wxWindowID id, const wxString &title,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = wxDEFAULT_DIALOG_STYLE, const wxString &name = wxDialogNameStr );
bool Create( wxWindow *parent, wxWindowID id, const wxString &title,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = wxDEFAULT_DIALOG_STYLE, const wxString &name = wxDialogNameStr );
~wxDialog(void);
void SetTitle(const wxString& title);
wxString GetTitle(void) const;
bool OnClose(void);
void OnApply( wxCommandEvent &event );
void OnCancel( wxCommandEvent &event );
void OnOk( wxCommandEvent &event );
void OnPaint(wxPaintEvent& event);
void OnCloseWindow(wxCloseEvent& event);
/*
void OnCharHook(wxKeyEvent& event);
*/
virtual bool Show( const bool show );
virtual int ShowModal(void);
virtual void EndModal(int retCode);
virtual bool IsModal(void) const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
virtual void InitDialog(void);
/*
void OnOK(wxCommandEvent& event);
void OnApply(wxCommandEvent& event);
void OnCancel(wxCommandEvent& event);
*/
private:
friend wxWindow;
friend wxDC;
friend wxRadioBox;
bool m_modalShowing;
wxString m_title;
DECLARE_EVENT_TABLE()
};
#endif // __GTKDIALOGH__

35
include/wx/gtk/dirdlg.h Normal file
View File

@ -0,0 +1,35 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dirdlg.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __DIRDIALOGH__
#define __DIRDIALOGH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
#include "wx/dialog.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxDirDialog;
//-----------------------------------------------------------------------------
// wxDirDialog
//-----------------------------------------------------------------------------
#endif // __DIRDIALOGH__

116
include/wx/gtk/dnd.h Normal file
View File

@ -0,0 +1,116 @@
///////////////////////////////////////////////////////////////////////////////
// Name: dnd.h
// Purpose: declaration of the wxDropTarget class
// Author: Robert Roebling
// RCS-ID:
// Copyright: (c) 1998 Vadim Zeitlin, Robert Roebling
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
#ifndef __GTKDNDH__
#define __GTKDNDH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/cursor.h"
//-------------------------------------------------------------------------
// classes
//-------------------------------------------------------------------------
class wxWindow;
class wxDropTarget;
class wxTextDropTarget;
class wxDragSource;
class wxTextDragSource;
//-------------------------------------------------------------------------
// wxDropTarget
//-------------------------------------------------------------------------
class wxDropTarget: wxObject
{
public:
wxDropTarget();
~wxDropTarget();
virtual void OnEnter() { }
virtual void OnLeave() { }
virtual bool OnDrop( long x, long y, const void *pData ) = 0;
public:
void Drop( GdkEvent *event, int x, int y );
virtual void RegisterWidget( GtkWidget *widget ) = 0;
void UnregisterWidget( GtkWidget *widget );
};
//-------------------------------------------------------------------------
// wxTextDropTarget
//-------------------------------------------------------------------------
class wxTextDropTarget: public wxDropTarget
{
public:
wxTextDropTarget() {};
virtual bool OnDrop( long x, long y, const void *pData );
virtual bool OnDropText( long x, long y, const char *psz );
virtual void RegisterWidget( GtkWidget *widget );
};
//-------------------------------------------------------------------------
// wxDragSource
//-------------------------------------------------------------------------
class wxDragSource: public wxObject
{
public:
wxDragSource( wxWindow *win );
~wxDragSource(void);
void SetData( char *data, const long size );
void Start( int x, int y );
public:
void ConnectWindow(void);
void UnconnectWindow(void);
virtual void RegisterWindow(void) = 0;
void UnregisterWindow(void);
GtkWidget *m_widget;
wxWindow *m_window;
char *m_data;
long m_size;
wxCursor m_defaultCursor;
wxCursor m_goaheadCursor;
};
//-------------------------------------------------------------------------
// wxTextDragSource
//-------------------------------------------------------------------------
class wxTextDragSource: public wxDragSource
{
public:
wxTextDragSource( wxWindow *win ) : wxDragSource(win) {};
void SetTextData( const wxString &text );
void RegisterWindow(void);
private:
wxString m_tmp;
};
#endif
//__GTKDNDH__

93
include/wx/gtk/filedlg.h Normal file
View File

@ -0,0 +1,93 @@
/////////////////////////////////////////////////////////////////////////////
// Name: filedlg.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKFILEDLGH__
#define __GTKFILEDLGH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/dialog.h"
//-------------------------------------------------------------------------
// File selector
//-------------------------------------------------------------------------
extern const char *wxFileSelectorPromptStr;
extern const char *wxFileSelectorDefaultWildcardStr;
class wxFileDialog: public wxDialog
{
DECLARE_DYNAMIC_CLASS(wxFileDialog)
public:
wxFileDialog() {};
wxFileDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr,
const wxString& defaultDir = "", const wxString& defaultFile = "",
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
long style = 0, const wxPoint& pos = wxDefaultPosition);
inline void SetMessage(const wxString& message) { m_message = message; }
inline void SetPath(const wxString& path) { m_path = path; }
inline void SetDirectory(const wxString& dir) { m_dir = dir; }
inline void SetFilename(const wxString& name) { m_fileName = name; }
inline void SetWildcard(const wxString& wildCard) { m_wildCard = wildCard; }
inline void SetStyle(long style) { m_dialogStyle = style; }
inline void SetFilterIndex(int filterIndex) { m_filterIndex = filterIndex; }
inline wxString GetMessage(void) const { return m_message; }
inline wxString GetPath(void) const { return m_path; }
inline wxString GetDirectory(void) const { return m_dir; }
inline wxString GetFilename(void) const { return m_fileName; }
inline wxString GetWildcard(void) const { return m_wildCard; }
inline long GetStyle(void) const { return m_dialogStyle; }
inline int GetFilterIndex(void) const { return m_filterIndex ; }
int ShowModal(void);
protected:
wxString m_message;
long m_dialogStyle;
wxWindow * m_parent;
wxString m_dir;
wxString m_path; // Full path
wxString m_fileName;
wxString m_wildCard;
int m_filterIndex;
};
#define wxOPEN 1
#define wxSAVE 2
#define wxOVERWRITE_PROMPT 4
#define wxHIDE_READONLY 8
// File selector - backward compatibility
char* wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL,
const char *default_filename = NULL, const char *default_extension = NULL,
const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0,
wxWindow *parent = NULL, int x = -1, int y = -1);
char* wxLoadFileSelector(const char *what, const char *extension, const char *default_name = NULL,
wxWindow *parent = NULL);
char* wxSaveFileSelector(const char *what, const char *extension, const char *default_name = NULL,
wxWindow *parent = NULL);
#endif
// __GTKFILEDLGH__

120
include/wx/gtk/font.h Normal file
View File

@ -0,0 +1,120 @@
/////////////////////////////////////////////////////////////////////////////
// Name: font.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKFONTH__
#define __GTKFONTH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/hash.h"
#include "wx/gdiobj.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxDC;
class wxPaintDC;
class wxWindow;
class wxFont;
class wxFontNameDirectory;
//-----------------------------------------------------------------------------
// global variables
//-----------------------------------------------------------------------------
// extern wxFontNameDirectory wxTheFontNameDirectory; // defined below
//-----------------------------------------------------------------------------
// wxFont
//-----------------------------------------------------------------------------
class wxFont: public wxGDIObject
{
DECLARE_DYNAMIC_CLASS(wxFont)
public:
wxFont(void);
wxFont( int PointSize, int FontIdOrFamily, int Style, int Weight,
bool underlined = FALSE, const char *Face=NULL );
wxFont( int PointSize, const char *Face, int Family, int Style, int Weight,
bool underlined = FALSE );
wxFont( const wxFont& font );
wxFont( const wxFont* font );
~wxFont(void);
wxFont& operator = ( const wxFont& font );
bool operator == ( const wxFont& font );
bool operator != ( const wxFont& font );
bool Ok();
int GetPointSize(void) const;
wxString GetFaceName(void) const;
int GetFamily(void) const;
wxString GetFamilyString(void) const;
int GetFontId(void) const;
wxString GetFaceString(void) const;
int GetStyle(void) const;
wxString GetStyleString(void) const;
int GetWeight(void) const;
wxString GetWeightString(void) const;
bool GetUnderlined(void) const;
wxFont( char *xFontName );
private:
friend wxDC;
friend wxPaintDC;
friend wxWindow;
GdkFont* GetInternalFont(float scale = 1.0);
// no data :-)
};
//-----------------------------------------------------------------------------
// wxFontDirectory
//-----------------------------------------------------------------------------
class wxFontNameDirectory: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxFontNameDirectory)
public:
wxFontNameDirectory(void);
~wxFontNameDirectory();
void Initialize(void);
void Initialize(int fontid, int family, const char *name);
int FindOrCreateFontId(const char *name, int family);
char* GetAFMName(int fontid, int weight, int style);
int GetFamily(int fontid);
int GetFontId(const char *name);
char* GetFontName(int fontid);
int GetNewFontId(void);
char* GetPostScriptName(int fontid, int weight, int style);
char* GetScreenName(int fontid, int weight, int style);
class wxHashTable *table;
int nextFontId;
};
extern wxFontNameDirectory wxTheFontNameDirectory;
#endif // __GTKFONTH__

90
include/wx/gtk/frame.h Normal file
View File

@ -0,0 +1,90 @@
/////////////////////////////////////////////////////////////////////////////
// Name: frame.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKFRAMEH__
#define __GTKFRAMEH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/window.h"
#include "wx/menu.h"
#include "wx/statusbr.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxRadioBox;
class wxFrame;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char *wxFrameNameStr;
//-----------------------------------------------------------------------------
// wxFrame
//-----------------------------------------------------------------------------
class wxFrame: public wxWindow
{
DECLARE_DYNAMIC_CLASS(wxFrame)
public:
wxFrame(void);
wxFrame( wxWindow *parent, const wxWindowID id, const wxString &title,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = wxDEFAULT_FRAME_STYLE, const wxString &name = wxFrameNameStr );
bool Create( wxWindow *parent, const wxWindowID id, const wxString &title,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = wxDEFAULT_FRAME_STYLE, const wxString &name = wxFrameNameStr );
~wxFrame(void);
bool Destroy(void);
void OnCloseWindow( wxCloseEvent& event );
virtual bool Show( const bool show );
virtual void Enable( const bool enable );
virtual void GetClientSize( int *width, int *height ) const;
void OnSize( wxSizeEvent &event );
void SetMenuBar( wxMenuBar *menuBar );
virtual bool CreateStatusBar( const int number = 1 );
virtual void SetStatusText( const wxString &text, const int number = 0 );
virtual void SetStatusWidths( const int n, const int *width );
wxStatusBar *GetStatusBar(void);
wxMenuBar *GetMenuBar(void);
void SetTitle( const wxString &title );
wxString GetTitle(void) const;
void OnActivate( wxActivateEvent &WXUNUSED(event) ) {};
void GtkOnSize( int width, int height );
private:
friend wxWindow;
GtkWidget *m_mainWindow;
wxMenuBar *m_frameMenuBar;
wxStatusBar *m_frameStatusBar;
bool m_doingOnSize;
wxString m_title;
DECLARE_EVENT_TABLE()
};
#endif // __GTKFRAMEH__

34
include/wx/gtk/gauge.h Normal file
View File

@ -0,0 +1,34 @@
/////////////////////////////////////////////////////////////////////////////
// Name: gauge.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKGAUGEH__
#define __GTKGAUGEH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxGauge;
//-----------------------------------------------------------------------------
// wxGaugeBox
//-----------------------------------------------------------------------------
#endif // __GTKGAUGEH__

37
include/wx/gtk/gdiobj.h Normal file
View File

@ -0,0 +1,37 @@
/////////////////////////////////////////////////////////////////////////////
// Name: gdiobj.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GDIOBJH__
#define __GDIOBJH__
#include "wx/object.h"
#ifdef __GNUG__
#pragma interface
#endif
class WXDLLEXPORT wxGDIObject: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxGDIObject)
public:
inline wxGDIObject(void) { m_visible = FALSE; };
inline ~wxGDIObject(void) {};
virtual bool GetVisible(void) { return m_visible; }
virtual void SetVisible(bool v) { m_visible = v; }
protected:
bool m_visible; // Can a pointer to this object be safely taken?
// - only if created within FindOrCreate...
};
#endif
// __GDIOBJH__

53
include/wx/gtk/icon.h Normal file
View File

@ -0,0 +1,53 @@
/////////////////////////////////////////////////////////////////////////////
// Name: icon.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKICONH__
#define __GTKICONH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/bitmap.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxIcon;
//-----------------------------------------------------------------------------
// wxIcon
//-----------------------------------------------------------------------------
class wxIcon: public wxBitmap
{
DECLARE_DYNAMIC_CLASS(wxIcon)
public:
wxIcon(void) {};
inline wxIcon(const wxIcon& icon) { Ref(icon); }
inline wxIcon(const wxIcon* icon) { if (icon) Ref(*icon); }
wxIcon( char **bits, const int WXUNUSED(width), const int WXUNUSED(height) ) :
wxBitmap( bits ) {};
inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; }
inline bool operator == (const wxIcon& icon) { return m_refData == icon.m_refData; }
inline bool operator != (const wxIcon& icon) { return m_refData != icon.m_refData; }
};
#endif // __GTKICONH__

85
include/wx/gtk/listbox.h Normal file
View File

@ -0,0 +1,85 @@
/////////////////////////////////////////////////////////////////////////////
// Name: listbox.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKLISTBOXH__
#define __GTKLISTBOXH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxListBox;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char *wxListBoxNameStr;
//-----------------------------------------------------------------------------
// wxListBox
//-----------------------------------------------------------------------------
class wxListBox: public wxControl
{
DECLARE_DYNAMIC_CLASS(wxListBox)
public:
wxListBox(void);
wxListBox( wxWindow *parent, wxWindowID id,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const int n = 0, const wxString choices[] = NULL,
const long style = 0, const wxString &name = wxListBoxNameStr );
bool Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const int n = 0, const wxString choices[] = NULL,
const long style = 0, const wxString &name = wxListBoxNameStr );
void Append( const wxString &item );
void Append( const wxString &item, char *clientData );
void Clear(void);
void Delete( int n );
void Deselect( int n );
int FindString( const wxString &item ) const;
char *GetClientData( const int n ) const;
int GetSelection(void) const;
int GetSelections( int **selections ) const;
wxString GetString( int n ) const;
wxString GetStringSelection(void) const;
int Number(void);
bool Selected( const int n );
void Set( const int n, const wxString *choices );
void SetClientData( const int n, char *clientData );
void SetFirstItem( int n );
void SetFirstItem( const wxString &item );
void SetSelection( const int n, const bool select = TRUE );
void SetString( const int n, const wxString &string );
void SetStringSelection( const wxString &string, const bool select = TRUE );
private:
GtkList *m_list;
public:
int GetIndex( GtkWidget *item ) const;
};
#endif // __GTKLISTBOXH__

146
include/wx/gtk/mdi.h Normal file
View File

@ -0,0 +1,146 @@
/////////////////////////////////////////////////////////////////////////////
// Name: mdi.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __MDIH__
#define __MDIH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
#include "wx/panel.h"
#include "wx/frame.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxMDIParentFrame;
class wxMDIClientWindow;
class wxMDIChildFrame;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char* wxFrameNameStr;
extern const char* wxStatusLineNameStr;
//-----------------------------------------------------------------------------
// wxMDIParentFrame
//-----------------------------------------------------------------------------
class wxMDIParentFrame: public wxFrame
{
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
friend class wxMDIChildFrame;
public:
wxMDIParentFrame(void);
wxMDIParentFrame( wxWindow *parent,
const wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
const long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr );
~wxMDIParentFrame(void);
bool Create( wxWindow *parent,
const wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
const long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr );
void OnSize( wxSizeEvent& event );
void OnActivate( wxActivateEvent& event );
void SetMenuBar( wxMenuBar *menu_bar );
void GetClientSize(int *width, int *height) const;
wxMDIChildFrame *GetActiveChild(void) const;
wxMDIClientWindow *GetClientWindow(void) const;
virtual wxMDIClientWindow *OnCreateClient(void);
virtual void Cascade(void) {};
virtual void Tile(void) {};
virtual void ArrangeIcons(void) {};
virtual void ActivateNext(void);
virtual void ActivatePrevious(void);
void OnSysColourChanged(wxSysColourChangedEvent& event);
protected:
wxMDIClientWindow * m_clientWindow;
wxMDIChildFrame * m_currentChild;
bool m_parentFrameActive;
// DECLARE_EVENT_TABLE()
};
//-----------------------------------------------------------------------------
// wxMDIChildFrame
//-----------------------------------------------------------------------------
class wxMDIChildFrame: public wxPanel
{
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
public:
wxMDIChildFrame(void);
wxMDIChildFrame( wxMDIParentFrame *parent,
const wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
const long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr );
~wxMDIChildFrame(void);
bool Create( wxMDIParentFrame *parent,
const wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
const long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr );
void SetMenuBar( wxMenuBar *menu_bar );
// no status bars in wxGTK
virtual bool CreateStatusBar( const int WXUNUSED(number) = 1 ) { return FALSE; };
virtual void SetStatusText( const wxString &WXUNUSED(text), const int WXUNUSED(number) ) {};
virtual void SetStatusWidths( const int WXUNUSED(n), const int *WXUNUSED(width) ) {};
virtual void Maximize(void) {};
virtual void Restore(void) {};
virtual void Activate(void);
public:
wxString m_title;
};
//-----------------------------------------------------------------------------
// wxMDIClientWindow
//-----------------------------------------------------------------------------
class wxMDIClientWindow: public wxWindow
{
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
public:
wxMDIClientWindow(void);
wxMDIClientWindow( wxMDIParentFrame *parent, const long style = 0 );
~wxMDIClientWindow(void);
virtual bool CreateClient( wxMDIParentFrame *parent, const long style = wxVSCROLL | wxHSCROLL );
void AddChild( wxWindow *child );
};
#endif // __MDIH__

107
include/wx/gtk/menu.h Normal file
View File

@ -0,0 +1,107 @@
/////////////////////////////////////////////////////////////////////////////
// Name: menu.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKMENUH__
#define __GTKMENUH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/window.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxMenuBar;
class wxMenuItem;
class wxMenu;
//-----------------------------------------------------------------------------
// wxMenuBar
//-----------------------------------------------------------------------------
class wxMenuBar: public wxWindow
{
DECLARE_DYNAMIC_CLASS(wxMenuBar)
public:
wxMenuBar(void);
void Append( wxMenu *menu, const wxString &title );
int FindMenuItem( const wxString &menuString, const wxString &itemString ) const;
wxList m_menus;
GtkWidget *m_menubar;
};
//-----------------------------------------------------------------------------
// wxMenu
//-----------------------------------------------------------------------------
class wxMenuItem: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxMenuItem)
public:
wxMenuItem(void);
int m_id;
wxString m_text;
bool m_isCheckMenu;
bool m_checked;
bool m_isSubMenu;
bool m_isEnabled;
wxMenu *m_subMenu;
wxString m_helpStr;
GtkWidget *m_menuItem; // GtkMenuItem
};
class wxMenu: public wxEvtHandler
{
DECLARE_DYNAMIC_CLASS(wxMenu)
public:
wxMenu( const wxString &title = "" );
void AppendSeparator(void);
void Append( const int id, const wxString &item,
const wxString &helpStr = "", const bool checkable = FALSE );
void Append( const int id, const wxString &item,
wxMenu *subMenu, const wxString &helpStr = "" );
int FindItem( const wxString itemString ) const;
void Break(void) {};
void Enable( const int id, const bool enable );
bool Enabled( const int id ) const;
void SetLabel( const int id, const wxString &label );
public:
int FindMenuIdByMenuItem( GtkWidget *menuItem ) const;
void SetInvokingWindow( wxWindow *win );
wxWindow *GetInvokingWindow(void);
wxString m_title;
wxList m_items;
wxWindow *m_invokingWindow;
GtkWidget *m_menu; // GtkMenu
};
#endif // __GTKMENUH__

60
include/wx/gtk/palette.h Normal file
View File

@ -0,0 +1,60 @@
/////////////////////////////////////////////////////////////////////////////
// Name: palette.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKPALETTEH__
#define __GTKPALETTEH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/gdiobj.h"
#include "wx/gdicmn.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxPalette;
//-----------------------------------------------------------------------------
// wxPalette
//-----------------------------------------------------------------------------
class wxPalette: public wxGDIObject
{
DECLARE_DYNAMIC_CLASS(wxPalette)
public:
wxPalette(void);
wxPalette( const int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue );
wxPalette( const wxPalette& palette );
wxPalette( const wxPalette* palette );
~wxPalette(void);
wxPalette& operator = ( const wxPalette& palette );
bool operator == ( const wxPalette& palette );
bool operator != ( const wxPalette& palette );
bool Ok(void) const;
bool Create( const int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
int GetPixel( const unsigned char red, const unsigned char green, const unsigned char blue ) const;
bool GetRGB( const int pixel, unsigned char *red, unsigned char *green, unsigned char *blue ) const;
// no data
};
#define wxColorMap wxPalette
#define wxColourMap wxPalette
#endif // __GTKPALETTEH__

68
include/wx/gtk/pen.h Normal file
View File

@ -0,0 +1,68 @@
/////////////////////////////////////////////////////////////////////////////
// Name: pen.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKPENH__
#define __GTKPENH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/gdiobj.h"
#include "wx/gdicmn.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxPen;
//-----------------------------------------------------------------------------
// wxPen
//-----------------------------------------------------------------------------
class wxPen: public wxGDIObject
{
DECLARE_DYNAMIC_CLASS(wxPen)
public:
wxPen(void);
wxPen( const wxColour &colour, int width, int style );
wxPen( const wxString &colourName, int width, int style );
wxPen( const wxPen& pen );
wxPen( const wxPen* pen );
~wxPen(void);
wxPen& operator = ( const wxPen& pen );
bool operator == ( const wxPen& pen );
bool operator != ( const wxPen& pen );
void SetColour( const wxColour &colour );
void SetColour( const wxString &colourName );
void SetColour( const int red, const int green, const int blue );
void SetCap( int capStyle );
void SetJoin( int joinStyle );
void SetStyle( int style );
void SetWidth( int width );
wxColour &GetColour(void) const;
int GetCap(void) const;
int GetJoin(void) const;
int GetStyle(void) const;
int GetWidth(void) const;
bool Ok(void) const;
// no data :-)
};
#endif // __GTKPENH__

84
include/wx/gtk/radiobox.h Normal file
View File

@ -0,0 +1,84 @@
/////////////////////////////////////////////////////////////////////////////
// Name: radiobox.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKRADIOBOXH__
#define __GTKRADIOBOXH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
#include "wx/bitmap.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxRadioBox;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char *wxRadioBoxNameStr;
//-----------------------------------------------------------------------------
// wxRadioBox
//-----------------------------------------------------------------------------
class wxRadioBox: public wxControl
{
DECLARE_DYNAMIC_CLASS(wxRadioBox)
public:
wxRadioBox(void);
wxRadioBox( wxWindow *parent, const wxWindowID id, const wxString& title,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const int n = 0, const wxString choices[] = NULL,
const int majorDim = 0, const long style = wxRA_HORIZONTAL,
const wxString &name = wxRadioBoxNameStr );
bool Create( wxWindow *parent, const wxWindowID id, const wxString& title,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const int n = 0, const wxString choices[] = NULL,
const int majorDim = 0, const long style = wxRA_HORIZONTAL,
const wxString &name = wxRadioBoxNameStr );
int FindString( const wxString& s) const;
void SetSelection( const int n );
int GetSelection(void) const;
wxString GetString( const int n ) const;
wxString GetLabel(void) const;
void SetLabel( const wxString& label );
void SetLabel( const int item, const wxString& label );
void SetLabel( const int item, wxBitmap *bitmap );
wxString GetLabel( const int item ) const;
bool Show( const bool show );
void Enable( const bool enable );
void Enable( const int item, const bool enable );
void Show( const int item, const bool show );
virtual wxString GetStringSelection(void) const;
virtual bool SetStringSelection( const wxString& s );
virtual int Number(void) const;
int GetNumberOfRowsOrCols(void) const;
void SetNumberOfRowsOrCols( const int n );
private:
GtkRadioButton *m_radio;
};
#endif // __GTKRADIOBOXH__

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