Made wxGTK dataobj.cpp compile; removed flashing from wxGLCanvas samples;

some doc bug fixes


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1465 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 1999-01-24 23:56:51 +00:00
parent ba681060f3
commit 06ad863606
25 changed files with 428 additions and 213 deletions

View File

@ -5,6 +5,10 @@ utils/glcanvas/win/make*.*
utils/glcanvas/src/*.cpp
utils/glcanvas/src/*.h
utils/glcanvas/src/make*.*
utils/glcanvas/motif/*.cpp
utils/glcanvas/motif/*.h
utils/glcanvas/motif/make*.*
utils/glcanvas/motif/*.txt
utils/glcanvas/samples/cube/*.cpp
utils/glcanvas/samples/cube/*.h
utils/glcanvas/samples/cube/*.rc

View File

@ -25,14 +25,6 @@ src/gtk/*.c
src/gtk/*.inc
src/gtk/*.xbm
src/gdk_imlib/*.c
src/gdk_imlib/*.h
src/gdk_imlib/AUTHORS
src/gdk_imlib/AUDIT
src/gdk_imlib/COPYING.LIB
src/gdk_imlib/README
src/gdk_imlib/ChangeLog
src/iodbc/*.c
src/iodbc/*.ci
src/iodbc/*.h
@ -94,33 +86,4 @@ setup/shared/sharedSysV
misc/afm/*.afm
misc/gs_afm/*.afm
misc/imlib/imrc
misc/imlib/*.pal
user/Makefile
user/wxConvert/*.cpp
user/wxConvert/*.h
user/wxConvert/Makefile
user/wxConvert/Makefile.in
user/wxFile/*.cpp
user/wxFile/*.h
user/wxFile/Makefile
user/wxFile/Makefile.in
user/wxFile/*.xpm
user/wxTest/*.cpp
user/wxTest/*.h
user/wxTest/Makefile
user/wxTest/Makefile.in
user/wxTest/*.xpm
user/wxTest/*.png
user/wxLayout/*.cpp
user/wxLayout/*.h
user/wxLayout/Makefile
user/wxLayout/Makefile.in
user/wxLayout/*.xpm
user/wxLayout/*.png

View File

@ -9,15 +9,49 @@ mkinstalldirs
wxinstall
src/makeenvs/*.env
src/makeprog.env
src/make.env
src/makelib.env
src/makeprog.env
src/makelib.env
src/Makefile
src/Makefile.in
src/*.inc
src/motif/*.cpp
src/motif/*.c
src/motif/*.h
src/motif/makefile*
src/motif/*.inc
src/motif/*.xbm
src/motif/xmcombo/*.c
src/motif/xmcombo/*.h
src/motif/xmcombo/*.doc
src/motif/xmcombo/*.man
src/motif/xmcombo/*.txt
src/iodbc/*.c
src/iodbc/*.ci
src/iodbc/*.h
src/iodbc/IAFA-PACKAGE
src/iodbc/README
src/iodbc/*.exp
src/iodbc/*.mk
src/iodbc/autoconfig
src/iodbc/build
src/iodbc/Changes.log
src/iodbc/postgres/*.h
include/wx/motif/*.h
include/install-sh
docs/motif/*.txt
docs/motif/makewx
lib/dummy
misc/afm/*.afm
misc/gs_afm/*.afm
setup/*.in
setup/*.hin
@ -65,41 +99,4 @@ setup/shared/sharedSolaris2
setup/shared/sharedSunos4
setup/shared/sharedSysV
misc/afm/*.afm
src/gtk/dcps.cpp
src/motif/*.cpp
src/motif/*.c
src/motif/*.h
src/motif/makefile*
src/motif/*.inc
src/motif/*.xbm
src/motif/xmcombo/*.c
src/motif/xmcombo/*.h
src/motif/xmcombo/*.doc
src/motif/xmcombo/*.man
src/motif/xmcombo/*.txt
src/motif/mdi/COPYRIGHT
src/motif/mdi/Imakefile
src/motif/mdi/Readme
src/motif/mdi/config/C++.rules
src/motif/mdi/config/MDI.tmpl
src/motif/mdi/doc/*.html
src/motif/mdi/doc/pics/*.gif
src/motif/mdi/lib/*.C
src/motif/mdi/lib/*.h
src/motif/mdi/lib/*.xbm
src/motif/mdi/lib/Imakefile
src/motif/mdi/test/*.C
src/motif/mdi/test/Imakefile
include/wx/motif/*.h
include/install-sh
docs/motif/*.txt
docs/motif/makewx
lib/dummy

View File

@ -11,6 +11,9 @@ echo CTRL-C if this is not correct.
pause
erase %dest\wx200*.zip
erase %dest\glcanvas.zip
erase %dest\ogl3.zip
erase %dest\tex2rtf2.zip
cd %src
echo Zipping...
@ -20,8 +23,9 @@ zip32 -@ %dest\wx200msw.zip < %src\distrib\msw\msw.rsp
zip32 -@ %dest\wx200gtk.zip < %src\distrib\msw\gtk.rsp
zip32 -@ %dest\wx200stubs.zip < %src\distrib\msw\stubs.rsp
zip32 -@ %dest\wx200mot.zip < %src\distrib\msw\motif.rsp
zip32 -@ %dest\wx200doc.zip < %src\distrib\msw\docsrc.rsp
zip32 -@ %dest\wx200user.zip < %src\distrib\msw\user.rsp
zip32 -@ %dest\wx200doc.zip < %src\distrib\msw\docsrc.rsp
zip32 -@ %dest\wx200hlp.zip < %src\distrib\msw\wx_hlp.rsp
zip32 -@ %dest\wx200htm.zip < %src\distrib\msw\wx_html.rsp
zip32 -@ %dest\wx200pdf.zip < %src\distrib\msw\wx_pdf.rsp

View File

@ -23,7 +23,9 @@ wxMotif:
- Setting the size of a hidden window may show that window.
- Motif-specific wxImage functions not yet implemented.
- wxRadioBox sometimes doesn't show (e.g. in controls sample).
- wxStaticText doesn't wrap.
General:
--------

View File

@ -2,7 +2,7 @@
This section describes the so called {\it dynamic arrays}. This is a C
array-like data structure i.e. the member access time is constant (and not
linear in number of container elements as for linked lists). However, these
linear according to the number of container elements as for linked lists). However, these
arrays are dynamic in the sense that they will automatically allocate more
memory if there is not enough of it for adding a new element. They also perform
range checking on the index values but in debug mode only, so please be sure to
@ -15,7 +15,7 @@ release build.
The array classes were designed to be reasonably efficient, both in terms of
run-time speed and memory consumption and the executable size. The speed of
array item access if, of course, constant (independent of number of elements)
array item access is, of course, constant (independent of the number of elements)
making them much more efficient than linked lists (\helpref{wxList}{wxlist}).
Adding items to the arrays is also implemented in more or less constant time -
but the price is preallocating the memory in advance. In the \helpref{memory management}{wxarraymemorymanagement} section
@ -35,8 +35,8 @@ element type.
wxArray is suitable for storing integer types and pointers which it does not
treat as objects in any way, i.e. the element pointed to by the pointer is not
deleted when the element is removed from the array \&c. It should be noted that
all of wxArray functions are inline, so it costs strictly nothing to define as
deleted when the element is removed from the array. It should be noted that
all of wxArray's functions are inline, so it costs strictly nothing to define as
many array types as you want (either in terms of the executable size or the
speed) as long as at least one of them is defined and this is always the case
because wxArrays are used by wxWindows internally.
@ -94,7 +94,6 @@ class MyDirectory
WX_DEFINE_OBJARRAY(ArrayOfDirectories);
// that's all!
\end{verbatim}
It is not as elegant as writing
@ -106,7 +105,7 @@ typedef std::vector<MyDirectory> ArrayOfDirectories;
but is not that complicated and allows the code to be compiled with any, however
dumb, C++ compiler in the world.
The things are much simpler for wxArray and wxSortedArray however: it is enough
Things are much simpler for wxArray and wxSortedArray however: it is enough
just to write
\begin{verbatim}
@ -209,7 +208,7 @@ does exactly the same as \helpref{Item()}{wxarrayitem} method.
\membersection{WX\_DEFINE\_ARRAY}\label{wxdefinearray}
\func{}{WX\_DEFINE\_ARRAY}{\param{}{T}, \param{name}}
\func{}{WX\_DEFINE\_ARRAY}{\param{}{T}, \param{}{name}}
This macro defines a new array class named {\it name} and containing the
elements of type {\it T}. Example:
@ -335,11 +334,11 @@ element passed to it is less than, equal to or greater than the second one.
\func{}{wxObjArray}{\param{const wxObjArray\& }{array}}
\func{wxArray\&}{operator=}{\param{const wxArray\& }{array}}
\func{wxArray\&}{operator$=$}{\param{const wxArray\& }{array}}
\func{wxSortedArray\&}{operator=}{\param{const wxSortedArray\& }{array}}
\func{wxSortedArray\&}{operator$=$}{\param{const wxSortedArray\& }{array}}
\func{wxObjArray\&}{operator=}{\param{const wxObjArray\& }{array}}
\func{wxObjArray\&}{operator$=$}{\param{const wxObjArray\& }{array}}
The copy constructors and assignment operators perform a shallow array copy
(i.e. they don't copy the objects pointed to even if the source array contains
@ -348,11 +347,11 @@ the array element are copied too) for wxObjArray.
\membersection{wxArray::\destruct{wxArray}}\label{wxarraydtor}
\func{}{\destruct{wxArray}}{}
\func{}{\destruct{wxArray}}{\void}
\func{}{\destruct{wxSortedArray}}{}
\func{}{\destruct{wxSortedArray}}{\void}
\func{}{\destruct{wxObjArray}}{}
\func{}{\destruct{wxObjArray}}{\void}
The wxObjArray destructor deletes all the items owned by the array. This is not
done by wxArray and wxSortedArray versions - you may use

View File

@ -198,6 +198,7 @@ $$\image{14cm;0cm}{wxclass.ps}$$
\input thread.tex
\input time.tex
\input timer.tex
\input tokenizr.tex
\input toolbar.tex
\input treectrl.tex
\input treeevt.tex

View File

@ -33,14 +33,14 @@ enum wxDragResult
\membersection{wxDropSource::wxDropSource}\label{wxdropsourcewxdropsource}
\func{}{wxDropSource}{\param{wxWindow }{*win = NULL}}
\func{}{wxDropSource}{\param{wxWindow*}{ win = NULL}}
Default/wxGTK-specific constructor. If you use the default constructor you must
call \helpref{wxDropSource::SetData}{wxdropsourcesetdata} later.
{\it win} is required by wxGTK and therefore should always be set.
\func{}{wxDropSource}{\param{wxDataObject }{\&data}, \param{wxWindow }{*win = NULL}}
\func{}{wxDropSource}{\param{wxDataObject\& }{data}, \param{wxWindow*}{ win = NULL}}
\wxheading{Parameters}
@ -54,7 +54,7 @@ call \helpref{wxDropSource::SetData}{wxdropsourcesetdata} later.
\membersection{wxDropSource::SetData}\label{wxdropsourcesetdata}
\func{void}{SetData}{\param{wxDataObject }{\&data}}
\func{void}{SetData}{\param{wxDataObject\&}{ data}}
Sets the data \helpref{data object}{wxdataobject} associated with the drop source.

View File

@ -79,7 +79,7 @@ See \helpref{Read}{wxstreambufreadbuf}
\membersection{wxStreamBuffer::WriteBack}
\func{size\_t}{WriteBack}{\param{const char *}{buffer}, \param{size\_t}{ size}}
\func{size\_t}{WriteBack}{\param{const char*}{ buffer}, \param{size\_t}{ size}}
This function is only useful in ``read'' mode. It puts the specified \it{buffer}
in the input queue of the stream buf. By this way, the next
@ -127,7 +127,7 @@ Frees all internal buffers and resets to initial state all variables.
\membersection{wxStreamBuffer::SetBufferIO}
\func{void}{SetBufferIO}{\param{char *}{ buffer\_start}, \param{char *}{ buffer\_end}}
\func{void}{SetBufferIO}{\param{char*}{ buffer\_start}, \param{char*}{ buffer\_end}}
Specifies which pointers to use for stream buffering. You need to pass a pointer on the
start of the buffer end and another on the end.
@ -212,7 +212,7 @@ Returns the amount of available datas in the buffer.
% --------------
\membersection{wxStreamBuffer::Stream}
\func{wxStreamBase *}{Stream}{\void}
\func{wxStreamBase*}{Stream}{\void}
Returns the stream parent of the stream buffer.

View File

@ -21,46 +21,53 @@ None
% -----------
\membersection{wxStreamBase::wxStreamBase}
\func{}{wxStreamBase}{\void}
Creates a dummy stream object.
\membersection{wxStreamBase::\destruct{wxStreamBase}}
\func{}{\destruct{wxStreamBase}}
Destructor.
\membersection{wxStreamBase::LastError}
\constfunc{wxStreamError}{LastError}{\void}
This function returns the last happened error. It is of the form:
% TODOTODOTODOTODOTODOTODOTODO
This function returns the last error.
% It is of the form:
% TODO
\membersection{wxStreamBase::StreamSize}
\constfunc{size_t}{StreamSize}{\void}
This function returns the size of the stream. (E.g. for a file it the size of
the file) Warning ! There are streams which haven't size by definition (E.g.
a socket).
This function returns the size of the stream. For example, for a file it is the size of
the file). Warning! There are streams which do not have size by definition, such as a socket.
\membersection{wxStreamBase::OnSysRead}\label{wxstreambaseonsysread}
\func{size_t}{OnSysRead}{\param{void *}{buffer}, \param{size_t}{ bufsize}}
\func{size_t}{OnSysRead}{\param{void*}{ buffer}, \param{size_t}{ bufsize}}
Internal function. It is called when the stream buffer needs a buffer of the
specified size. It should return the size which was actually read.
specified size. It should return the size that was actually read.
\membersection{wxStreamBase::OnSysWrite}
\func{size_t}{OnSysWrite}{\param{void *}{buffer}, \param{size_t}{ bufsize}}
See \helpref{OnSysRead}{wxstreambaseonsysread}.
\membersection{wxStreamBase::OnSysSeek}
\func{off_t}{OnSysSeek}{\param{off_t}{ pos}, \param{wxSeekMode}{ mode}}
Internal function. It is called when the stream buffer needs to change the
current position in the stream. See \helpref{wxStreamBuffer::Seek}{wxstreambufferseek}
\membersection{wxStreamBase::OnSysTell}
\constfunc{off_t}{OnSysTell}{\void}
Internal function. Is is called when the stream buffer needs to know the
@ -69,7 +76,6 @@ current position in the stream.
% -----------------------------------------------------------------------------
% wxInputStream
% -----------------------------------------------------------------------------
\section{\class{wxInputStream}}\label{wxinputstream}
\wxheading{Derived from}
@ -83,8 +89,8 @@ current position in the stream.
% -----------
% ctor & dtor
% -----------
\membersection{wxInputStream::wxInputStream}
\func{}{wxInputStream}{\void}
Creates a dummy input stream.
@ -95,6 +101,7 @@ Creates an input stream using the specified stream buffer \it{sbuf}. This
stream buffer can point to another stream.
\membersection{wxInputStream::\destruct{wxInputStream}}
\func{}{\destruct{wxInputStream}}
Destructor.
@ -102,41 +109,45 @@ Destructor.
% -----------
% IO function
% -----------
\membersection{wxInputStream::Peek}
\func{char}{Peek}{\void}
Returns the first character in the input queue without removing it.
\membersection{wxInputStream::GetC}
\func{char}{GetC}{\void}
Returns the first character in the input queue and removes it.
\membersection{wxInputStream::Read}
\func{wxInputStream&}{Read}{\param{void *}{buffer}, \param{size_t}{ size}}
\func{wxInputStream\&}{Read}{\param{void *}{buffer}, \param{size_t}{ size}}
Reads the specified amount of bytes and stores the data in \it{buffer}.
\it{WARNING !} The buffer needs absolutely to have at least the specified size.
\it{WARNING!} The buffer absolutely needs to have at least the specified size.
This function returns a reference on the current object, so the user can test
any states of the stream right away.
\func{wxInputStream&}{Read}{\param{wxOutputStream&}{ stream_out}}
\func{wxInputStream\&}{Read}{\param{wxOutputStream\&}{ stream_out}}
Reads data from the input queue and stores them in the specified output stream.
Reads data from the input queue and stores it in the specified output stream.
The data is read until an error is raised by one of the two streams.
% ------------------
% Position functions
% ------------------
\membersection{wxInputStream::SeekI}
\func{off_t}{SeekI}{\param{off_t}{ pos}, \param{wxSeekMode}{ mode = wxFromStart}}
Changes the stream current position.
\membersection{wxInputStream::TellI}
\constfunc{off_t}{TellI}{\void}
Returns the current stream position.
@ -144,13 +155,14 @@ Returns the current stream position.
% ---------------
% State functions
% ---------------
\membersection{wxInputStream::InputStreamBuffer}
\func{wxStreamBuffer *}{InputStreamBuffer}{\void}
\func{wxStreamBuffer*}{InputStreamBuffer}{\void}
Returns the stream buffer associated with the input stream.
\membersection{wxInputStream::LastRead}
\constfunc{size_t}{LastRead}{\void}
Returns the last amount of bytes read.
@ -158,7 +170,6 @@ Returns the last amount of bytes read.
% -----------------------------------------------------------------------------
% wxOutputStream
% -----------------------------------------------------------------------------
\section{\class{wx0utputStream}}\label{wxoutputstream}
\wxheading{Derived from}
@ -172,18 +183,19 @@ Returns the last amount of bytes read.
% -----------
% ctor & dtor
% -----------
\membersection{wxOutputStream::wxOutputStream}
\func{}{wxOutputStream}{\void}
Creates a dummy wxOutputStream object.
\func{}{wxOutputStream}{\param{wxStreamBuffer *}{sbuf}}
\func{}{wxOutputStream}{\param{wxStreamBuffer*}{ sbuf}}
Creates an input stream using the specified stream buffer \it{sbuf}. This
stream buffer can point to another stream.
\membersection{wxOutputStream::\destruct{wxOutputStream}}
\func{}{\destruct{wxOutputStream}}
Destructor.
@ -191,23 +203,24 @@ Destructor.
% -----------
% IO function
% -----------
\membersection{wxOutputStream::PutC}
\func{void}{PutC}{\param{char}{ c}}
Puts the specified character in the output queue and increments the
stream position.
\membersection{wxOutputStream::Write}
\func{wxOutputStream&}{Write}{\param{const void *}{buffer}, \param{size_t}{ size}}
\func{wxOutputStream\&}{Write}{\param{const void *}{buffer}, \param{size_t}{ size}}
Writes the specified amount of bytes using the data of \it{buffer}.
\it{WARNING !} The buffer needs absolutely to have at least the specified size.
\it{WARNING!} The buffer absolutely needs to have at least the specified size.
This function returns a reference on the current object, so the user can test
any states of the stream right away.
\func{wxOutputStream&}{Write}{\param{wxInputStream&}{ stream_in}}
\func{wxOutputStream\&}{Write}{\param{wxInputStream\&}{ stream_in}}
Reads data from the specified input stream and stores them
in the current stream. The data is read until an error is raised
@ -216,13 +229,14 @@ by one of the two streams.
% ------------------
% Position functions
% ------------------
\membersection{wxOutputStream::SeekO}
\func{off_t}{SeekO}{\param{off_t}{ pos}, \param{wxSeekMode}}
Changes the stream current position.
\membersection{wxOutputStream::TellO}
\constfunc{off_t}{TellO}{\void}
Returns the current stream position.
@ -230,20 +244,19 @@ Returns the current stream position.
% ---------------
% State functions
% ---------------
\membersection{wxOutputStream::OutputStreamBuffer}
\func{wxStreamBuffer *}{OutputStreamBuffer}{\void}
Returns the stream buffer associated with the output stream.
\membersection{wxOutputStream::LastWrite}
\constfunc{size_t}{LastWrite}{\void}
\constfunc{size_t}{LastWrite}{\void}
% -----------------------------------------------------------------------------
% wxFilterInputStream
% -----------------------------------------------------------------------------
\section{\class{wxFilterInputStream}}\label{wxfilterinputstream}
\wxheading{Derived from}
@ -259,12 +272,12 @@ differs and it is documented below.
% ctor & dtor
% -----------
\membersection{wxFilterInputStream::wxFilterInputStream}
\func{}{wxFilterInputStream}{\param{wxInputStream&}{ stream}}
\func{}{wxFilterInputStream}{\param{wxInputStream\&}{ stream}}
% -----------------------------------------------------------------------------
% wxFilterOutputStream
% -----------------------------------------------------------------------------
\section{\class{wxFilterOutputStream}}\label{wxfilteroutputstream}
\wxheading{Derived from}
@ -280,4 +293,5 @@ differs and it is documented below.
% ctor & dtor
% -----------
\membersection{wxFilterOutputStream::wxFilterOutputStream}
\func{}{wxFilterOutputStream}{\param{wxOutputStream&}{ stream}}
\func{}{wxFilterOutputStream}{\param{wxOutputStream\&}{ stream}}

View File

@ -2,11 +2,11 @@
Classes: \helpref{wxList}{wxlist}, \helpref{wxArray}{wxarray}
wxWindows uses itself several container classes including (double) linked lists
wxWindows uses itself several container classes including doubly-linked lists
and dynamic arrays (i.e. arrays which expand automatically when they become
full). For both historical and portability reasons wxWindows does not
use STL which provides the standard implementation of many container classes in
C++: first of all, wxWindows had existed well before STL was written and
C++. First of all, wxWindows has existed since well before STL was written, and
secondly we don't believe that today compilers can deal really well with all of
STL classes (this is especially true for some less common platforms). Of
course, the compilers are evolving quite rapidly and hopefully their progress
@ -18,20 +18,20 @@ ones, but they are quite useful and may be compiled with absolutely any C++
compiler. They're used internally by wxWindows, but may, of course, be used in
your programs as well if you wish.
The list classes in wxWindows are double-linked lists which may either own the
The list classes in wxWindows are doubly-linked lists which may either own the
objects they contain (meaning that the list deletes the object when it is
removed from the list or the list itself is destroyed) or just store the
pointers depending on whether you called or not
\helpref{wxList::DeleteContents}{wxlistdeletecontents} method.
Dynamic arrays resemble to C arrays but with two important differences: they
Dynamic arrays resemble C arrays but with two important differences: they
provide run-time range checking in debug builds and they expand automatically
the allocated memory when there is no more space for new items. They come in
two sorts: the "plain" arrays which store either built-in types such as "char",
"int" or "bool" or the pointers to arbitrary objects, or "object arrays" which
own the object pointers to which they store.
For the same portability reasons, container classes implementation in wxWindows
For the same portability reasons, the container classes implementation in wxWindows
does not use templates, but is rather based on C preprocessor i.e. is done with
the macros: {\it WX\_DECLARE\_LIST} and {\it WX\_DEFINE\_LIST} for the linked
lists and {\it WX\_DECLARE\_ARRAY}, {\it WX\_DECLARE\_OBJARRAY} and {\it WX\_DEFINE\_OBJARRAY} for
@ -44,7 +44,7 @@ declaration), otherwise destructors of the container elements will not be
called! As array classes never delete the items they contain anyhow, there is
no WX\_DEFINE\_ARRAY macro for them.
Examples of usage of these macros may be found in \helpref{wxList}{wxlist} and
Examples of usage of these macros may be found in \helpref{wxList}{wxlist} and
\helpref{wxArray}{wxarray} documentation.
Finally, wxWindows predefines several commonly used container classes. wxList

View File

@ -11,7 +11,6 @@
% ----------------------------------------------------------------------------
% Members
% ----------------------------------------------------------------------------
\latexignore{\rtfignore{\membersection{Members}}}
\membersection{wxURL::wxURL}\label{wxurlconstr}

View File

@ -3,8 +3,6 @@ Outstanding issues
(see also todo.txt)
- wxTreeCtrl, wxListCtrl need some debugging (probably mostly
wxMotif scrolling issues).
- wxTextCtrl doesn't work as a stream buffer in Linux/gcc
- No wxSpinButton
- Need a way of specifying default settings for colour/font/etc.

View File

@ -44,8 +44,6 @@ High Priority
- Miscellaneous events.
- wxGLCanvas: cure bad flicker
- Use wxImage to load other formats into wxBitmaps, such as PNG, BMP.
Low Priority

View File

@ -1,76 +1,17 @@
#
# File: makefile.unx
# Author: Julian Smart
# Created: 1993
# Created: 1998
# Updated:
# Copyright: (c) 1993, AIAI, University of Edinburgh
# Copyright: (c) 1998 Julian Smart
#
# "%W% %G%"
#
# Makefile for resource example (UNIX).
# Makefile for nativdlg example (UNIX).
# Actually, this is a Windows-specific example...
WXDIR = ../..
PROGRAM=nativdlg
# All common UNIX compiler flags and options are now in
# this central makefile.
include $(WXDIR)/src/make.env
OBJECTS=$(OBJDIR)/resource.$(OBJSUFF)
.SUFFIXES:
all: $(OBJDIR) resource$(GUISUFFIX)
wxmotif:
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx motif
wxxview:
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx xview
wxhp:
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx hp
# For SGI, include -lPW on your LDLIBS
motif: wxmotif
$(MAKE) -f makefile.unx all GUISUFFIX=_motif GUI=-Dwx_motif GUISUFFIX=_motif OPT='$(OPT)' LDLIBS='$(MOTIFLDLIBS)' WXLIB=$(WXDIR)/lib/libwx_motif.a OPTIONS='$(OPTIONS)' DEBUG='$(DEBUG)' WARN='$(WARN)' XLIB='$(XLIB)' XINCLUDE='$(XINCLUDE)' XVIEW_LINK=
xview: wxxview
$(MAKE) -f makefile.unx GUI=-Dwx_xview GUISUFFIX=_ol CC=$(CC) OPTIONS='$(OPTIONS)' DEBUG='$(DEBUG)' WARN='$(WARN)' XLIB='$(XLIB)' XINCLUDE='$(XINCLUDE)' LDLIBS='$(XVIEWLDLIBS)'
hp: wxhp
$(MAKE) -f makefile.unx GUI=-Dwx_motif GUISUFFIX=_hp CC=CC OPT='' DEBUG='$(DEBUG)' WARN='-w' \
XINCLUDE='$(HPXINCLUDE)' \
XLIB='$(HPXLIB)' \
XVIEW_LINK='' \
LDLIBS='$(HPLDLIBS)'
$(OBJDIR):
mkdir $(OBJDIR)
resource$(GUISUFFIX): $(OBJDIR)/resource.$(OBJSUFF) $(WXLIB)
$(CC) $(LDFLAGS) -o resource$(GUISUFFIX) $(OBJDIR)/resource.$(OBJSUFF) $(XVIEW_LINK) $(LDLIBS)
$(OBJDIR)/resource.$(OBJSUFF): resource.$(SRCSUFF) resource.h
$(CC) -c $(CPPFLAGS) -o $@ resource.$(SRCSUFF)
clean_motif:
$(MAKE) -f makefile.unx GUISUFFIX=_motif cleanany
clean_ol:
$(MAKE) -f makefile.unx GUISUFFIX=_ol cleanany
clean_hp:
$(MAKE) -f makefile.unx GUISUFFIX=_hp cleanany
cleanany:
rm -f $(OBJECTS) resource$(GUISUFFIX) core
wxclean_ol:
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx clean_ol
wxclean_motif:
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx clean_motif
wxclean_hp:
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx clean_hp
OBJECTS=$(PROGRAM).o
include ../../src/makeprog.env

View File

@ -241,7 +241,7 @@ void wxDataBroker::WriteData( wxDataFormat& format, void *dest ) const
if (dobj->GetFormat().GetAtom() == format.GetAtom())
{
return dobj->WriteData( dest );
dobj->WriteData( dest );
}
node = node->Next();
@ -279,7 +279,7 @@ wxString wxDataObject::GetFormatId() const
GdkAtom wxDataObject::GetFormatAtom() const
{
GdkAtom ret = m_format.GetAtom();
GdkAtom ret = ((wxDataObject*) this)->m_format.GetAtom();
return ret;
}

View File

@ -241,7 +241,7 @@ void wxDataBroker::WriteData( wxDataFormat& format, void *dest ) const
if (dobj->GetFormat().GetAtom() == format.GetAtom())
{
return dobj->WriteData( dest );
dobj->WriteData( dest );
}
node = node->Next();
@ -279,7 +279,7 @@ wxString wxDataObject::GetFormatId() const
GdkAtom wxDataObject::GetFormatAtom() const
{
GdkAtom ret = m_format.GetAtom();
GdkAtom ret = ((wxDataObject*) this)->m_format.GetAtom();
return ret;
}

14
src/makelib.env Normal file
View File

@ -0,0 +1,14 @@
# Makes a library in Unix (Motif)
# Replace this with your own path if necessary
WXDIR = $(WXWIN)
include $(WXDIR)/src/make.env
all: $(LIBTARGET)$(GUISUFFIX).a
$(LIBTARGET)$(GUISUFFIX).a : $(OBJECTS)
ar $(AROPTIONS) $@ $(OBJECTS)
$(RANLIB) $@
clean:
rm -f $(OBJECTS) $(LIBTARGET)$(GUISUFFIX).a core

View File

@ -4,7 +4,7 @@ WXDIR = $(WXWIN)
#WXDIR = /home/jacs/wx2
include $(WXDIR)/src/make.env
all: $(PROGRAM)$(GUISUFFIX)
all: $(PROGRAM)$(GUISUFFIX) $(EXTRATARGETS)
$(PROGRAM)$(GUISUFFIX): $(OBJECTS) $(WXLIB)
$(CC) $(LDFLAGS) -o $(PROGRAM)$(GUISUFFIX) $(OBJECTS) $(LDLIBS)

View File

@ -0,0 +1,161 @@
/////////////////////////////////////////////////////////////////////////////
// Name: glcanvas.cpp
// Purpose: wxGLCanvas, for using OpenGL with wxWindows 2.0 for Motif.
// Uses the GLX extension.
// Author: Julian Smart and Wolfram Gloger
// Modified by:
// Created: 1995, 1999
// RCS-ID: $Id$
// Copyright: (c) Julian Smart, Wolfram Gloger
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "glcanvas.h"
#endif
#include "glcanvas.h"
#include "wx/utils.h"
#include "wx/app.h"
#include <Xm/Xm.h>
#include "wx/motif/private.h"
#ifdef OLD_MESA
// workaround for bug in Mesa's glx.c
static int bitcount( unsigned long n )
{
int bits;
for (bits=0; n>0;) {
if(n & 1) bits++;
n = n >> 1;
}
return bits;
}
#endif
/*
* GLCanvas implementation
*/
IMPLEMENT_CLASS(wxGLCanvas, wxScrolledWindow)
wxGLCanvas::wxGLCanvas(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos,
const wxSize& size, long style,
const wxString& name, int *attrib_list, const wxPalette& palette):
wxScrolledWindow(parent, id, pos, size, style, name)
{
XVisualInfo *vi, vi_templ;
XWindowAttributes xwa;
int val, n;
Display* display = (Display*) GetXDisplay();
glx_cx = 0;
// Check for the presence of the GLX extension
if(!glXQueryExtension(display, NULL, NULL)) {
wxDebugMsg("wxGLCanvas: GLX extension is missing\n");
return;
}
if(attrib_list) {
// Get an appropriate visual
vi = glXChooseVisual(display, DefaultScreen(display), attrib_list);
if(!vi) return;
// Here we should make sure that vi is the same visual as the
// one used by the xwindow drawable in wxCanvas. However,
// there is currently no mechanism for this in wx_canvs.cc.
} else {
// By default, we use the visual of xwindow
XGetWindowAttributes(display, (Window) GetXWindow(), &xwa);
vi_templ.visualid = XVisualIDFromVisual(xwa.visual);
vi = XGetVisualInfo(display, VisualIDMask, &vi_templ, &n);
if(!vi) return;
glXGetConfig(display, vi, GLX_USE_GL, &val);
if(!val) return;
// Basically, this is it. It should be possible to use vi
// in glXCreateContext() below. But this fails with Mesa.
// I notified the Mesa author about it; there may be a fix.
#ifdef OLD_MESA
// Construct an attribute list matching the visual
int a_list[32];
n = 0;
if(vi->c_class==TrueColor || vi->c_class==DirectColor) { // RGBA visual
a_list[n++] = GLX_RGBA;
a_list[n++] = GLX_RED_SIZE;
a_list[n++] = bitcount(vi->red_mask);
a_list[n++] = GLX_GREEN_SIZE;
a_list[n++] = bitcount(vi->green_mask);
a_list[n++] = GLX_BLUE_SIZE;
a_list[n++] = bitcount(vi->blue_mask);
glXGetConfig(display, vi, GLX_ALPHA_SIZE, &val);
a_list[n++] = GLX_ALPHA_SIZE;
a_list[n++] = val;
} else { // Color index visual
glXGetConfig(display, vi, GLX_BUFFER_SIZE, &val);
a_list[n++] = GLX_BUFFER_SIZE;
a_list[n++] = val;
}
a_list[n] = None;
XFree(vi);
vi = glXChooseVisual(display, DefaultScreen(display), a_list);
if(!vi) return;
#endif /* OLD_MESA */
}
// Create the GLX context and make it current
glx_cx = glXCreateContext(display, vi, 0, GL_TRUE);
#ifndef OLD_MESA
XFree(vi);
#endif
SetCurrent();
}
wxGLCanvas::~wxGLCanvas(void)
{
Display* display = (Display*) GetXDisplay();
if(glx_cx) glXDestroyContext(display, glx_cx);
}
void wxGLCanvas::SwapBuffers()
{
Display* display = (Display*) GetXDisplay();
if(glx_cx) glXSwapBuffers(display, (Window) GetXWindow());
}
void wxGLCanvas::SetCurrent()
{
Display* display = (Display*) GetXDisplay();
if(glx_cx) glXMakeCurrent(display, (Window) GetXWindow(), glx_cx);
}
void wxGLCanvas::SetColour(const char *col)
{
wxColour *the_colour = wxTheColourDatabase->FindColour(col);
if(the_colour) {
GLboolean b;
glGetBooleanv(GL_RGBA_MODE, &b);
if(b) {
glColor3ub(the_colour->Red(),
the_colour->Green(),
the_colour->Blue());
} else {
GLint pix = (GLint)the_colour->m_pixel;
if(pix == -1) {
XColor exact_def;
exact_def.red = (unsigned short)the_colour->Red() << 8;
exact_def.green = (unsigned short)the_colour->Green() << 8;
exact_def.blue = (unsigned short)the_colour->Blue() << 8;
exact_def.flags = DoRed | DoGreen | DoBlue;
if(!XAllocColor((Display*) GetXDisplay(), (Colormap) wxTheApp->GetMainColormap(GetXDisplay()), &exact_def)) {
wxDebugMsg("wxGLCanvas: cannot allocate color\n");
return;
}
pix = the_colour->m_pixel = exact_def.pixel;
}
glIndexi(pix);
}
}
}

View File

@ -0,0 +1,44 @@
/////////////////////////////////////////////////////////////////////////////
// Name: glcanvas.h
// Purpose: wxGLCanvas, for using OpenGL with wxWindows 2.0 for Motif.
// Uses the GLX extension.
// Author: Julian Smart and Wolfram Gloger
// Modified by:
// Created: 1995, 1999
// RCS-ID: $Id$
// Copyright: (c) Julian Smart, Wolfram Gloger
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma interface "glcanvas.h"
#endif
#ifndef _WX_GLCANVAS_H_
#define _WX_GLCANVAS_H_
#include "wx/setup.h"
#include "wx/gdicmn.h"
#include "wx/palette.h"
#include "wx/scrolwin.h"
#include <GL/glx.h>
class wxGLCanvas: public wxScrolledWindow
{
DECLARE_CLASS(wxGLCanvas)
public:
GLXContext glx_cx;
wxGLCanvas(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = "GLCanvas", int *attribList = 0, const wxPalette& palette = wxNullPalette);
~wxGLCanvas(void);
void SetCurrent();
void SwapBuffers();
void SetColour(const char *col);
};
#endif
// _WX_GLCANVAS_H_

View File

@ -0,0 +1,20 @@
#
# File: makefile.unx
# Author: Julian Smart
# Created: 1998
# Updated:
# Copyright: (c) 1998 Julia`n Smart
#
# "%W% %G%"
#
# Makefile for wxGLCanvas (Unix)
LIBTARGET=$(WXWIN)/lib/libglcanvas
OPENGLHOME=/home/jacs/mesa/Mesa-2.3
EXTRACPPFLAGS=-I$(OPENGLHOME)/include
OBJECTS=glcanvas.o
include ../../../src/makelib.env

View File

@ -0,0 +1,52 @@
GLCanvas class for wxWindows 1.66 using the GLX protocol extension
==================================================================
I have just uploaded a file 'wx166glx.tar.gz' to the wxWindows
incoming directory. It contains an implementation of a GLCanvas class
(interfacing an ordinary wxCanvas with OpenGL calls) for X11 (I tested
with Motif, maybe it works with XView as well). I tried to imitate
what Julian did in 'wxmesa1.zip' for MS Windows in conjunction with
the Mesa library.
Of the several possibilities to use OpenGL under X11, I chose the GLX
server extension, because it is the most efficient method on machines
with graphics hardware support (I expect wxWindows/OpenGL applications
to _fly_ on my Indy :-). However, you don't need a 'real' OpenGL
implementation to use GLCanvas -- the free Mesa library has a
simulated GLX interface built-in. Just link in libMesaGLU and
libMesaGL along with libwx_motif and everything should work fine.
Installation:
Untar wx166glx.tar.gz from your main wxWindows directory (i.e. where
the `include' and `src' subdirectories are). Then apply the small
patch file which has appeared in the `glx' subdirectory:
% patch -p0 < glx/wx166-glx.diff
Recompile the wx_motif library in the standard way. The inclusion of
the GLCanvas class in libwx_motif is protected with a new 'USE_GLX'
flag in wx_setup.h, so it could maybe be included in a future
wxWindows release (with USE_GLX turned off by default).
Two new samples (bounce and prim) are included. I adapted them from
wxmesa1.zip -- they should compile under both MS Windows (with wxMesa)
and X11. The makefile.unx's are set up for the Mesa libraries; if you
have original libGLU/libGL's just change the GLLIBS = ... line.
Problems:
One more or less serious problem remains: the visual generated by the
GLCanvas class must match the visual of wxCanvas.xwindow (which
currently is always the screen's default visual). The end result is
that you will get a nice RGB mode for OpenGL only if your display's
default visual is TrueColor or DirectColor (the XFree86 S3 servers for
PCs with the '-bpp 16/32' option are examples). I'm contemplating a
solution where the wxCanvas drawingarea widget is destroyed and then
re-created from within the GLCanvas constructor. I would welcome
suggestions on this and discussions of the GLCanvas 'API'.
Regards,
Wolfram Gloger.
(Gloger@lrz.uni-muenchen.de)

View File

@ -387,7 +387,7 @@ void TestGLCanvas::OnChar(wxKeyEvent& event)
break;
}
Refresh();
Refresh(FALSE);
}
void TestGLCanvas::OnMouseEvent(wxMouseEvent& event)
@ -402,7 +402,7 @@ void TestGLCanvas::OnMouseEvent(wxMouseEvent& event)
} else {
yrot += (event.GetX() - last_x)*1.0;
xrot += (event.GetY() - last_y)*1.0;
Refresh();
Refresh(FALSE);
}
last_x = event.GetX();
last_y = event.GetY();

View File

@ -106,7 +106,9 @@ void TestGLCanvas::OnPaint( wxPaintEvent& event )
/* must always be here */
wxPaintDC dc(this);
#ifndef __WXMOTIF__
if (!GetContext()) return;
#endif
SetCurrent();
@ -149,7 +151,9 @@ void TestGLCanvas::OnSize(wxSizeEvent& event)
int width, height;
GetClientSize(& width, & height);
#ifndef __WXMOTIF__
if (GetContext())
#endif
{
SetCurrent();
glViewport(0, 0, width, height);
@ -197,7 +201,7 @@ void TestGLCanvas::OnMouse( wxMouseEvent& event )
add_quats( spin_quat, info.quat, info.quat );
/* orientation has changed, redraw mesh */
Refresh();
Refresh(FALSE);
}
info.beginx = event.GetX();