From ee4c6942b49d6ea13258437466c5735b1ba3ec6a Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sun, 10 Jan 1999 23:28:36 +0000 Subject: [PATCH] Added some makefiles, cured some wxMotif bugs git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1369 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/msw/generic.rsp | 7 ++ docs/bugs.txt | 12 +--- docs/motif/todo.txt | 8 +-- samples/bombs/makefile.unx | 2 +- samples/image/makefile.unx | 17 +++++ samples/notebook/test.cpp | 8 ++- src/common/image.cpp | 15 +++++ src/common/socket.cpp | 7 +- src/generic/sashwin.cpp | 6 +- src/make.env | 4 +- src/motif/frame.cpp | 3 +- src/motif/makefile.unx | 19 +++++- src/png/makefile.unx | 30 +++++++++ src/zlib/makefile.unx | 133 +++++-------------------------------- 14 files changed, 123 insertions(+), 148 deletions(-) create mode 100644 samples/image/makefile.unx create mode 100644 src/png/makefile.unx diff --git a/distrib/msw/generic.rsp b/distrib/msw/generic.rsp index 8febedb3af..290a5fc84d 100644 --- a/distrib/msw/generic.rsp +++ b/distrib/msw/generic.rsp @@ -199,6 +199,7 @@ utils/glcanvas/win/*.xpm utils/glcanvas/win/*.txt utils/glcanvas/win/*.ico utils/glcanvas/win/*.bmp + utils/glcanvas/src/*.h utils/glcanvas/src/*.cpp utils/glcanvas/src/*.def @@ -209,6 +210,12 @@ utils/glcanvas/src/*.xpm utils/glcanvas/src/*.txt utils/glcanvas/src/*.ico utils/glcanvas/src/*.bmp + +utils/glcanvas/motif/*.h +utils/glcanvas/motif/*.cpp +utils/glcanvas/motif/makefile* +utils/glcanvas/motif/*.txt + utils/glcanvas/samples/cube/*.h utils/glcanvas/samples/cube/*.cpp utils/glcanvas/samples/cube/*.def diff --git a/docs/bugs.txt b/docs/bugs.txt index 915dad0712..fad57c2cfe 100644 --- a/docs/bugs.txt +++ b/docs/bugs.txt @@ -10,16 +10,6 @@ wxMSW: wxMotif: -------- -- wxNotebook and property list frame do not appear properly when - first shown. - Workaround: resize the window (manually or programmatically) to - make the window appear. - This also happens with other windows, e.g. the sizer - dialog in the layout sample. - -- wxSashWindow borders aren't repainted properly if the sashtest - sample is exposed (after being under another window). - - If a popup wxMenu is destroyed after its parent window has been destroyed, we get the message "Object XXX does not have windowed ancestor". @@ -33,6 +23,8 @@ wxMotif: - Setting the size of a hidden window may show that window. +- Motif-specific wxImage functions not yet implemented. + General: -------- diff --git a/docs/motif/todo.txt b/docs/motif/todo.txt index 639beb44aa..3eacb1b8c7 100644 --- a/docs/motif/todo.txt +++ b/docs/motif/todo.txt @@ -35,19 +35,19 @@ High Priority painting a tiled bitmap, then a slight flicker might be seen unless X can be persuaded not to repaint the window background by default. -- wxNotebook bug: why doesn't the notebook sample appear until the - user resizes the window again? But it's OK for MDI. Strange. - - wxSpinButton - Miscellaneous events. - Get wxGLCanvas from 1.68 working. +- Implement missing wxImage functions for Motif. + Low Priority ------------ -- Visuals: how to select an appropriate one? +- Visuals: how to select an appropriate one? See Thomas Runge's + visual patch for 1.68 -- should be straightforward to port to 2.0. - Work out why XFreeFont in font.cpp produces a segv. This is currently commented out, which presumably causes a memory leak. diff --git a/samples/bombs/makefile.unx b/samples/bombs/makefile.unx index 340c83b517..118dabbfd4 100644 --- a/samples/bombs/makefile.unx +++ b/samples/bombs/makefile.unx @@ -13,5 +13,5 @@ PROGRAM=bombs OBJECTS = bombs.o bombs1.o game.o -include ../../../src/makeprog.env +include ../../src/makeprog.env diff --git a/samples/image/makefile.unx b/samples/image/makefile.unx new file mode 100644 index 0000000000..361235090f --- /dev/null +++ b/samples/image/makefile.unx @@ -0,0 +1,17 @@ +# +# File: makefile.unx +# Author: Julian Smart +# Created: 1998 +# Updated: +# Copyright: (c) 1998 Julian Smart +# +# "%W% %G%" +# +# Makefile for image example (UNIX). + +PROGRAM=image + +OBJECTS=$(PROGRAM).o + +include ../../src/makeprog.env + diff --git a/samples/notebook/test.cpp b/samples/notebook/test.cpp index 7ee1dfb3e8..4070a935bd 100644 --- a/samples/notebook/test.cpp +++ b/samples/notebook/test.cpp @@ -44,9 +44,11 @@ bool MyApp::OnInit(void) frame = new MyFrame((wxFrame*) NULL, -1, (char *) "Notebook", wxPoint(-1, -1), wxSize(365, 390), wxDEFAULT_FRAME_STYLE); // Problem with generic wxNotebook implementation whereby it doesn't size properly unless - // you set the size again (to a different size than before, since SetSize is optimized) -#if defined(__WXMOTIF__) || defined(__WIN16__) - frame->SetSize(-1, -1, 370, 390); + // you set the size again +#if defined(__WIN16__) + int width, height; + frame->GetSize(& width, & height); + frame->SetSize(-1, -1, width, height); #endif return TRUE; diff --git a/src/common/image.cpp b/src/common/image.cpp index 858a80a0cc..1b8d810a20 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -1542,3 +1542,18 @@ wxImage::wxImage( const wxBitmap &bitmap ) } #endif + +// TODO + +#ifdef __WXMOTIF__ +wxBitmap wxImage::ConvertToBitmap() const +{ + wxFAIL_MSG("Sorry, wxImage::ConvertToBitmap isn't implemented for wxMotif yet."); + return wxNullBitmap; +} + +wxImage::wxImage( const wxBitmap &bitmap ) +{ + wxFAIL_MSG("Sorry, wxImage::wxImage(const wxBitmap&) isn't implemented for wxMotif yet."); +} +#endif diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 0862ac0670..9b7fbe2ecd 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -514,7 +514,12 @@ void wxSocketBase::Discard() // Under glibc 2.0.7, socketbits.h declares socklen_t to be unsigned int // and it uses *socklen_t as the 3rd parameter. Robert. -#ifdef __LINUX__ +// JACS - How can we detect this? +// Meanwhile, if your compiler complains about socklen_t, +// switch lines below. + +#if defined(__LINUX__) +// #if 0 #define wxSOCKET_INT socklen_t #else #define wxSOCKET_INT int diff --git a/src/generic/sashwin.cpp b/src/generic/sashwin.cpp index 831085a907..2553c9f700 100644 --- a/src/generic/sashwin.cpp +++ b/src/generic/sashwin.cpp @@ -96,10 +96,8 @@ void wxSashWindow::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); -#if 0 - if ( m_borderSize > 0 ) - DrawBorders(dc); -#endif + // if ( m_borderSize > 0 ) + DrawBorders(dc); DrawSashes(dc); } diff --git a/src/make.env b/src/make.env index 44017fcc57..4e72c8d2d2 100644 --- a/src/make.env +++ b/src/make.env @@ -101,10 +101,10 @@ stubs: make -f makefile.unx all GUI='-D__WXSTUBS__ -D__LINUX__ -D__UNIX__' GUISUFFIX='_stubs' GUILDLIBS='-lwx_stubs $(COMPLIBS) -lXm -lXmu -lXt -lX11 -lm' motif: - make -f makefile.unx all GUI='-D__WXMOTIF__ -D__LINUX__ -D__UNIX__' GUISUFFIX='_motif' GUILDLIBS='-lwx_motif $(COMPLIBS) -lXm -lXmu -lXt -lXpm -lX11 -lm' + make -f makefile.unx all GUI='-D__WXMOTIF__ -D__LINUX__ -D__UNIX__' GUISUFFIX='_motif' GUILDLIBS='-lwx_motif $(COMPLIBS) -lpng -lzlib -lXm -lXmu -lXt -lXpm -lX11 -lm' gtk: - make -f makefile.unx all GUI='-D__WXGTK__ -D__LINUX__ -D__UNIX__' GUISUFFIX='_gtk' GUILDLIBS='-lwx_gtk2 $(COMPLIBS) -ldl -lgtk -lgdk -lglib -lX11 -lm -pthread' + make -f makefile.unx all GUI='-D__WXGTK__ -D__LINUX__ -D__UNIX__' GUISUFFIX='_gtk' GUILDLIBS='-lwx_gtk2 $(COMPLIBS) -ldl -lgtk -lgdk -lglib -lpng -lzlib -lX11 -lm -pthread' cleanstubs: make -f makefile.unx clean GUI='-D__WXSTUBS__ -D__LINUX__ -D__UNIX__' GUISUFFIX='_stubs' GUILDLIBS='-lwx_stubs $(COMPLIBS) -lXm -lXmu -lXt -lX11 -lm' diff --git a/src/motif/frame.cpp b/src/motif/frame.cpp index d018baa2a2..17b414f5a2 100644 --- a/src/motif/frame.cpp +++ b/src/motif/frame.cpp @@ -479,12 +479,11 @@ void wxFrame::SetSize(int x, int y, int width, int height, int sizeFlags) if (!(height == -1 && width == -1)) { PreResize(); - /* JACS: not sure if this is necessary + wxSizeEvent sizeEvent(wxSize(width, height), GetId()); sizeEvent.SetEventObject(this); GetEventHandler()->ProcessEvent(sizeEvent); - */ } } diff --git a/src/motif/makefile.unx b/src/motif/makefile.unx index 28d029c185..31386a99c3 100644 --- a/src/motif/makefile.unx +++ b/src/motif/makefile.unx @@ -30,6 +30,7 @@ LIB_CPP_SRC=\ ../common/helpbase.cpp \ ../common/intl.cpp \ ../common/ipcbase.cpp \ + ../common/image.cpp \ ../common/layout.cpp \ ../common/list.cpp \ ../common/log.cpp \ @@ -180,7 +181,7 @@ LIB_C_SRC=\ # already have a zlib library installed on our system # (or we wish to statically link them for some reason) EXTRA_C_SRC=\ - xmcombo/xmcombo.c # $(ZLIB_SRC) + xmcombo/xmcombo.c EXTRA_CPP_SRC=\ @@ -192,7 +193,7 @@ EXTRA_CPP_SRC=\ # mdi/lib/XsOutline.C\ # mdi/lib/XsResizeOutline.C -all: $(WXLIB) +all: $(WXLIB) png zlib # Define library objects OBJECTS=\ @@ -224,6 +225,18 @@ $(WXLIB) : $(OBJECTS) combobox/combobox.o: combobox/combobox.c $(CCC) -c $(CFLAGS) -o $@ combobox/combobox.c -clean: +zlib: + cd ../zlib; make -f makefile.unx motif + +png: + cd ../png; make -f makefile.unx motif + +clean: cleanzlib cleanpng rm -f $(OBJECTS) $(WXLIB) +cleanzlib: + cd ../zlib; make -f makefile.unx cleanmotif + +cleanpng: + cd ../png; make -f makefile.unx cleanmotif + diff --git a/src/png/makefile.unx b/src/png/makefile.unx new file mode 100644 index 0000000000..095d6eaf0a --- /dev/null +++ b/src/png/makefile.unx @@ -0,0 +1,30 @@ +# +# File: makefile.unx +# Author: Julian Smart +# Created: 1998 +# Updated: +# Copyright: (c) 1998 +# +# +# Makefile for PNG library, Unix + +include ../make.env + +TARGETLIB=../../lib/libpng.a + +LIB_C_SRC = png.c pngread.c pngrtran.c pngrutil.c \ + pngpread.c pngtrans.c pngwrite.c pngwtran.c pngwutil.c \ + pngerror.c pngmem.c pngwio.c pngrio.c pngget.c pngset.c + +all: $(TARGETLIB) + +# Define library objects +OBJECTS=\ + $(LIB_C_SRC:.c=.o) + +$(TARGETLIB) : $(OBJECTS) + ar $(AROPTIONS) $@ $(OBJECTS) + $(RANLIB) $@ + +clean: + rm -f $(OBJECTS) $(TARGETLIB) diff --git a/src/zlib/makefile.unx b/src/zlib/makefile.unx index 7062ba8ec8..5dc486830e 100644 --- a/src/zlib/makefile.unx +++ b/src/zlib/makefile.unx @@ -1,133 +1,30 @@ # # File: makefile.unx # Author: Julian Smart -# Created: 1993 +# Created: 1998 # Updated: -# Copyright: (c) 1993, AIAI, University of Edinburgh +# Copyright: (c) 1998 # -# "%W% %G%" # -# Makefile for tree library and example (UNIX). -# Change the WXDIR directory, and CPPFLAGS and LDFLAGS, for your system. +# Makefile for PNG library, Unix -WXDIR = ../.. +include ../make.env -# All common UNIX compiler flags and options are now in -# this central makefile. -include $(WXDIR)/src/make.env +TARGETLIB=../../lib/libzlib.a -ZLIBDIR = $(WXDIR)/utils/zlib -ZLIBLIB = $(WXDIR)/lib/libzlib$(GUISUFFIX).a +LIB_C_SRC = adler32.c compress.c crc32.c gzio.c uncompr.c deflate.c \ + trees.c zutil.c inflate.c infblock.c inftrees.c infcodes.c \ + infutil.c inffast.c -SOURCES = adler32.c deflate.c infblock.c inflate.c zutil.c compress.c \ - infcodes.c inftrees.c trees.c \ - crc32.c gzio.c inffast.c infutil.c uncompr.c -OBJECTS = $(OBJDIR)/adler32.$(OBJSUFF) $(OBJDIR)/deflate.$(OBJSUFF) \ - $(OBJDIR)/infblock.$(OBJSUFF) $(OBJDIR)/inflate.$(OBJSUFF) \ - $(OBJDIR)/zutil.$(OBJSUFF) $(OBJDIR)/trees.$(OBJSUFF) \ - $(OBJDIR)/compress.$(OBJSUFF) $(OBJDIR)/infcodes.$(OBJSUFF) \ - $(OBJDIR)/inftrees.$(OBJSUFF) $(OBJDIR)/crc32.$(OBJSUFF) \ - $(OBJDIR)/gzio.$(OBJSUFF) $(OBJDIR)/inffast.$(OBJSUFF) \ - $(OBJDIR)/infutil.$(OBJSUFF) $(OBJDIR)/uncompr.$(OBJSUFF) +all: $(TARGETLIB) -# Default +# Define library objects +OBJECTS=\ + $(LIB_C_SRC:.c=.o) -.SUFFIXES: - -all: $(OBJDIR) $(ZLIBLIB) - -demo: - -$(ZLIBLIB): $(OBJECTS) - rm -f $@ +$(TARGETLIB) : $(OBJECTS) ar $(AROPTIONS) $@ $(OBJECTS) $(RANLIB) $@ -motif: - $(MAKE) -f makefile.unx GUISUFFIX=_motif GUI=-Dwx_motif GUISUFFIX=_motif DEBUG='$(DEBUG)' OPT='$(OPT)' LDLIBS='$(MOTIFLDLIBS)' XVIEW_LINK= - -xview: - $(MAKE) -f makefile.unx GUI=-Dwx_xview GUISUFFIX=_ol OPT='$(OPT)' DEBUG='$(DEBUG)' - -demo_motif: - $(MAKE) -f makefile.unx all test_motif GUI=-Dwx_motif GUISUFFIX=_motif DEBUG='$(DEBUG)' OPT='$(OPT)' LDLIBS='$(MOTIFLDLIBS)' XVIEW_LINK= - -demo_ol: - cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx xview OPT='$(OPT)' DEBUG='$(DEBUG)' - $(MAKE) -f makefile.unx all test_ol GUI=-Dwx_xview OPT='$(OPT)' DEBUG='$(DEBUG)' - -hp: - $(MAKE) -f makefile.unx GUI=-Dwx_motif GUISUFFIX=_hp CC=CC DEBUG='$(DEBUG)' DEBUGFLAGS='-g' OPT='' WARN='-w' \ - XINCLUDE='$(HPXINCLUDE)' XLIB='$(HPXLIB)' XVIEW_LINK='' CCLEX='cc' \ - LDLIBS='$(HPLDLIBS)' - -demo_hp: - $(MAKE) -f makefile.unx all test_hp GUI=-Dwx_motif GUISUFFIX=_hp CC=CC DEBUG='$(DEBUG)' DEBUGFLAGS='-g' OPT='' WARN='-w' \ - XINCLUDE='$(HPXINCLUDE)' XLIB='$(HPXLIB)' XVIEW_LINK='' CCLEX='cc' \ - LDLIBS='$(HPLDLIBS)' - -$(OBJDIR): - mkdir $(OBJDIR) - -$(OBJDIR)/adler32.$(OBJSUFF): adler32.c - $(CC) -c $(CPPFLAGS) -o $@ adler32.c - -$(OBJDIR)/deflate.$(OBJSUFF): deflate.c - $(CC) -c $(CPPFLAGS) -o $@ deflate.c - -$(OBJDIR)/infblock.$(OBJSUFF): infblock.c - $(CC) -c $(CPPFLAGS) -o $@ infblock.c - -$(OBJDIR)/inflate.$(OBJSUFF): inflate.c - $(CC) -c $(CPPFLAGS) -o $@ inflate.c - -$(OBJDIR)/zutil.$(OBJSUFF): zutil.c - $(CC) -c $(CPPFLAGS) -o $@ zutil.c - -$(OBJDIR)/compress.$(OBJSUFF): compress.c - $(CC) -c $(CPPFLAGS) -o $@ compress.c - -$(OBJDIR)/infcodes.$(OBJSUFF): infcodes.c - $(CC) -c $(CPPFLAGS) -o $@ infcodes.c - -$(OBJDIR)/inftrees.$(OBJSUFF): inftrees.c - $(CC) -c $(CPPFLAGS) -o $@ inftrees.c - -$(OBJDIR)/trees.$(OBJSUFF): trees.c - $(CC) -c $(CPPFLAGS) -o $@ trees.c - -$(OBJDIR)/crc32.$(OBJSUFF): crc32.c - $(CC) -c $(CPPFLAGS) -o $@ crc32.c - -$(OBJDIR)/gzio.$(OBJSUFF): gzio.c - $(CC) -c $(CPPFLAGS) -o $@ gzio.c - -$(OBJDIR)/inffast.$(OBJSUFF): inffast.c - $(CC) -c $(CPPFLAGS) -o $@ inffast.c - -$(OBJDIR)/infutil.$(OBJSUFF): infutil.c - $(CC) -c $(CPPFLAGS) -o $@ infutil.c - -$(OBJDIR)/uncompr.$(OBJSUFF): uncompr.c - $(CC) -c $(CPPFLAGS) -o $@ uncompr.c - -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) $(OBJDIR)/*.$(OBJSUFF) $(ZLIBLIB) 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 +clean: + rm -f $(OBJECTS) $(TARGETLIB) -- 2.47.2