From a05ae33e20b09ab952ddbbf6762d5cfec77e4943 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Wed, 2 Jul 2025 16:16:48 +0200 Subject: Remove deprecated methods and functions In FLTK 1.5 we remove most (but not all) methods and functions that were deprecated in FLTK 1.3 or earlier. --- FL/Fl.H | 4 ---- FL/Fl_Group.H | 7 ------- FL/Fl_Menu_Item.H | 24 ------------------------ FL/Fl_Widget.H | 20 +++++--------------- FL/fl_ask.H | 21 +++++++++++++++++++++ FL/fl_draw.H | 11 ----------- 6 files changed, 26 insertions(+), 61 deletions(-) (limited to 'FL') diff --git a/FL/Fl.H b/FL/Fl.H index d2aeeb1c7..92e97788d 100644 --- a/FL/Fl.H +++ b/FL/Fl.H @@ -1322,10 +1322,6 @@ private: public: /** See grab(Fl_Window*) */ static void grab(Fl_Window& win) {grab(&win);} - /** Releases the current grabbed window, equals grab(0). - \deprecated Use Fl::grab(0) instead. - \see grab(Fl_Window*) */ - static void release() {grab(0);} // Visible focus methods... /** diff --git a/FL/Fl_Group.H b/FL/Fl_Group.H index f09f98d18..381ebb00b 100644 --- a/FL/Fl_Group.H +++ b/FL/Fl_Group.H @@ -244,13 +244,6 @@ public: // back compatibility functions: - /** - \deprecated This is for backwards compatibility only. You should use - \e W->%take_focus() instead. - \sa Fl_Widget::take_focus(); - */ - void focus(Fl_Widget* W) {W->take_focus();} - /** This is for forms compatibility only */ Fl_Widget* & _ddfdesign_kludge() {return resizable_;} diff --git a/FL/Fl_Menu_Item.H b/FL/Fl_Menu_Item.H index ae2bb53ab..f0cd49e9b 100644 --- a/FL/Fl_Menu_Item.H +++ b/FL/Fl_Menu_Item.H @@ -528,30 +528,6 @@ struct FL_EXPORT Fl_Menu_Item { Fl::callback_reason_ = reason; callback_(o, (void*)(fl_intptr_t)arg); } - /** Back compatibility only. - \deprecated - Please use Fl_Menu_Item::value() instead. - This method will be removed in FLTK 1.5.0 or later. - \see value() - */ - inline int checked() const {return value();} - - /** Back compatibility only. - \deprecated - Please use Fl_Menu_Item::set() instead. - This method will be removed in FLTK 1.5.0 or later. - \see set() - */ - inline void check() {set();} - - /** Back compatibility only. - \deprecated - Please use Fl_Menu_Item::clear() instead. - This method will be removed in FLTK 1.5.0 or later. - \see clear() - */ - inline void uncheck() {clear();} - int insert(int,const char*,int,Fl_Callback*,void* =0, int =0); int add(const char*, int shortcut, Fl_Callback*, void* =0, int = 0); diff --git a/FL/Fl_Widget.H b/FL/Fl_Widget.H index c0ede955b..42c58187c 100644 --- a/FL/Fl_Widget.H +++ b/FL/Fl_Widget.H @@ -1,7 +1,7 @@ // // Widget header file for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2024 by Bill Spitzak and others. +// Copyright 1998-2025 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 @@ -119,7 +119,7 @@ class FL_EXPORT Fl_Widget { Fl_Label label_; unsigned int flags_; Fl_Color color_; - Fl_Color color2_; + Fl_Color selection_color_; uchar type_; uchar damage_; uchar box_; @@ -470,7 +470,7 @@ public: \return the current selection color \see selection_color(Fl_Color), color(Fl_Color, Fl_Color) */ - Fl_Color selection_color() const {return color2_;} + Fl_Color selection_color() const {return selection_color_;} /** Sets the selection color. The selection color is defined for Forms compatibility and is usually @@ -480,7 +480,7 @@ public: \param[in] a the new selection color \see selection_color(), color(Fl_Color, Fl_Color) */ - void selection_color(Fl_Color a) {color2_ = a;} + void selection_color(Fl_Color a) {selection_color_ = a;} /** Sets the background and selection color of the widget. @@ -489,7 +489,7 @@ public: \param[in] sel selection color \see color(unsigned), selection_color(unsigned) */ - void color(Fl_Color bg, Fl_Color sel) {color_=bg; color2_=sel;} + void color(Fl_Color bg, Fl_Color sel) {color_ = bg; selection_color_ = sel;} /** Gets the current label text. \return a pointer to the current label text @@ -1247,16 +1247,6 @@ public: */ int use_accents_menu() { return flags() & MAC_USE_ACCENTS_MENU; } - /** For back compatibility only. - \deprecated Use selection_color() instead. - */ - Fl_Color color2() const {return (Fl_Color)color2_;} - - /** For back compatibility only. - \deprecated Use selection_color(unsigned) instead. - */ - void color2(unsigned a) {color2_ = a;} - /** Sets whether the widget's label uses '&' to indicate shortcuts. By default, all objects of classes Fl_Menu_ (and derivatives), Fl_Button (and derivatives), Fl_Text_Display, Fl_Value_Input, and Fl_Input_ (and derivatives) diff --git a/FL/fl_ask.H b/FL/fl_ask.H index 830dec97c..d596e9347 100644 --- a/FL/fl_ask.H +++ b/FL/fl_ask.H @@ -26,6 +26,23 @@ #include +// Note to FLTK developers: fl_ask() had been deprecated since FLTK 1.1.7 +// (released Jan 17, 2006 !) but was still available in FLTK 1.4.x. +// FLTK 1.5 disables it by using an *undocumented* preprocessor macro. +// This allows us to restore it (as a last resort) if there are too many +// complaints that fl_ask() is missing. If users don't complain, the +// conditional implementation of fl_ask() should be removed in FLTK 1.6. + +#ifndef FL_DOXYGEN + +// undocumented feature: include fl_ask() if requested; see comment above. + +#ifndef FLTK_INCLUDE_FL_ASK +#define FLTK_INCLUDE_FL_ASK 0 // set this to 1 to include fl_ask() +#endif + +#endif // FL_DOXYGEN + class Fl_Widget; /** Defines the different system beeps available. @@ -48,12 +65,16 @@ FL_EXPORT void fl_beep(int type = FL_BEEP_DEFAULT); FL_EXPORT void fl_message(const char *, ...) __fl_attr((__format__(__printf__, 1, 2))); FL_EXPORT void fl_alert(const char *, ...) __fl_attr((__format__(__printf__, 1, 2))); +#if FLTK_INCLUDE_FL_ASK + // fl_ask() is deprecated since it uses "Yes" and "No" for the buttons, // which does not conform to the current FLTK Human Interface Guidelines. // Use fl_choice() or fl_choice_n() with the appropriate verbs instead. FL_EXPORT int fl_ask(const char *, ...) __fl_attr((__format__(__printf__, 1, 2), __deprecated__)); +#endif // FLTK_INCLUDE_FL_ASK + FL_EXPORT int fl_choice(const char *q, const char *b0, const char *b1, const char *b2, ...) __fl_attr((__format__(__printf__, 1, 5))); FL_EXPORT const char *fl_input(const char *label, const char *deflt = 0, ...) __fl_attr((__format__(__printf__, 1, 3))); diff --git a/FL/fl_draw.H b/FL/fl_draw.H index 89292b7f8..00e4f1e2d 100644 --- a/FL/fl_draw.H +++ b/FL/fl_draw.H @@ -88,17 +88,6 @@ inline Fl_Color fl_color() { inline void fl_push_clip(int x, int y, int w, int h) { fl_graphics_driver->push_clip(x, y, w, h); } -/** - Intersect the current clip region with a rectangle and push this - new region onto the stack (deprecated). - \param[in] x,y,w,h position and size - \deprecated - Please use fl_push_clip(int x, int y, int w, int h) instead. - fl_clip(int, int, int, int) will be removed in FLTK 1.5. -*/ -inline void fl_clip(int x, int y, int w, int h) { - fl_graphics_driver->push_clip(x, y, w, h); -} /** Push an empty clip region onto the stack so nothing will be clipped. */ -- cgit v1.2.3