diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2023-01-11 20:20:56 +0100 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2023-01-12 19:21:09 +0100 |
| commit | 79832b679f2d195eb3b0f30ca920a857cc133b2b (patch) | |
| tree | 9e4c15cf29469faf07ece4ccef2fd190d31491db /FL | |
| parent | 76a5c7b081361c2588c53253db374de5dd825cf9 (diff) | |
Add the initial version of class Fl_Scheme
This basic version of class Fl_Scheme contains only static methods that
are needed for Fl_Scheme_Choice and further extensions.
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Fl_Scheme.H | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/FL/Fl_Scheme.H b/FL/Fl_Scheme.H new file mode 100644 index 000000000..9a0f3cbf4 --- /dev/null +++ b/FL/Fl_Scheme.H @@ -0,0 +1,64 @@ +// +// Scheme header for the Fast Light Tool Kit (FLTK). +// +// Copyright 2022-2023 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 +// file is missing or damaged, see the license at: +// +// https://www.fltk.org/COPYING.php +// +// Please see the following page on how to report bugs and issues: +// +// https://www.fltk.org/bugs.php +// + +#ifndef FL_Fl_Scheme_H_ +#define FL_Fl_Scheme_H_ + +#include <FL/Fl.H> + +class Fl_Scheme { + +private: + + static const char **names_; // registered scheme names + static int num_schemes_; // number of registered schemes + static int alloc_size_; // number of allocated scheme name entries + +protected: + + // const char *name_; // the scheme's name + + // protected constructor - not yet implemented + // Fl_Scheme(const char *name); + +public: + + // Static methods. + + // Some of these methods will replace the scheme related methods of class Fl, + // for instance Fl::scheme() and Fl::is_scheme(). + // Backwards compatibility must be kept though. + + static const char **names(); + + /** + Return the number of currently registered schemes. + + \return Number of registered schemes. + */ + static int num_schemes() { + if (!names_) names(); // force initialization + return num_schemes_; + } + + // Adding a scheme name must be a public static method in FLTK 1.4.0. + // This will later be protected or replaced by another method name. + + static int add_scheme_name(const char *name); + +}; // class Fl_Scheme + +#endif // FL_Fl_Scheme_H_ |
