Drop 1.0 compatibility; document 1.4 migration

The FLTK 1.0 compatibility support by defining macro 'FLTK_1_0_COMPAT'
did no longer work since FLTK 1.3.x and nobody complained. Hence we
can safely remove this "feature".

Documentation changes:

 - Drop chapter 'Migrating Code from FLTK 1.0 to 1.1'
 - Drop chapter 'Migrating Code from FLTK 1.1 to 1.3'
 - Add  chapter 'Migrating Code from FLTK 1.3 to 1.4'

The removed chapters are still available in FLTK 1.3 docs.
This commit is contained in:
Albrecht Schlosser 2020-01-08 18:41:50 +01:00
parent 4197c2616d
commit 3f1f871585
12 changed files with 70 additions and 297 deletions

View File

@ -201,6 +201,8 @@ Changes in FLTK 1.4.0 Released: ??? ?? 2019
- Bundled IDE project files (Xcode and Visual Studio) have been
removed. Please use CMake to generate your IDE project files.
See README.CMake.txt for more information.
- Dropped FLTK 1.0 compatibility (macro FLTK_1_0_COMPAT). This "feature"
was no longer usable since FLTK 1.3, hence it can be dropped safely.
Changes in FLTK 1.3

View File

@ -3,7 +3,7 @@
//
// Enumerations for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2017 by Bill Spitzak and others.
// Copyright 1998-2020 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@ -1222,13 +1222,7 @@ enum Fl_Damage {
FL_DAMAGE_ALL = 0x80 /**< Everything needs to be redrawn. */
};
// FLTK 1.0.x compatibility definitions...
# ifdef FLTK_1_0_COMPAT
# define contrast fl_contrast
# define down fl_down
# define frame fl_frame
# define inactive fl_inactive
# endif // FLTK_1_0_COMPAT
// FLTK 1.0.x compatibility definitions (FLTK_1_0_COMPAT) dropped in 1.4.0
#endif

View File

@ -104,23 +104,9 @@ FL_EXPORT void fl_decode_uri(char *uri);
# endif /* __cplusplus */
/*
* FLTK 1.0.x compatibility definitions...
* FLTK 1.0.x compatibility definitions (FLTK_1_0_COMPAT) dropped in 1.4.0
*/
# ifdef FLTK_1_0_COMPAT
# define filename_absolute fl_filename_absolute
# define filename_expand fl_filename_expand
# define filename_ext fl_filename_ext
# define filename_isdir fl_filename_isdir
# define filename_list fl_filename_list
# define filename_match fl_filename_match
# define filename_name fl_filename_name
# define filename_relative fl_filename_relative
# define filename_setext fl_filename_setext
# define numericsort fl_numericsort
# endif /* FLTK_1_0_COMPAT */
#endif /* FL_FILENAME_H */
/** @} */

View File

@ -572,8 +572,7 @@ INPUT += @CMAKE_CURRENT_SOURCE_DIR@/src/enumerations.dox
INPUT += @CMAKE_CURRENT_SOURCE_DIR@/src/glut.dox
INPUT += @CMAKE_CURRENT_SOURCE_DIR@/src/forms.dox
INPUT += @CMAKE_CURRENT_SOURCE_DIR@/src/osissues.dox
INPUT += @CMAKE_CURRENT_SOURCE_DIR@/src/migration_1_1.dox
INPUT += @CMAKE_CURRENT_SOURCE_DIR@/src/migration_1_3.dox
INPUT += @CMAKE_CURRENT_SOURCE_DIR@/src/migration_1_4.dox
INPUT += @CMAKE_CURRENT_SOURCE_DIR@/src/development.dox
INPUT += @CMAKE_CURRENT_SOURCE_DIR@/src/license.dox
INPUT += @CMAKE_CURRENT_SOURCE_DIR@/src/examples.dox

View File

@ -3,7 +3,7 @@
#
# Makefile for the Fast Light Tool Kit (FLTK) documentation.
#
# Copyright 1998-2015 by Bill Spitzak and others.
# Copyright 1998-2020 by Bill Spitzak and others.
#
# This library is free software. Distribution and use rights are outlined in
# the file "COPYING" which should have been included with this file. If this
@ -43,8 +43,7 @@ HTMLFILES = \
$(SRC_DOCDIR)/glut.dox \
$(SRC_DOCDIR)/forms.dox \
$(SRC_DOCDIR)/osissues.dox \
$(SRC_DOCDIR)/migration_1_1.dox \
$(SRC_DOCDIR)/migration_1_3.dox \
$(SRC_DOCDIR)/migration_1_4.dox \
$(SRC_DOCDIR)/development.dox \
$(SRC_DOCDIR)/license.dox \
$(SRC_DOCDIR)/examples.dox \

View File

@ -315,9 +315,9 @@ The following code gives the navigation bar at the bottom of this page:
<table summary="navigation bar" width="100%" border="0">
<tr>
<td width="45%" align="LEFT">
<a class="el" href="migration_1_3.html">
<a class="el" href="migration_1_4.html">
[Prev]
Migrating Code from FLTK 1.1 to 1.3
Migrating Code from FLTK 1.3 to 1.4
</a>
</td>
<td width="10%" align="CENTER">
@ -340,9 +340,9 @@ The following code gives the navigation bar at the bottom of this page:
<table summary="navigation bar" width="100%" border="0">
<tr>
<td width="45%" align="LEFT">
<a class="el" href="migration_1_3.html">
<a class="el" href="migration_1_4.html">
[Prev]
Migrating Code from FLTK 1.1 to 1.3
Migrating Code from FLTK 1.3 to 1.4
</a>
</td>
<td width="10%" align="CENTER">

View File

@ -13,7 +13,7 @@
Revision 11 by F.&nbsp;Costantini, D.&nbsp;Gibson, M.&nbsp;Melcher,
A.&nbsp;Schlosser, B.&nbsp;Spitzak and M.&nbsp;Sweet.
Copyright 1998-2018 by Bill Spitzak and others.
Copyright 1998-2020 by Bill Spitzak and others.
</CENTER></TD>
</TR>
</TABLE>
@ -80,9 +80,7 @@
- \subpage osissues
- \subpage migration_1_1
- \subpage migration_1_3
- \subpage migration_1_4
- \subpage development

View File

@ -1,176 +0,0 @@
/**
\page migration_1_1 Migrating Code from FLTK 1.0 to 1.1
This appendix describes the differences between the FLTK
1.0.x and FLTK 1.1.x functions and classes.
\section migration_1_1_color Color Values
Color values are now stored in a 32-bit unsigned integer
instead of the unsigned character in 1.0.x. This allows for the
specification of 24-bit RGB values or 8-bit FLTK color indices.
\c FL_BLACK and \c FL_WHITE now remain black and white, even if
the base color of the gray ramp is changed using Fl::background().
\c FL_DARK3 and \c FL_LIGHT3 can be used instead to
draw a very dark or a very bright background hue.
Widgets use the new color symbols \c FL_FOREGROUND_COLOR,
\c FL_BACKGROUND_COLOR, \c FL_BACKGROUND2_COLOR,
\c FL_INACTIVE_COLOR, and \c FL_SELECTION_COLOR.
More details can be found in the chapter \ref enumerations.
\section migration_1_1_cutnpaste Cut and Paste Support
The FLTK clipboard is now broken into two parts - a local
selection value and a cut-and-paste value. This allows FLTK to
support things like highlighting and replacing text that was
previously cut or copied, which makes FLTK applications behave
like traditional GUI applications.
\section migration_1_1_file_chooser File Chooser
The file chooser in FLTK 1.1.x is significantly different
than the one supplied with FLTK 1.0.x. Any code that directly
references the old \c FCB class or members will need
to be ported to the new Fl_File_Chooser class.
\section migration_1_1_functions Function Names
Some function names have changed from FLTK 1.0.x to 1.1.x in
order to avoid name space collisions. You can still use the old
function names by defining the \c FLTK_1_0_COMPAT symbol on
the command-line when you compile (\c -DFLTK_1_0_COMPAT) or in
your source, e.g.:
\code
#define FLTK_1_0_COMPAT
#include <FL/Fl.H>
#include <FL/Enumerations.H>
#include <FL/filename.H>
\endcode
The following table shows the old and new function names:
<CENTER>
<TABLE WIDTH="80%" BORDER="1">
<TR>
<TH>Old 1.0.x Name</TH>
<TH>New 1.1.x Name</TH>
</TR>
<TR>
<TD>contrast()</TD>
<TD>fl_contrast()</TD>
</TR>
<TR>
<TD>down()</TD>
<TD>fl_down()</TD>
</TR>
<TR>
<TD>filename_absolute()</TD>
<TD>fl_filename_absolute()</TD>
</TR>
<TR>
<TD>filename_expand()</TD>
<TD>fl_filename_expand()</TD>
</TR>
<TR>
<TD>filename_ext()</TD>
<TD>fl_filename_ext()</TD>
</TR>
<TR>
<TD>filename_isdir()</TD>
<TD>fl_filename_isdir()</TD>
</TR>
<TR>
<TD>filename_list()</TD>
<TD>fl_filename_list()</TD>
</TR>
<TR>
<TD>filename_match()</TD>
<TD>fl_filename_match()</TD>
</TR>
<TR>
<TD>filename_name()</TD>
<TD>fl_filename_name()</TD>
</TR>
<TR>
<TD>filename_relative()</TD>
<TD>fl_filename_relative()</TD>
</TR>
<TR>
<TD>filename_setext()</TD>
<TD>fl_filename_setext()</TD>
</TR>
<TR>
<TD>frame()</TD>
<TD>fl_frame()</TD>
</TR>
<TR>
<TD>inactive()</TD>
<TD>fl_inactive()</TD>
</TR>
<TR>
<TD>numericsort()</TD>
<TD>fl_numericsort()</TD>
</TR>
</TABLE>
</CENTER>
\section migration_1_1_images Image Support
Image support in FLTK has been significantly revamped in 1.1.x.
The Fl_Image class is now a proper base class, with the core
image drawing functionality in the Fl_Bitmap, Fl_Pixmap, and
Fl_RGB_Image classes.
BMP, GIF, JPEG, PNG, XBM, and XPM image files can now be
loaded using the appropriate image classes, and the
Fl_Shared_Image class can be used to cache images in memory.
Image labels are no longer provided as an add-on label type.
If you use the old \c label() methods on an image, the
widget's \c image() method is called to set the image
as the label.
Image labels in menu items must still use the old labeltype
mechanism to preserve source compatibility.
\section migration_1_1_keyboard Keyboard Navigation
FLTK 1.1.x now supports keyboard navigation and control with
all widgets. To restore the old FLTK 1.0.x behavior so that only
text widgets get keyboard focus, call the Fl::visible_focus()
method to disable it:
\code
Fl::visible_focus(0);
\endcode
\htmlonly
<hr>
<table summary="navigation bar" width="100%" border="0">
<tr>
<td width="45%" align="LEFT">
<a class="el" href="osissues.html">
[Prev]
Operating System Issues
</a>
</td>
<td width="10%" align="CENTER">
<a class="el" href="index.html">[Index]</a>
</td>
<td width="45%" align="RIGHT">
<a class="el" href="migration_1_3.html">
Migrating Code from FLTK 1.1 to 1.3
[Next]
</a>
</td>
</tr>
</table>
\endhtmlonly
*/

View File

@ -1,80 +0,0 @@
/**
\page migration_1_3 Migrating Code from FLTK 1.1 to 1.3
This appendix describes the differences between the FLTK
1.1.x and FLTK 1.3.x functions and classes.
\section migration_1_3_fltk_1_0 Migrating From FLTK 1.0
If you want to migrate your code from FLTK 1.0 to FLTK 1.3,
then you should first consult Appendix \ref migration_1_1.
\section migration_1_3_fl_scroll Fl_Scroll Widget
Fl_Scroll::scroll_to(int x, int y) replaces Fl_Scroll::position(int x, int y).
This change was needed because Fl_Scroll::position(int,int) redefined
Fl_Widget::position(int,int), but with a completely different function (moving
the scrollbars instead of moving the widget).
Please be aware that you need to change your application's code for all
Fl_Scroll-derived widgets, if you used Fl_Scroll::position(int x, int y)
to position <b>the scrollbars</b> (not the widget itself).
The compiler will not detect any errors, because your calls to
\b position(int x, int y) will be calling Fl_Widget::position(int x, int y).
\section migration_1_3_unicode Unicode (UTF-8)
FLTK 1.3 uses Unicode (UTF-8) encoding internally. If you are only using
characters in the ASCII range (32-127), there is a high probability that
you don't need to modify your code. However, if you use international
characters (128-255), encoded as e.g. Windows codepage 1252, ISO-8859-1,
ISO-8859-15 or any other encoding, then you will need to update your character
string constants and widget input data accordingly.
Please refer to the \ref unicode chapter for more details.
\note It is important that, although your software uses only ASCII characters
for input to FLTK widgets, the user may enter non-ASCII characters, and FLTK
will return these characters with UTF-8 encoding to your application, e.g.
via Fl_Input::value(). You \b will need to re-encode them to \b your (non-UTF-8)
encoding, otherwise you might see or print garbage in your data.
\section migration_1_3_int_coords Widget Coordinate Representation
FLTK 1.3 changed all Widget coordinate variables and methods, e.g.
Fl_Widget::x(), Fl_Widget::y(), Fl_Widget::w(), Fl_Widget::h(), from
short (16-bit) to int (32-bit) representation. This should not affect
any existing code, but makes it possible to use bigger scroll areas
(e.g. Fl_Scroll widget).
\htmlonly
<hr>
<table summary="navigation bar" width="100%" border="0">
<tr>
<td width="45%" align="LEFT">
<a class="el" href="migration_1_1.html">
[Prev]
Migrating Code from FLTK 1.0 to 1.1
</a>
</td>
<td width="10%" align="CENTER">
<a class="el" href="index.html">[Index]</a>
</td>
<td width="45%" align="RIGHT">
<a class="el" href="development.html">
Developer Information
[Next]
</a>
</td>
</tr>
</table>
\endhtmlonly
*/

View File

@ -0,0 +1,52 @@
/**
\page migration_1_4 Migrating Code from FLTK 1.3 to 1.4
This appendix describes the differences between the FLTK
1.3.x and FLTK 1.4.x functions and classes.
\section migration_1_4_old_versions Migrating From FLTK 1.0 Or 1.1 To 1.4
If you want to migrate your code from FLTK 1.0 or 1.1 to FLTK 1.4,
then you should first consult the relevant appendices in FLTK 1.3
documentation online or by downloading the FLTK 1.3 documentation.
See https://www.fltk.org/doc-1.3/index.html
and/or https://www.fltk.org/software.php , respectively.
\section migration_1_4_headers Minor Changes in Header Files
(to be documented)
\section migration_1_4_preferences Fl_Preferences
(to be documented)
\htmlonly
<hr>
<table summary="navigation bar" width="100%" border="0">
<tr>
<td width="45%" align="LEFT">
<a class="el" href="osissues.html">
[Prev]
Operating System Issues
</a>
</td>
<td width="10%" align="CENTER">
<a class="el" href="index.html">[Index]</a>
</td>
<td width="45%" align="RIGHT">
<a class="el" href="development.html">
Developer Information
[Next]
</a>
</td>
</tr>
</table>
\endhtmlonly
*/

View File

@ -918,8 +918,8 @@ FLTK uses UTF-8-encoded UNIX-style filenames and paths.
<a class="el" href="index.html">[Index]</a>
</td>
<td width="45%" align="RIGHT">
<a class="el" href="migration_1_1.html">
Migrating Code from FLTK 1.0 to 1.1
<a class="el" href="migration_1_4.html">
Migrating Code from FLTK 1.3 to 1.4
[Next]
</a>
</td>

View File

@ -32,8 +32,7 @@ This manual is organized into the following chapters and appendices:
\li \ref glut
\li \ref forms
\li \ref osissues
\li \ref migration_1_1
\li \ref migration_1_3
\li \ref migration_1_4
\li \ref development
\li \ref license
\li \ref examples
@ -76,7 +75,7 @@ was dropped after FLTK 1.0.10. FLTK uses the preprocessor definition
\section preface_copyrights Copyrights and Trademarks
FLTK is Copyright 1998-2018 by Bill Spitzak and others. Use and
FLTK is Copyright 1998-2020 by Bill Spitzak and others. Use and
distribution of FLTK is governed by the GNU Library General Public
License with 4 exceptions, located in \ref license.