Remove Fl::run_also_windowless() and FL::wait_also_windowless() from planned public FLTK 1.4 API.
These were introduced at r12647, that is, during development of the 1.4 API. These functions provided windowless support only on the MacOS platform, where this can be obtained without those functions. Windowless support on other platforms would require changing the event loop. There's no evidence from STR's there's a demand for windowless mode on other platforms. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12680 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
78183fb45b
commit
06b925964d
7
CHANGES
7
CHANGES
@ -22,12 +22,13 @@ Changes in FLTK 1.4.0 Released: ??? ?? 2017
|
||||
hardware support is present (a backup mechanism is available in absence
|
||||
of this support). Thus, all text drawable in Fl_Window's can be drawn
|
||||
in Fl_GL_Window's (STR#3450).
|
||||
- New member functions FL::run_also_windowless(),
|
||||
and FL::wait_also_windowless(double secnds) to run the event
|
||||
loop even without any mapped window if the platform supports it.
|
||||
- New member functions Fl::program_should_quit(void),
|
||||
and Fl::program_should_quit(int) to support detection by the library
|
||||
of a request to terminate cleanly the program.
|
||||
- MacOS platform: the processing of the application menu's "Quit" item
|
||||
has been changed. With FLTK 1.3.x, the application terminated when all
|
||||
windows were closed even before Fl::run() of Fl::wait() could return.
|
||||
With FLTK 1.4, Fl::run() returns so the app follows its normal termination path.
|
||||
- MacOS platform: Added support for rescaling the GUI of any app at run-time
|
||||
using the command/+/-/0/ keystrokes.
|
||||
- MSWindows platform: Added optional support for rescaling the GUI of any app
|
||||
|
2
FL/Fl.H
2
FL/Fl.H
@ -414,8 +414,6 @@ 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
|
||||
|
@ -178,9 +178,6 @@ public:
|
||||
/* Number of pixels per drawing unit for the display.
|
||||
The default implementation may be enough. */
|
||||
virtual float retina_factor() { return 1; }
|
||||
// The default implementation of the next 2 functions may be enough.
|
||||
virtual int run_also_windowless();
|
||||
virtual int wait_also_windowless(double delay);
|
||||
};
|
||||
|
||||
|
||||
|
@ -738,15 +738,12 @@ Apple "Quit" Event
|
||||
|
||||
\par
|
||||
When the user presses Cmd-Q or requests a termination of the
|
||||
application, FLTK reacts sending an \c FL_CLOSE event to all open
|
||||
application, FLTK sends an \c FL_CLOSE event to all open
|
||||
windows. If any window remains open, the termination request aborts.
|
||||
If all windows close, the application's event loop terminates,
|
||||
that is, Fl::run() returns. The application can then follow
|
||||
FLTK's normal termination path executing cleanup code that may be programmed
|
||||
after termination of the event loop, and returning from main().
|
||||
Function Fl::run_also_windowless() can be used instead of Fl::run() to keep
|
||||
the event loop running also after all windows are closed, a feature the MacOS platform supports.
|
||||
This function also returns after a successful Cmd-Q.
|
||||
Function Fl::program_should_quit() allows to detect whether the event loop
|
||||
terminated because of a program termination request.
|
||||
|
||||
|
27
src/Fl.cxx
27
src/Fl.cxx
@ -516,6 +516,13 @@ double Fl::wait(double time_to_wait) {
|
||||
(supposedly it would return non-zero on any errors, but FLTK calls
|
||||
exit directly for these). A normal program will end main()
|
||||
with return Fl::run();.
|
||||
|
||||
\note Fl::run() and Fl::wait() (but not Fl::wait(double)) both
|
||||
return when all FLTK windows are closed. Therefore, a MacOS FLTK
|
||||
application possessing Fl_Sys_Menu_Bar items able to create new windows
|
||||
and expected to keep running without any open window cannot use
|
||||
these two functions. One solution is to run the event loop as follows:
|
||||
\code while (!Fl::program_should_quit()) Fl::wait(1e20); \endcode
|
||||
*/
|
||||
int Fl::run() {
|
||||
while (Fl_X::first) wait(FOREVER);
|
||||
@ -588,26 +595,6 @@ int Fl::ready()
|
||||
return screen_driver()->ready();
|
||||
}
|
||||
|
||||
/** Run the event loop even without any mapped window if the platform supports it.
|
||||
Identical to Fl::run() for platforms that don't support running windowless.
|
||||
The MacOS platform supports it.
|
||||
\return zero indicates the event loop has been terminated.
|
||||
\version 1.4.0
|
||||
*/
|
||||
int Fl::run_also_windowless() {
|
||||
return Fl::screen_driver()->run_also_windowless();
|
||||
}
|
||||
|
||||
/** Wait for \p delay seconds or until an event occurs, even without any mapped window if the platform supports it.
|
||||
Identical to Fl::wait(delay) for platforms that don't support running windowless.
|
||||
The MacOS platform supports it.
|
||||
\return non zero indicates the event loop should be terminated
|
||||
\version 1.4.0
|
||||
*/
|
||||
int Fl::wait_also_windowless(double delay) {
|
||||
return Fl::screen_driver()->wait_also_windowless(delay);
|
||||
}
|
||||
|
||||
int Fl::program_should_quit_ = 0;
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
@ -483,15 +483,6 @@ int Fl_Screen_Driver::parse_color(const char* p, uchar& r, uchar& g, uchar& b)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int Fl_Screen_Driver::run_also_windowless() {
|
||||
return Fl::run();
|
||||
}
|
||||
|
||||
int Fl_Screen_Driver::wait_also_windowless(double delay) {
|
||||
Fl::wait(delay);
|
||||
return Fl::first_window() != NULL;
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id$".
|
||||
//
|
||||
|
@ -1719,18 +1719,6 @@ static void drain_dropped_files_list() {
|
||||
free(fname);
|
||||
}
|
||||
|
||||
int Fl_Cocoa_Screen_Driver::run_also_windowless() {
|
||||
while (!Fl::program_should_quit()) {
|
||||
Fl::wait(1e20);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Fl_Cocoa_Screen_Driver::wait_also_windowless(double delay) {
|
||||
if (!Fl::program_should_quit()) Fl::wait(delay);
|
||||
return !Fl::program_should_quit();
|
||||
}
|
||||
|
||||
/*
|
||||
* Install an open documents event handler...
|
||||
*/
|
||||
|
@ -101,8 +101,6 @@ public:
|
||||
virtual float scale(int n) {return scale_;}
|
||||
virtual void scale(int n, float f) { scale_ = f;}
|
||||
virtual Fl_RGB_Image *read_win_rectangle(int X, int Y, int w, int h);
|
||||
virtual int run_also_windowless();
|
||||
virtual int wait_also_windowless(double delay);
|
||||
private:
|
||||
float scale_;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user