summaryrefslogtreecommitdiff
path: root/documentation/src
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2022-03-20 19:59:22 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2022-04-13 16:50:30 +0200
commit10537b7143a06a4c0c1c4caba4f0150f9e290090 (patch)
treed265896f0d66a20391cbeb55b0f133fb3f1a90ca /documentation/src
parent95b5623b96e37e46ef80e75326453ea840172ce7 (diff)
Make Fl_Image::copy() 'const', including all derived classes
Copying an image does not (and must not) change the original object, hence copy() should always be 'const'. This is *necessary* if the given Fl_Image object is 'const'.
Diffstat (limited to 'documentation/src')
-rw-r--r--documentation/src/migration_1_4.dox20
1 files changed, 20 insertions, 0 deletions
diff --git a/documentation/src/migration_1_4.dox b/documentation/src/migration_1_4.dox
index 37420eab3..350453611 100644
--- a/documentation/src/migration_1_4.dox
+++ b/documentation/src/migration_1_4.dox
@@ -73,6 +73,26 @@ file from its old location to the new location as documented in
Fl_Preferences::Fl_Preferences(Root, const char*, const char*) .
+\section migration_1_4_copy_image Fl_Image::copy() 'const'
+
+Since FLTK 1.4.0 the virtual method Fl_Image::copy() has been declared
+'const' so read-only ('const') images can be copied w/o casts.
+
+This will very likely not affect user code. However, if you derived your
+own class from any of the Fl_*_Image variants \b and you overrode
+'Your'_Image::copy() then you must declare this 'const' as well, i.e.
+you must add the keyword 'const' to your declaration of copy() in your
+header file and the implementation.
+
+Code example in header file:
+\code
+ class Your_Image {
+ // ...
+ copy() const;
+ copy(int w, int h) const;
+ };
+
+
\htmlonly
<hr>
<table summary="navigation bar" width="100%" border="0">