diff options
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Fl.H | 16 | ||||
| -rw-r--r-- | FL/Fl_System_Driver.H | 5 |
2 files changed, 19 insertions, 2 deletions
@@ -259,7 +259,8 @@ public: private: static unsigned char options_[OPTION_LAST]; static unsigned char options_read_; - + static int program_should_quit_; // non-zero means the program was asked to cleanly terminate + public: /* Return a global setting for all FLTK applications, possibly overridden @@ -412,6 +413,19 @@ public: static int check(); static int ready(); static int run(); + static int run_also_windowless(); + static int wait_also_windowless(double delay = 1e20); + /** Returns non-zero when a request for program termination was received and accepted. + On the MacOS platform, the "Quit xxx" item of the application menu is such a request, + that is considered accepted when all windows are closed. On other platforms, this function + returns 0 until \p Fl::program_should_quit(1) is called. + */ + static int program_should_quit() {return program_should_quit_;} + /** Indicate to the FLTK library whether a program termination request was received and accepted. + A program may set this to 1, for example, while performing a platform-independent command asking the program to cleanly + terminate, similarly to the "Quit xxx" item of the application menu under MacOS. */ + static void program_should_quit(int should_i) { program_should_quit_ = should_i; } + static Fl_Widget* readqueue(); /** Adds a one-shot timeout callback. The function will be called by diff --git a/FL/Fl_System_Driver.H b/FL/Fl_System_Driver.H index 5bcd8e994..a543906fd 100644 --- a/FL/Fl_System_Driver.H +++ b/FL/Fl_System_Driver.H @@ -4,7 +4,7 @@ // A base class for platform specific system calls // for the Fast Light Tool Kit (FLTK). // -// Copyright 2010-2017 by Bill Spitzak and others. +// Copyright 2010-2018 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 @@ -225,6 +225,9 @@ public: virtual const char *meta_name() { return "Meta"; } virtual const char *alt_name() { return "Alt"; } virtual const char *control_name() { return "Ctrl"; } + // The default implementation of the next 2 functions may be enough. + virtual int run_also_windowless(); + virtual int wait_also_windowless(double delay); }; #endif // FL_SYSTEM_DRIVER_H |
