From 53fcfae9cbd78186fb0d35b1e2cd8bccba9f1602 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Tue, 20 Oct 1998 16:41:24 +0000 Subject: Updated autoconf files to support shared libraries and JPEG library. Updated README files. Removed old files. git-svn-id: file:///fltk/svn/fltk/trunk@24 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Enumerations.H | 22 +++- GL/glut.h | 31 ++++- README | 366 ++++++++++++++++++++++++++++++++++++++++-------------- README.win32 | 199 +++++++++++++++++++++++++++++ configh.in | 144 +++++++++++++++++---- configure.in | 113 +++++++++++------ makedist | 26 ---- makeinclude.in | 46 +++++-- version | 2 - visualc/README | 198 ----------------------------- visualc/config.h | 2 +- 11 files changed, 752 insertions(+), 397 deletions(-) create mode 100644 README.win32 delete mode 100755 makedist delete mode 100644 version delete mode 100644 visualc/README diff --git a/FL/Enumerations.H b/FL/Enumerations.H index 335cf21f1..64153ee63 100644 --- a/FL/Enumerations.H +++ b/FL/Enumerations.H @@ -26,7 +26,25 @@ #ifndef Fl_Enumerations_H #define Fl_Enumerations_H -const double FL_VERSION = 0.99; +// +// The FLTK version number; this is changed slightly from the beta versions +// because the old "const double" definition would not allow for conditional +// compilation... +// +// FL_VERSION is a double that describes the major and minor version numbers. +// Version 1.1 is actually stored as 1.01 to allow for more than 9 minor +// releases. +// +// The FL_MAJOR_VERSION, FL_MINOR_VERSION, and FL_PATCH_VERSION constants +// give the integral values for the major, minor, and patch releases +// respectively. +// + +#define FL_MAJOR_VERSION 1 +#define FL_MINOR_VERSION 0 +#define FL_PATCH_VERSION 0 +#define FL_VERSION ((double)FL_MAJOR_VERSION + \ + (double)FL_MINOR_VERSION * 0.01) typedef unsigned char uchar; typedef unsigned long ulong; @@ -327,5 +345,5 @@ enum Fl_Mode { // visual types and Fl_Gl_Window::mode() (values match Glut) #endif // -// End of "$Id: Enumerations.H,v 1.3 1998/10/19 21:38:25 mike Exp $". +// End of "$Id: Enumerations.H,v 1.4 1998/10/20 16:41:21 mike Exp $". // diff --git a/GL/glut.h b/GL/glut.h index 367bf8929..2acd86f98 100644 --- a/GL/glut.h +++ b/GL/glut.h @@ -1,3 +1,30 @@ -// this file allows some glut programs to be compiled with no change. -// Put this in a directory "GL" in your include path. +// +// "$Id" +// +// GLUT compatibility header for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998 by Bill Spitzak and others. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. +// +// This library 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 +// Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA. +// +// Please report all bugs and problems to "fltk-bugs@easysw.com". +// + #include + +// +// End of "$Id: glut.h,v 1.2 1998/10/20 16:41:22 mike Exp $". +// diff --git a/README b/README index 04ce612f6..be44883f6 100644 --- a/README +++ b/README @@ -1,123 +1,307 @@ -Fast Light Tool Kit (fltk) Version 0.99 +README - Fast Light Tool Kit (FLTK) Version 1.0 +----------------------------------------------- ----------------------------------------------------------------- -How to build and install fltk: ----------------------------------------------------------------- +WHAT IS FLTK? -See the file win32/README for information for Windoze95/NT. + FLTK (pronounced "fulltick") is a LGPL'd C++ graphical user + interface toolkit for X (UNIX(r)), OpenGL, and WIN32 (Microsoft(r) + Windows(r) NT 4.0, 95, or 98). It is currently maintained by a small + group of developers across the world with a central repository in + the US. -1. Type "./configure", and then examine config.h and makeinclude. -1. Edit the file ./style.h to customize the appearance of fltk -3. Type "make", or (Linux and gcc only) type "make shared" to make - a shared library. -4. For shared libraries, type "setenv LD_LIBRARY_PATH $PWD/lib" -5. Test it by running "test/demo". + FLTK was originally created to build in-house applications at + Digital Domain for image processing and 3D graphics. The original + author, Bill Spitzak, received permission from Digital Domain to + release it to the public domain in the hopes that it could be used + to make better, faster, and nicer-looking UNIX programs. Digital + Domain has since withdrawn support for FLTK, and Bill is no longer + able to actively develop it. -To install the new version of Fltk and fluid (this puts the library in -/usr/local/lib, the include files in /usr/local/include/FL, and fluid -into /usr/local/bin): -1. If you made the shared version, type "unsetenv LD_LIBRARY_PATH" -2. Type "su" and then your password -3. Type "make install" -4. If you made the shared version, type "/sbin/ldconfig" -5. Type ^D to get out of su. +FEATURES ----------------------------------------------------------------- -On-line documentation: ----------------------------------------------------------------- + FLTK was designed to be statically linked. This was done by + splitting it into many small objects and desigining it so that + functions that are not used do not have pointers to them in the + parts that are used, and thus do not get linked in. This allows you + to make an easy-to-install program, or to modify FLTK to the exact + requirements of your appli- cation, without worrying about bloat. + FLTK works fine as a shared library, though, and has started being + included on Linux distribu- tions. -All the documentation is in html in the subdirectory "documentation". -Use file:/documentation/index.html to get started. Install -should put the documentation in /usr/doc/fltk but this is not yet -implemented. + Here are some of the core features unique to FLTK: -These files are readable without a browser: + - sizeof(Fl_Widget) == 48. -Change log is in documentation/CHANGES -To Do list is in documentatoin/TODO.html + - The "core" (the "hello" program compiled & linked with a + static FLTK library using gcc on a 486 and then stripped) is + 39.5K. ----------------------------------------------------------------- -WWW resources: ----------------------------------------------------------------- + - A program including every widget is less than 108K. Does not + use macros, templates, multiple inheritance, or exceptions. -The Fltk home page: http://www.cinenet.net/users/spitzak/fltk + - Written directly atop Xlib (or the WIN32 API) for maximum + speed, and carefully optimized for code size and + performance. -Mirror site: http://fltk.easysw.com + - Precise low-level compatability between the X and Windows + version (only about 10% of the code is different). -To post to the fltk mailing list: fltk@easysw.com + - Interactive user interface builder program. Output is human- + readable and editable C++ source code. -To subscribe, send "subscribe fltk" to majordomo@easysw.com + - Support for the X double buffering extension (emulation if + not available and under Windows.) -Send mail to Bill Spitzak (the author of fltk): spitzak@d2.com + - Support for X overlay hardware (emulation if none and under + Windows.) -Get Mesa (necessary to run OpenGl on most Linux machines): - http://www.ssec.wisc.edu/~brianp/Mesa.html + - Very small & fast portable 2-D drawing library to hide Xlib + and WIN32. ----------------------------------------------------------------- -Window managers ----------------------------------------------------------------- + - OpenGL/Mesa drawing area widget. -Fltk now uses X transient windows for modal() windows. This may -confuse some window managers. Mostly it causes them to not put -any borders on the modal windows and prevent you from moving them. + - Support for OpenGL overlay hardware on both X and Windows. + Emulation if none. -For FVWM I recommend you put "DecorateTransients" into your .fvwmrc. + - Text input fields with Emacs key bindings, X cut & paste, and + foreign letter compose! ----------------------------------------------------------------- -Mesa: ----------------------------------------------------------------- + - Compatability header file for the Glut library. -Currently the best way to get OpenGL on your Linux system is to use -Mesa. Fltk has been tested with Mesa on several machines (and also -with "real" OpenGL on SGI machines). + - Compatability header file for the XForms library. -Mesa is at: http://www.ssec.wisc.edu/~brianp/Mesa.html + - Much too much to list here... -./configure will not see Mesa unless it is installed as either libGL -or libMesa. If you don't want to do this you will have to edit -config.h (set HAVE_GL to 1) and makeinclude (add the libraries). ----------------------------------------------------------------- -How to write programs that use Fltk: ----------------------------------------------------------------- +LICENSING -The proper way to include Fltk header files is "#include ". -If Fltk is installed this will work without switches. If not you will -need to provide a -I switch pointing to this directory (all the -headers are in ./FL). + FLTK comes with complete free source code. FLTK is available under + the terms of the GNU Library General Public License. Contrary to + popular belief, it can be used in commercial software! (Even Bill + Gates could use it.) -Linker switches will be something like "-lfltk -L/usr/X11R6/lib -lX11". -Some programs may require -lXext or -lm. If Fltk is not installed you -will need to add a -L switch pointing at ./lib. -If you wish to distribute a program (in source form) that uses Fltk, -you are allowed by the license to directly include the portions of -Fltk that you need. This may make it easier for a user to compile -your program since they don't need to install the library. Please -provide instructions for the user on how they can get the entire -source of Fltk. +WHAT DOES "FLTK" MEAN? -If you wish to distribute a compiled program without source code: this -is allowed. See the license. + FLTK was originally designed to be compatable with the Forms + Library written for SGI machines. In that library all the functions + and structures started with "fl_". This naming was extended to all + new methods and widgets in the C++ library, and this prefix was + taken as the name of the library. It is almost impossible to search + for "FL" on the Internet, due to the fact that it is also the + abbreviation for Florida. After much debating and searching for a + new name for the toolkit, which was already in use by several + people, Bill came up with "FLTK", and even a bogus excuse that it + stands for "The Fast Light Tool Kit". ----------------------------------------------------------------- -Copyright (C) 1998 Bill Spitzak ----------------------------------------------------------------- -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. -This library 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 -Library General Public License for more details. +BUILDING AND INSTALLING FLTK UNDER UNIX -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -USA. + FLTK uses GNU autoconf to configure itself for your UNIX platform. + If you aren't using UNIX then you'll need to configure things + differently. See below for other operating system configurations. -Written by Bill Spitzak spitzak@d2.com ----------------------------------------------------------------- + Before you configure FLTK you'll want to make sure your environment + is setup properly. Some variables of note are: + + CC - C compiler to use + CFLAGS - C compiler options + + CXX - C++ compiler to use + CXXFLAGS - C++ compiler options + + LDFLAGS - Linker options + LIBS - Linker libraries + + The main things that the configure script will look for are the + X11, OpenGL (or Mesa), and JPEG header and library files. Make + sure that they are in the standard include/library locations, and + if not define one or more of the environment variables listed + above. + + Once you have everything ready you can run the "configure" script + located in this directory. The "--enable-windows-style" option to + configure will make the FLTK widgets look more like their Microsoft + Windows counterparts. Other options include: + + --enable-debug - Enable debugging code & symbols + --enable-shared - Enable generation of shared libraries + --enable-windows-style - Enable the Microsoft Windows "look-n-feel" + + --bindir=/path - Set the location for executables + [default = /usr/local/bin] + --libdir=/path - Set the location for libraries + [default = /usr/local/lib] + --includedir=/path - Set the location for include files. + [default = /usr/local/include] + --prefix=/dir - Set the directory prefix for files + [default = /usr/local] + + When the configure script is done you can just run the "make" + command. This will build the library, FLUID tool, and all of the + test programs. + + To install the library, become root and type "make install". This + will copy the "fluid" executable to "bindir", the header files to + "includedir", and the library files to "libdir". + + +BUILDING FLTK UNDER MICROSOFT WINDOWS + + There are two ways to build FLTK under Microsoft Windows. The + first is to use the 5.0 project files under the "visualc" + directory. Just open (or double-click on) the "fltk.dsw" file to + get the whole shebang. + + The second method is to use a GNU-based development tool with the + files in the "makefiles" directory. To build using one of these + tools simply copy the appropriate makeinclude and config files to + the main directory and do a make: + + cp makefiles/makeinclude. makeinclude + cp makefiles/config. config.h + make + + +BUILDING FLTK UNDER OS/2 + + The current OS/2 build requires XFree86 for OS/2 to work. A native + Presentation Manager version has not been implemented yet + (volunteers are welcome!). + + To build the XFree86 version of FLTK for OS/2, copy the appropriate + makeinclude and config files to the main directory and do a make: + + cp makefiles/makeinclude.os2x makeinclude + cp makefiles/config.os2x config.h + make + + +ON-LINE DOCUMENTATION + + All of the documentation is in HTML in the subdirectory + "documentation". The "index.html" file should be your starting + point. + + +INTERNET RESOURCES + + FLTK is available on the 'net in a bunch of locations: + + - WWW: http://fltk.easysw.com + + - FTP: ftp://ftp.easysw.com/pub/fltk + ftp://ftp.funet.fi/mirrors/ftp.easysw.com/pub/fltk + + - EMail: fltk@easysw.com [see instructions below] + fltk-bugs@easysw.com [for reporting bugs] + + To send a message to the FLTK mailing list ("fltk@easysw.com") you + must first join the list. Non-member submissions are blocked to + avoid problems with SPAM... + + To join the FLTK mailing list, send a message to + "majordomo@easysw.com" with "subscribe fltk" in the message body. + A digest of this list is available by subscribing to the + "fltk-digest" mailing list. + + +REPORTING BUGS + + To report a bug in FLTK, send an email to "fltk-bugs@easysw.com". + Please include the FLTK version, operating system & version, and + compiler that you are using when describing the bug or problem. + + For general support and questions, please use the FLTK mailing + list at "fltk@easysw.com". + + +WINDOW MANAGERS + + FLTK now uses X transient windows for modal() windows. This may + confuse some window managers. Mostly it causes them to not put any + borders on the modal windows and prevent you from moving them. + + For FVWM I recommend you put "DecorateTransients" into your + ~/.fvwmrc file. + + +MESA + + Currently the best way to get OpenGL on your Linux system is to use + Mesa. FLTK has been tested with Mesa on several machines (and also + with "real" OpenGL on SGI machines). + + Mesa is available at "http://www.ssec.wisc.edu/~brianp/Mesa.html". + + The configure script will not see Mesa unless it is installed as + either libGL or libMesa. If you don't want to do this you will + have to edit config.h (set HAVE_GL to 1) and makeinclude (add the + libraries). + + +HOW TO WRITE PROGRAMS THAT USE FLTK + + The proper way to include FLTK header files is "#include + ". If FLTK is installed this will work without + switches. If not you will need to provide a "-Idir" switch + pointing to this directory (all the headers are in ./FL). + + Windows developers please note: case *is* significant under other + operating systems, and the C standard uses the forward slash (/) to + separate directories. The following #include directives are *not* + recommended for portability reasons: + + #include + #include + #include + + Linker switches will be something like "-lfltk -L/usr/X11R6/lib + -lX11". Some programs may require "-lXext" or "-lm". If FLTK is + not installed you will need to add a "-Ldir" switch pointing at + ./lib. + + If you wish to distribute a program (in source form) that uses + FLTK, you are allowed by the license to directly include the + portions of FLTK that you need. This may make it easier for a user + to compile your program since they don't need to install the + library. Please provide instructions for the user on how they can + get the entire source of FLTK. + + If you wish to distribute a compiled program without source code, + this is allowed also. See the file "COPYING" for details. + + +TRADEMARKS + + Microsoft and Windows are registered trademarks of Microsoft + Corportation. UNIX is a registered trademark of the X/Open Group, + Inc. + + +COPYRIGHT + + FLTK is copyright 1998 by Bill Spitzak (spitzak@d2.com) and others, + including: + + Curtis Edwards (curtise@fa.disney.com) + Gustavo Hime (hime@centroin.com.br) + Vincent Penne (vincent.penne@infonie.fr) + Michael Sweet (mike@easysw.com) + Carl Thompson (clip@home.net) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License + as published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA. diff --git a/README.win32 b/README.win32 new file mode 100644 index 000000000..7d5ac40c3 --- /dev/null +++ b/README.win32 @@ -0,0 +1,199 @@ +README.win32 - How to compile for Windows +----------------------------------------- + +Fltk has been reported to compile with GNU GCC compilers, with +MicroSoft Visual C++ version 4 and 5, and with Borland's C++ compiler +(sorry no info on that here). + +---------------------------------------------------------------- +Using GNU C compilers (MingW32 and/or Cygnus): +---------------------------------------------------------------- + +Edited from mail from Carl Thompson: + +MINGW32 and Cygnus are both ports of the GNU compiler to win32. The +difference is that Cygnus will emulate a complete Unix development +environment including nearly all of the standard Unix system calls. This +allows Unix programs to be ported to win32 possibly without changing a +single line of source code. However, the applications it generates are big, +very slow, depend on the Cygnus DLL, and currently somewhat unstable. For +straight Windows applications / Libraries like FLTK that do not require Unix +system call emulation, MINGW32 is the superior choice. MINGW32 produces a +plain Windows binary that is only dependent on the normal Windows DLLs. + +Some links for getting MINGW32: + +http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32/download.html +http://www.cygnus.com/misc/gnu-win32/index.html +ftp://objectcentral.com/mingw32 + +You will of course need GNU make for MINGW32 in addition to the regular +MINGW32 utilities. You also need the OpenGL header files which +apparently are not always included with mingw32, get them from the +above ftp site. + +More instructions from Rick Sayre (at Pixar): + +BTW, for what it's worth, here's the list of changes I have to make to get +fltk and the examples to build under MINGW32 (which I've switched to from +CYGWIN, since programs compiled under it use standard DLL's rather than the +extremely bugging cygwin.dll, and it just otherwise seems to work better): + +Run ./configure +- +In makeinclude - change the CFLAGS and CXXFLAGS to add "-O2 -DWIN32" +change the libraries to "-lgdi32 -luser32" (add "-mwindows" to not get +a console) +- +In config.h - set HAVE_SCANDIR to 0. ./configure seems to do this +correctly now, but it was occasionally in the past setting it to 1 +- +in src/Makefile: + change the "ar" command to use the "ar -M < ar.script" form. This +is needed only because I compile under Cygwin's B19 bash, which blows up in +all sorts of bad ways (hard resets[!]) on long command lines. More details +if you care, but most people might not. Just a warning. +- +in test/demo.menu + Change the paths to DOS form [blech!], don't use "&" +[A better idea would be to replace system() with a call that knows how +to fake a fork on Winblows] +- +in fluid/Makefile +Change the make install rules to reference "fluid.exe" for installing and +strip'ing, rather than "fluid" + +I suspect that it is very likely not a good idea to try "make install" under +Windows. Instead, copy "libfltk.a" to "C:\MINGW32\LIB" (replace +"C:\MINGW32" with the directory in which you installed MINGW32). Then copy +the entire "FL" directory to "C:\MINGW32\INCLUDE". + +From Gustavo Hime: + +First, thank you for the nice piece of software, and congratulations +on the quality source code. Fltk compiles (and runs) beautifully on +all the systems I use (Irix 6.4,Solaris 2.5, RedHat Linux 5.0): the +exception was Windows, where compilation was rather hard. + +I have just now managed to compile (satisfactorily) fltk on Win95 +using Mingw32: I do not have MSVC (I don't believe in Microsoft +compilers :)), and we (the project I am engaged in) are going to use +mingw32 to port unix code to windows anyway, so mingw32 was the way to +go. Here is a list of what I had to do: + +Modify ar -mwindows to ar -ruv in your makeinclude.mingw32. + +Added -DCYGNUS to your *FLAGS variables (I am new to mingw32, I don't +know what it defines to id itself, but they are so close I don't think +it matters much). + +Disable GL overlay in win32/config.h (shouldn't this be the default?). + +Added dummy makedepend files to directories fluid and src. + +Created empty lib directory. + +Fixed scroll.C line 83 (implicit typecast from int to const char * in +function call, mingw32 has a problem with this) + +Did not fix list_visuals.C (weird code there, where is the main +functionfor win32?) + +And finally, the hardest: downloaded the OpenGL headers for mingw32 +fromftp://objectcentral.com/mingw32. These are not included in the +mingw32 distribution, and it took me a couple of hours to find them on +the net. It would be nice to add a note about this in the fltk +documentation, and I'll send an e-mail asking them to add these +headers to the mingw32 distribution. + +Once again, great code. With mingw32, fltk and opengl, I can +imediatellyport all my old windows code to unix, and I no longer need +to waste 300+ mb of hard-drive on stupid borland compilers. + +---------------------------------------------------------------- +Using MSVC++: +---------------------------------------------------------------- + +If you have MSVC++ 5.0, double click the "fltk.dsw". Make the "fltk" +project current, and build it. This will create the library in +../lib/fltkd.lib. To build the demo programs, select the "demo" +project and build it. To run the demos run the demo project. + +I only have Pentium and Alpha NT machines running MSVC++ 5.0. Other +users have reported success compiling fltk on Windowe95, and using +version 4 of MSVC++, Borland's C++ compiler, and various ports of GCC +to windows (to use these, look at the "makeinclude" files in +../makefiles). + +If you want to make non-console apps you have to do something special, +and that differs on each compiler/linker package. For MSVC++ the +secret switch is: + + /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup + +For cygwin/mingw32 and perhaps some other compilers based on gcc put +this in the makeinclude file: + + LDLIBS =-lgdi32 -luser32 -mwindows + +There are no makefiles, for MSVC++ or any other compiler, because I +don't know how to write them (the ones dumped by MSVC++ are useless +and unreadable). + +---------------------------------------------------------------- +Other compilers: +---------------------------------------------------------------- + +I have heard that Borland C++ is usable. + +You probably need to start with the Unix Makefiles. There is one in +../src, one in ../fluid, and one in ../test. Edit these as necessary +and compile. You must add "-DWIN32" to your compiler switches. + +The biggest problem seems to be differences in the windows.h header +files (MicroSoft copyrighted theirs?). Some functions and macros have +different names or are missing. + +The MSVC++ "makefiles" are totally useless. Ignore that crap. + +Start with the Unix makefiles, which list all the necessary source +files. Don't try to compile the files ending in _win32.C, they are +#included by other files if WIN32 is defined. + +When compiling the symbol WIN32 must be defined (most compilers do +this?) and you have to set the include path so the file win32/config.h +is seen when the code does #include . You may need to use +some sort of switch to force the compiler to compile the files with +C++ rather than C. On MSVC++ this is the obvious acronym "/TP" :-) +Not doing these steps will result in lots of cryptic errors. + +---------------------------------------------------------------- +Known problems and ToDo list: +---------------------------------------------------------------- + +It does not work if you turn on full optimizations in VC++. I have +been told this is due to bugs in VC++, but if anybody can find a way +around them it would be nice... (the "optimize" settings in the +project files only do partial optimization and work ok). + +If program is deactivated, Fl::wait() does not return until it is +activated again, even though things happen, like redraws. This could +break some programs that rely on executing code after Fl::wait(). + +Fl_Gl_Window::can_do_overlay() returns true until the first time it +attempts to draw an overlay, and then correctly returns whether or not +there is overlay hardware. + +Cut text contains ^J rather than ^M^J to break lines. This is a +feature, not a bug. + +Fl_Window::fullscreen() not implemented (should take over the screen +without a title bar). Currently does maximize instead. + +Reports of clipping problems on '95. Can't reproduce on NT. + +Need to import .bmp files into fluid. Wonko has the specs. + +Can't set icon of windows. + +Transparent parts of pixmaps do not really work. diff --git a/configh.in b/configh.in index 0ff8d77a5..b6149c6d7 100644 --- a/configh.in +++ b/configh.in @@ -1,53 +1,145 @@ -/* configh.in: this file is read by ./configure to produce config.h */ +/* + * "$Id" + * + * Configuration file for the Fast Light Tool Kit (FLTK). + * + * THIS FILE IS READ BY CONFIGURE TO PRODUCE A PLATFORM-SPECIFIC CONFIG.H + * FILE. EDIT ONLY IF YOU CAN'T RUN CONFIGURE! + * + * Copyright 1998 by Bill Spitzak and others. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + * + * Please report all bugs and problems to "FLTK-bugs@easysw.com". + */ + +/* + * BORDER_WIDTH: + * + * Thickness of FL_UP_BOX and FL_DOWN_BOX. Current 1,2, and 3 are + * supported. 3 is the historic FLTK look. 2 looks more like Microsoft + * Windows, KDE, and Qt, and is the default when building for Windows. + * 1 is a plausible future evolution... Note that this may be simulated + * at runtime by redefining the boxtypes using Fl::set_boxtype(). + */ -/* Thickness of FL_UP_BOX and FL_DOWN_BOX. Current 1,2, and 3 are - supported. 3 is the historic fltk look. 2 looks more like windoze - (and KDE and Qt). 1 is a plausible future evolution... Notice - that this may be simulated at runtime by redefining the boxtypes - using Fl::set_boxtype() */ #define BORDER_WIDTH 3 -/* Do you have OpenGL? - Set this to 0 if you don't plan to use OpenGL, and fltk will be smaller */ +/* + * HAVE_GL: + * + * Do you have OpenGL? Set this to 0 if you don't have or plan to use + * OpenGL, and FLTK will be smaller. + */ + #define HAVE_GL 0 -/* Use XAllocColor - Setting this to zero will save a good deal of code (esp for - fl_draw_image), but fltk will only work on TrueColor visuals. */ +/* + * USE_COLORMAP: + * + * Setting this to zero will save a good deal of code (especially for + * fl_draw_image), but FLTK will only work on TrueColor visuals. + */ + #define USE_COLORMAP 1 -/* Do we have the X double-buffer extension? */ +/* + * HAVE_XDBE: + * + * Do we have the X double-buffer extension? + */ + #define HAVE_XDBE 0 -/* Actually try to use the double-buffer extension? - Set this to zero disable use of XDBE without breaking the - list_visuals program: */ +/* + * USE_XDBE: + * + * Actually try to use the double-buffer extension? Set this to zero + * disable use of XDBE without breaking the list_visuals program. + */ + #define USE_XDBE HAVE_XDBE -/* Use the X overlay extension? Fltk will try to use an overlay - visual for Fl_Overlay_Window, the Gl_Window overlay, and for the - menus. Setting this to zero will remove a substatial amount of - code from fltk. Overlays have only been tested on SGI servers! */ +/* + * HAVE_OVERLAY: + * + * Use the X overlay extension? FLTK will try to use an overlay + * visual for Fl_Overlay_Window, the Gl_Window overlay, and for the + * menus. Setting this to zero will remove a substantial amount of + * code from FLTK. Overlays have only been tested on SGI servers! + */ + #define HAVE_OVERLAY 0 -/* It is possible your GL has an overlay even if X does not, if so - turn this on: */ + +/* + * HAVE_GL_OVERLAY: + * + * It is possible your GL has an overlay even if X does not. If so, + * set this to 1. + */ + #define HAVE_GL_OVERLAY HAVE_OVERLAY -/* Byte order of your machine: */ +/* + * WORDS_BIGENDIAN: + * + * Byte order of your machine: 1 = big-endian, 0 = little-endian. + */ + #define WORDS_BIGENDIAN 0 -/* Types used by fl_draw_image. One of U32 or U64 must be defined. - U16 is optional but fltk will work better with it! */ +/* + * U16, U32, U64: + * + * Types used by fl_draw_image. One of U32 or U64 must be defined. + * U16 is optional but FLTK will work better with it! + */ + #undef U16 #undef U32 #undef U64 -/* Where is (used only by fl_file_chooser and scandir): */ +/* + * HAVE_DIRENT_H, HAVE_SYS_NDIR_H, HAVE_SYS_DIR_H, HAVE_NDIR_H, HAVE_SCANDIR: + * + * Where is (used only by fl_file_chooser and scandir). + */ + #define HAVE_DIRENT_H 1 #define HAVE_SYS_NDIR_H 0 #define HAVE_SYS_DIR_H 0 #define HAVE_NDIR_H 0 #define HAVE_SCANDIR 0 -/* use poll() instead of select(): */ +/* + * HAVE_POLL: + * + * Use poll() if we don't have select(). + */ + #define HAVE_POLL 0 + +/* + * HAVE_LIBJPEG + * + * Do we have the JPEG group's JPEG file library? + */ + +#define HAVE_LIBJPEG 0 + +/* + * End of "$Id: configh.in,v 1.2 1998/10/20 16:41:17 mike Exp $". + */ diff --git a/configure.in b/configure.in index 46b856b68..c6d875db5 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,71 @@ dnl# -*- sh -*- dnl# the "configure" script is made from this by running GNU "autoconf" +dnl# +dnl# "$Id" +dnl# +dnl# for the Fast Light Tool Kit (FLTK). +dnl# +dnl# Copyright 1998 by Bill Spitzak and others. +dnl# +dnl# This library is free software; you can redistribute it and/or +dnl# modify it under the terms of the GNU Library General Public +dnl# License as published by the Free Software Foundation; either +dnl# version 2 of the License, or (at your option) any later version. +dnl# +dnl# This library is distributed in the hope that it will be useful, +dnl# but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl# Library General Public License for more details. +dnl# +dnl# You should have received a copy of the GNU Library General Public +dnl# License along with this library; if not, write to the Free Software +dnl# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +dnl# USA. +dnl# +dnl# Please report all bugs and problems to "fltk-bugs@easysw.com". +dnl# AC_INIT(src/Fl.C) + +AC_PROG_RANLIB + +LIBNAME="libfltk.a" +if test "$RANLIB" != ":"; then + LIBCOMMAND="ar crv" +else + LIBCOMMAND="ar crvs" +fi + +DEBUGFLAG="" + +AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],if eval "test x$enable_debug = xyes"; then + DEBUGFLAG="-g" +fi) +AC_ARG_ENABLE(shared, [ --enable-shared turn on shared libraries [default=no]],if eval "test x$enable_shared = xyes"; then + RANLIB=":" + case `uname` in + SunOS* | UNIX_S*) + LIBNAME="libfltk.so.1" + LIBCOMMAND="\$(CXX) -G $DEBUGFLAG -o" + ;; + HP-UX*) + LIBNAME="libfltk.sl.1" + LIBCOMMAND="ld -b -z +h libfltk.sl.1 $DEBUGFLAGS -o" + ;; + *) + echo "Warning: shared libraries may not be supported. Trying -shared" + echo " option to compiler." + OSF1* | IRIX*) + LIBNAME="libfltk.so.1" + LIBCOMMAND="\$(CXX) -shared $DEBUGFLAG -o" + ;; + esac +fi) + +if test -n "$DEBUGFLAG"; then + CFLAGS="$DEBUGFLAG $CFLAGS" +fi + AC_PROG_CC AC_PROG_CXX dnl# AC_PROG_INSTALL @@ -33,8 +97,6 @@ AC_HEADER_DIRENT AC_CHECK_FUNCS(scandir) -AC_PROG_RANLIB - AC_PATH_XTRA echo "Ignoring libraries \"$X_PRE_LIBS\" requested by configure." dnl# LIBS="$LIBS$X_LIBS$X_PRE_LIBS" @@ -62,45 +124,18 @@ if test "$ac_cv_have_overlay" = yes; then AC_DEFINE(HAVE_OVERLAY) fi +dnl Check for other libraries... + +AC_CHECK_LIB(jpeg,jpeg_destroy_decompress) + MAKEDEPEND="\$(CXX) -M" -dnl# add warnings and optimization to compiler switches: -dnl# do this last so messing with switches does not break tests -if test -n "$GXX"; then - CFLAGS="-Wall -O2" - CFLAGS_D="-Wall -Wno-return-type -g -DDEBUG" - CXXFLAGS="-Wall -Wno-return-type -O2" - CXXFLAGS_D="-Wall -Wno-return-type -g -DDEBUG" -else -if test "`(uname) 2>/dev/null`" = IRIX; then - if expr "`(uname -r)`" \>= 6.2; then - # compiler names: - CXX="CC -n32" - CC="cc -n32" - LD="ld -n32" - MAKEDEPEND="CC -M" - # -woff 3322 is necessary due to errors in Xlib headers on IRIX - CFLAGS="-fullwarn -O2" - CFLAGS_D="-fullwarn -gslim -DDEBUG" - CXXFLAGS="-fullwarn -woff 1685 -woff 3322 -O2" - CXXFLAGS_D="-fullwarn -woff 1685 -woff 3322 -gslim -DDEBUG" - else - CFLAGS="-O2" - CFLAGS_D="-g -DDEBUG" - CXXFLAGS="+w +pp -O2" - CXXFLAGS_D="+w +pp -g -DDEBUG" - fi -else - CFLAGS="-O" - CFLAGS_D="-g -DDEBUG" - CXXFLAGS="-O" - CXXFLAGS_D="-g -DDEBUG" -fi -fi +AC_SUBST(LIBNAME) +AC_SUBST(LIBCOMMAND) AC_SUBST(MAKEDEPEND) -AC_SUBST(CFLAGS_D) -AC_SUBST(CXXFLAGS_D) AC_CONFIG_HEADER(config.h:configh.in) -AC_OUTPUT(makeinclude ) +AC_OUTPUT(makeinclude) -dnl# end of configure.in +dnl# +dnl# End of "$Id: configure.in,v 1.2 1998/10/20 16:41:18 mike Exp $". +dnl# diff --git a/makedist b/makedist deleted file mode 100755 index 480aa01a3..000000000 --- a/makedist +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/tcsh -# I use tcsh to get the better glob matching. Wish there were a more -# portable way... -# argument to this script is the version number or word like "BETA" - -if ( $1 == "" ) then -echo "Version number needed" -exit 1 -endif - -set f="fltk-$1" -rm -f $f -ln -s . $f - -echo "Making $f.tgz" -tar -cf \ - $f.tar $f/README $f/COPYING $f/version $f/Makefile \ - $f/configure $f/*.in $f/makefiles/* $f/makedist $f/install-sh \ - $f/{src,fluid,FL,test,GL}/{README,Makefile,*.{fl,[CHch],x?m,menu}} \ - $f/documentation/*.{html,gif,jpg} $f/documentation/CHANGES \ - $f/forms.h $f/win32/* $f/lib/... \ - -gzip -f $f.tar -mv $f.tar.gz $f.tgz - -rm -f $f diff --git a/makeinclude.in b/makeinclude.in index 1791e680f..b6e0039a0 100644 --- a/makeinclude.in +++ b/makeinclude.in @@ -1,3 +1,28 @@ +# +# "$Id" +# +# for the Fast Light Tool Kit (FLTK). +# +# Copyright 1998 by Bill Spitzak and others. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library 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 +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# Please report all bugs and problems to "fltk-bugs@easysw.com". +# + # @configure_input@ prefix =@prefix@ @@ -9,24 +34,25 @@ srcdir =@srcdir@ VPATH =@srcdir@ # compiler names: -CXX =@CXX@ -CC =@CC@ -MAKEDEPEND =@MAKEDEPEND@ +CXX =@CXX@ +CC =@CC@ +MAKEDEPEND =@MAKEDEPEND@ # flags for C++ compiler: CFLAGS =@CFLAGS@ -CFLAGS_D =@CFLAGS_D@ CXXFLAGS =@CXXFLAGS@ @X_CFLAGS@ -CXXFLAGS_D =@CXXFLAGS_D@ @X_CFLAGS@ # program to make the archive: -LIBNAME =libfltk.a -LIBNAME_D =libfltk_d.a -AR =ar rc +LIBNAME =@LIBNAME@ +LIBCOMMAND =@LIBCOMMAND@ RANLIB =@RANLIB@ # libraries to link with: -LDLIBS =@LIBS@ -lX11 -lXext @X_EXTRA_LIBS@ -lm +LDLIBS =@LIBS@ -lX11 -lXext @X_EXTRA_LIBS@ -lm # libraries to link with when using GL: -GLDLIBS =@LIBS@ @GLLIB@ -lX11 -lXext @X_EXTRA_LIBS@ -lm +GLDLIBS =@LIBS@ @GLLIB@ -lX11 -lXext @X_EXTRA_LIBS@ -lm + +# +# End of "$Id: makeinclude.in,v 1.2 1998/10/20 16:41:20 mike Exp $". +# diff --git a/version b/version deleted file mode 100644 index 1b8671e4f..000000000 --- a/version +++ /dev/null @@ -1,2 +0,0 @@ -VERSION =0 -REVISION =99 diff --git a/visualc/README b/visualc/README deleted file mode 100644 index 9c0bd2fc2..000000000 --- a/visualc/README +++ /dev/null @@ -1,198 +0,0 @@ -How to compile for Windoze: - -Fltk has been reported to compile with GNU GCC compilers, with -MicroSoft Visual C++ version 4 and 5, and with Borland's C++ compiler -(sorry no info on that here). - ----------------------------------------------------------------- -Using GNU C compilers (MingW32 and/or Cygnus): ----------------------------------------------------------------- - -Edited from mail from Carl Thompson: - -MINGW32 and Cygnus are both ports of the GNU compiler to win32. The -difference is that Cygnus will emulate a complete Unix development -environment including nearly all of the standard Unix system calls. This -allows Unix programs to be ported to win32 possibly without changing a -single line of source code. However, the applications it generates are big, -very slow, depend on the Cygnus DLL, and currently somewhat unstable. For -straight Windows applications / Libraries like FLTK that do not require Unix -system call emulation, MINGW32 is the superior choice. MINGW32 produces a -plain Windows binary that is only dependent on the normal Windows DLLs. - -Some links for getting MINGW32: - -http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32/download.html -http://www.cygnus.com/misc/gnu-win32/index.html -ftp://objectcentral.com/mingw32 - -You will of course need GNU make for MINGW32 in addition to the regular -MINGW32 utilities. You also need the OpenGL header files which -apparently are not always included with mingw32, get them from the -above ftp site. - -More instructions from Rick Sayre (at Pixar): - -BTW, for what it's worth, here's the list of changes I have to make to get -fltk and the examples to build under MINGW32 (which I've switched to from -CYGWIN, since programs compiled under it use standard DLL's rather than the -extremely bugging cygwin.dll, and it just otherwise seems to work better): - -Run ./configure -- -In makeinclude - change the CFLAGS and CXXFLAGS to add "-O2 -DWIN32" -change the libraries to "-lgdi32 -luser32" (add "-mwindows" to not get -a console) -- -In config.h - set HAVE_SCANDIR to 0. ./configure seems to do this -correctly now, but it was occasionally in the past setting it to 1 -- -in src/Makefile: - change the "ar" command to use the "ar -M < ar.script" form. This -is needed only because I compile under Cygwin's B19 bash, which blows up in -all sorts of bad ways (hard resets[!]) on long command lines. More details -if you care, but most people might not. Just a warning. -- -in test/demo.menu - Change the paths to DOS form [blech!], don't use "&" -[A better idea would be to replace system() with a call that knows how -to fake a fork on Winblows] -- -in fluid/Makefile -Change the make install rules to reference "fluid.exe" for installing and -strip'ing, rather than "fluid" - -I suspect that it is very likely not a good idea to try "make install" under -Windows. Instead, copy "libfltk.a" to "C:\MINGW32\LIB" (replace -"C:\MINGW32" with the directory in which you installed MINGW32). Then copy -the entire "FL" directory to "C:\MINGW32\INCLUDE". - -From Gustavo Hime: - -First, thank you for the nice piece of software, and congratulations -on the quality source code. Fltk compiles (and runs) beautifully on -all the systems I use (Irix 6.4,Solaris 2.5, RedHat Linux 5.0): the -exception was Windows, where compilation was rather hard. - -I have just now managed to compile (satisfactorily) fltk on Win95 -using Mingw32: I do not have MSVC (I don't believe in Microsoft -compilers :)), and we (the project I am engaged in) are going to use -mingw32 to port unix code to windows anyway, so mingw32 was the way to -go. Here is a list of what I had to do: - -Modify ar -mwindows to ar -ruv in your makeinclude.mingw32. - -Added -DCYGNUS to your *FLAGS variables (I am new to mingw32, I don't -know what it defines to id itself, but they are so close I don't think -it matters much). - -Disable GL overlay in win32/config.h (shouldn't this be the default?). - -Added dummy makedepend files to directories fluid and src. - -Created empty lib directory. - -Fixed scroll.C line 83 (implicit typecast from int to const char * in -function call, mingw32 has a problem with this) - -Did not fix list_visuals.C (weird code there, where is the main -functionfor win32?) - -And finally, the hardest: downloaded the OpenGL headers for mingw32 -fromftp://objectcentral.com/mingw32. These are not included in the -mingw32 distribution, and it took me a couple of hours to find them on -the net. It would be nice to add a note about this in the fltk -documentation, and I'll send an e-mail asking them to add these -headers to the mingw32 distribution. - -Once again, great code. With mingw32, fltk and opengl, I can -imediatellyport all my old windows code to unix, and I no longer need -to waste 300+ mb of hard-drive on stupid borland compilers. - ----------------------------------------------------------------- -Using MSVC++: ----------------------------------------------------------------- - -If you have MSVC++ 5.0, double click the "fltk.dsw". Make the "fltk" -project current, and build it. This will create the library in -../lib/fltkd.lib. To build the demo programs, select the "demo" -project and build it. To run the demos run the demo project. - -I only have Pentium and Alpha NT machines running MSVC++ 5.0. Other -users have reported success compiling fltk on Windowe95, and using -version 4 of MSVC++, Borland's C++ compiler, and various ports of GCC -to windows (to use these, look at the "makeinclude" files in -../makefiles). - -If you want to make non-console apps you have to do something special, -and that differs on each compiler/linker package. For MSVC++ the -secret switch is: - - /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup - -For cygwin/mingw32 and perhaps some other compilers based on gcc put -this in the makeinclude file: - - LDLIBS =-lgdi32 -luser32 -mwindows - -There are no makefiles, for MSVC++ or any other compiler, because I -don't know how to write them (the ones dumped by MSVC++ are useless -and unreadable). - ----------------------------------------------------------------- -Other compilers: ----------------------------------------------------------------- - -I have heard that Borland C++ is usable. - -You probably need to start with the Unix Makefiles. There is one in -../src, one in ../fluid, and one in ../test. Edit these as necessary -and compile. You must add "-DWIN32" to your compiler switches. - -The biggest problem seems to be differences in the windows.h header -files (MicroSoft copyrighted theirs?). Some functions and macros have -different names or are missing. - -The MSVC++ "makefiles" are totally useless. Ignore that crap. - -Start with the Unix makefiles, which list all the necessary source -files. Don't try to compile the files ending in _win32.C, they are -#included by other files if WIN32 is defined. - -When compiling the symbol WIN32 must be defined (most compilers do -this?) and you have to set the include path so the file win32/config.h -is seen when the code does #include . You may need to use -some sort of switch to force the compiler to compile the files with -C++ rather than C. On MSVC++ this is the obvious acronym "/TP" :-) -Not doing these steps will result in lots of cryptic errors. - ----------------------------------------------------------------- -Known problems and ToDo list: ----------------------------------------------------------------- - -It does not work if you turn on full optimizations in VC++. I have -been told this is due to bugs in VC++, but if anybody can find a way -around them it would be nice... (the "optimize" settings in the -project files only do partial optimization and work ok). - -If program is deactivated, Fl::wait() does not return until it is -activated again, even though things happen, like redraws. This could -break some programs that rely on executing code after Fl::wait(). - -Fl_Gl_Window::can_do_overlay() returns true until the first time it -attempts to draw an overlay, and then correctly returns whether or not -there is overlay hardware. - -Cut text contains ^J rather than ^M^J to break lines. This is a -feature, not a bug. - -Fl_Window::fullscreen() not implemented (should take over the screen -without a title bar). Currently does maximize instead. - -Reports of clipping problems on '95. Can't reproduce on NT. - -Need to import .bmp files into fluid. Wonko has the specs. - -Can't set icon of windows. - -Transparent parts of pixmaps do not really work. diff --git a/visualc/config.h b/visualc/config.h index fa8d6db76..847ec742e 100644 --- a/visualc/config.h +++ b/visualc/config.h @@ -9,7 +9,7 @@ (and KDE and Qt). 1 is a plausible future evolution... Notice that this may be simulated at runtime by redefining the boxtypes using Fl::set_boxtype() */ -#define BORDER_WIDTH 3 +#define BORDER_WIDTH 2 /* Do you have OpenGL? Set this to 0 if you don't plan to use OpenGL, and fltk will be smaller */ -- cgit v1.2.3