From 10537b7143a06a4c0c1c4caba4f0150f9e290090 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sun, 20 Mar 2022 19:59:22 +0100 Subject: 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'. --- documentation/src/migration_1_4.dox | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'documentation/src') 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
-- cgit v1.2.3