From 06ad863606966ceee6e7eea537f8d427f0d891a9 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sun, 24 Jan 1999 23:56:51 +0000 Subject: [PATCH] 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 --- distrib/msw/glcanvas.rsp | 4 + distrib/msw/gtk.rsp | 37 ----- distrib/msw/motif.rsp | 75 +++++----- distrib/msw/zipdist.bat | 6 +- docs/bugs.txt | 4 +- docs/latex/wx/array.tex | 25 ++-- docs/latex/wx/classes.tex | 1 + docs/latex/wx/dropsrc.tex | 6 +- docs/latex/wx/stream.tex | 6 +- docs/latex/wx/stream2.tex | 76 ++++++---- docs/latex/wx/tcontain.tex | 12 +- docs/latex/wx/url.tex | 1 - docs/motif/issues.txt | 2 - docs/motif/todo.txt | 2 - samples/nativdlg/makefile.unx | 73 +--------- src/gtk/dataobj.cpp | 4 +- src/gtk1/dataobj.cpp | 4 +- src/makelib.env | 14 ++ src/makeprog.env | 2 +- utils/glcanvas/motif/glcanvas.cpp | 161 +++++++++++++++++++++ utils/glcanvas/motif/glcanvas.h | 44 ++++++ utils/glcanvas/motif/makefile.unx | 20 +++ utils/glcanvas/motif/readme.txt | 52 +++++++ utils/glcanvas/samples/isosurf/isosurf.cpp | 4 +- utils/glcanvas/samples/penguin/penguin.cpp | 6 +- 25 files changed, 428 insertions(+), 213 deletions(-) create mode 100644 src/makelib.env create mode 100644 utils/glcanvas/motif/glcanvas.cpp create mode 100644 utils/glcanvas/motif/glcanvas.h create mode 100644 utils/glcanvas/motif/makefile.unx create mode 100644 utils/glcanvas/motif/readme.txt diff --git a/distrib/msw/glcanvas.rsp b/distrib/msw/glcanvas.rsp index b7914a32b4..098b7aa5eb 100644 --- a/distrib/msw/glcanvas.rsp +++ b/distrib/msw/glcanvas.rsp @@ -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 diff --git a/distrib/msw/gtk.rsp b/distrib/msw/gtk.rsp index 2ada26047e..dccdfa476b 100644 --- a/distrib/msw/gtk.rsp +++ b/distrib/msw/gtk.rsp @@ -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 diff --git a/distrib/msw/motif.rsp b/distrib/msw/motif.rsp index 61529911ee..1f0268c915 100644 --- a/distrib/msw/motif.rsp +++ b/distrib/msw/motif.rsp @@ -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 - diff --git a/distrib/msw/zipdist.bat b/distrib/msw/zipdist.bat index f3333095fe..84d9560d98 100755 --- a/distrib/msw/zipdist.bat +++ b/distrib/msw/zipdist.bat @@ -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 diff --git a/docs/bugs.txt b/docs/bugs.txt index fad57c2cfe..b2d9feee5c 100644 --- a/docs/bugs.txt +++ b/docs/bugs.txt @@ -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: -------- diff --git a/docs/latex/wx/array.tex b/docs/latex/wx/array.tex index 22c204212a..0cd2f78b5b 100644 --- a/docs/latex/wx/array.tex +++ b/docs/latex/wx/array.tex @@ -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 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 diff --git a/docs/latex/wx/classes.tex b/docs/latex/wx/classes.tex index be9809aa2f..fda5c983cb 100644 --- a/docs/latex/wx/classes.tex +++ b/docs/latex/wx/classes.tex @@ -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 diff --git a/docs/latex/wx/dropsrc.tex b/docs/latex/wx/dropsrc.tex index 95a49d778f..fa0d71a910 100644 --- a/docs/latex/wx/dropsrc.tex +++ b/docs/latex/wx/dropsrc.tex @@ -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. diff --git a/docs/latex/wx/stream.tex b/docs/latex/wx/stream.tex index cd2abb12bf..81d2144201 100644 --- a/docs/latex/wx/stream.tex +++ b/docs/latex/wx/stream.tex @@ -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. diff --git a/docs/latex/wx/stream2.tex b/docs/latex/wx/stream2.tex index b9c00157ff..0f4e0e7a08 100644 --- a/docs/latex/wx/stream2.tex +++ b/docs/latex/wx/stream2.tex @@ -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}} diff --git a/docs/latex/wx/tcontain.tex b/docs/latex/wx/tcontain.tex index 0e5749f165..c2e7364f36 100644 --- a/docs/latex/wx/tcontain.tex +++ b/docs/latex/wx/tcontain.tex @@ -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 diff --git a/docs/latex/wx/url.tex b/docs/latex/wx/url.tex index 91e6ceff73..12385071e7 100644 --- a/docs/latex/wx/url.tex +++ b/docs/latex/wx/url.tex @@ -11,7 +11,6 @@ % ---------------------------------------------------------------------------- % Members % ---------------------------------------------------------------------------- - \latexignore{\rtfignore{\membersection{Members}}} \membersection{wxURL::wxURL}\label{wxurlconstr} diff --git a/docs/motif/issues.txt b/docs/motif/issues.txt index 9c2739f596..de016c58c9 100644 --- a/docs/motif/issues.txt +++ b/docs/motif/issues.txt @@ -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. diff --git a/docs/motif/todo.txt b/docs/motif/todo.txt index 46c6938dd5..5998e0ae3d 100644 --- a/docs/motif/todo.txt +++ b/docs/motif/todo.txt @@ -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 diff --git a/samples/nativdlg/makefile.unx b/samples/nativdlg/makefile.unx index 1967b5e242..464c4b45d6 100644 --- a/samples/nativdlg/makefile.unx +++ b/samples/nativdlg/makefile.unx @@ -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 diff --git a/src/gtk/dataobj.cpp b/src/gtk/dataobj.cpp index 6f8a442e14..331a728254 100644 --- a/src/gtk/dataobj.cpp +++ b/src/gtk/dataobj.cpp @@ -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; } diff --git a/src/gtk1/dataobj.cpp b/src/gtk1/dataobj.cpp index 6f8a442e14..331a728254 100644 --- a/src/gtk1/dataobj.cpp +++ b/src/gtk1/dataobj.cpp @@ -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; } diff --git a/src/makelib.env b/src/makelib.env new file mode 100644 index 0000000000..9b320bcd8b --- /dev/null +++ b/src/makelib.env @@ -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 diff --git a/src/makeprog.env b/src/makeprog.env index fa6e4884bf..d0d653795e 100644 --- a/src/makeprog.env +++ b/src/makeprog.env @@ -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) diff --git a/utils/glcanvas/motif/glcanvas.cpp b/utils/glcanvas/motif/glcanvas.cpp new file mode 100644 index 0000000000..0933fb73bf --- /dev/null +++ b/utils/glcanvas/motif/glcanvas.cpp @@ -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 +#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); + } + } +} + diff --git a/utils/glcanvas/motif/glcanvas.h b/utils/glcanvas/motif/glcanvas.h new file mode 100644 index 0000000000..ee4afde5fc --- /dev/null +++ b/utils/glcanvas/motif/glcanvas.h @@ -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 + +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_ diff --git a/utils/glcanvas/motif/makefile.unx b/utils/glcanvas/motif/makefile.unx new file mode 100644 index 0000000000..90090c9ea2 --- /dev/null +++ b/utils/glcanvas/motif/makefile.unx @@ -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 + diff --git a/utils/glcanvas/motif/readme.txt b/utils/glcanvas/motif/readme.txt new file mode 100644 index 0000000000..5771811049 --- /dev/null +++ b/utils/glcanvas/motif/readme.txt @@ -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) diff --git a/utils/glcanvas/samples/isosurf/isosurf.cpp b/utils/glcanvas/samples/isosurf/isosurf.cpp index f16ea041c8..fe456fa33d 100644 --- a/utils/glcanvas/samples/isosurf/isosurf.cpp +++ b/utils/glcanvas/samples/isosurf/isosurf.cpp @@ -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(); diff --git a/utils/glcanvas/samples/penguin/penguin.cpp b/utils/glcanvas/samples/penguin/penguin.cpp index e1100c508c..aed5156e5b 100644 --- a/utils/glcanvas/samples/penguin/penguin.cpp +++ b/utils/glcanvas/samples/penguin/penguin.cpp @@ -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(); -- 2.45.2