Move xxx_also_windowless member functions from Fl_System_Driver to Fl_Screen_Driver.

Because these functions are related to Fl_Screen_Driver::wait(double)

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12652 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2018-02-08 12:47:40 +00:00
parent 0c8ca7944a
commit b78b2f7f5f
8 changed files with 18 additions and 18 deletions

View File

@ -180,6 +180,9 @@ public:
/* Number of pixels per drawing unit for the display. /* Number of pixels per drawing unit for the display.
The default implementation may be enough. */ The default implementation may be enough. */
virtual float retina_factor() { return 1; } 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);
}; };

View File

@ -225,9 +225,6 @@ public:
virtual const char *meta_name() { return "Meta"; } virtual const char *meta_name() { return "Meta"; }
virtual const char *alt_name() { return "Alt"; } virtual const char *alt_name() { return "Alt"; }
virtual const char *control_name() { return "Ctrl"; } 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 #endif // FL_SYSTEM_DRIVER_H

View File

@ -594,7 +594,7 @@ int Fl::ready()
\version 1.4.0 \version 1.4.0
*/ */
int Fl::run_also_windowless() { int Fl::run_also_windowless() {
return Fl::system_driver()->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. /** Wait for \p delay seconds or until an event occurs, even without any mapped window if the platform supports it.
@ -602,7 +602,7 @@ int Fl::run_also_windowless() {
\version 1.4.0 \version 1.4.0
*/ */
int Fl::wait_also_windowless(double delay) { int Fl::wait_also_windowless(double delay) {
return Fl::system_driver()->wait_also_windowless(delay); return Fl::screen_driver()->wait_also_windowless(delay);
} }
int Fl::program_should_quit_ = 0; int Fl::program_should_quit_ = 0;

View File

@ -520,6 +520,15 @@ int Fl_Screen_Driver::parse_color(const char* p, uchar& r, uchar& g, uchar& b)
return 1; 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$". // End of "$Id$".
// //

View File

@ -445,15 +445,6 @@ void Fl_System_Driver::gettime(time_t *sec, int *usec) {
*usec = 0; *usec = 0;
} }
int Fl_System_Driver::run_also_windowless() {
return Fl::run();
}
int Fl_System_Driver::wait_also_windowless(double delay) {
Fl::wait(delay);
return Fl::first_window() != NULL;
}
// //
// End of "$Id$". // End of "$Id$".
// //

View File

@ -1719,14 +1719,14 @@ static void drain_dropped_files_list() {
free(fname); free(fname);
} }
int Fl_Darwin_System_Driver::run_also_windowless() { int Fl_Cocoa_Screen_Driver::run_also_windowless() {
while (!Fl::program_should_quit()) { while (!Fl::program_should_quit()) {
Fl::wait(1e20); Fl::wait(1e20);
} }
return 0; return 0;
} }
int Fl_Darwin_System_Driver::wait_also_windowless(double delay) { int Fl_Cocoa_Screen_Driver::wait_also_windowless(double delay) {
if (!Fl::program_should_quit()) Fl::wait(delay); if (!Fl::program_should_quit()) Fl::wait(delay);
return !Fl::program_should_quit(); return !Fl::program_should_quit();
} }

View File

@ -100,6 +100,8 @@ public:
virtual APP_SCALING_CAPABILITY rescalable() { return SYSTEMWIDE_APP_SCALING; } virtual APP_SCALING_CAPABILITY rescalable() { return SYSTEMWIDE_APP_SCALING; }
virtual float scale(int n) {return scale_;} virtual float scale(int n) {return scale_;}
virtual void scale(int n, float f) { scale_ = f;} virtual void scale(int n, float f) { scale_ = f;}
virtual int run_also_windowless();
virtual int wait_also_windowless(double delay);
private: private:
float scale_; float scale_;
}; };

View File

@ -81,8 +81,6 @@ public:
virtual const char *meta_name(); virtual const char *meta_name();
virtual const char *alt_name(); virtual const char *alt_name();
virtual const char *control_name(); virtual const char *control_name();
virtual int run_also_windowless();
virtual int wait_also_windowless(double delay);
}; };
#endif // FL_DARWIN_SYSTEM_DRIVER_H #endif // FL_DARWIN_SYSTEM_DRIVER_H