mirror of https://github.com/fltk/fltk
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:
parent
0c8ca7944a
commit
b78b2f7f5f
|
@ -180,6 +180,9 @@ 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);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -225,9 +225,6 @@ 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
|
||||
|
|
|
@ -594,7 +594,7 @@ int Fl::ready()
|
|||
\version 1.4.0
|
||||
*/
|
||||
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.
|
||||
|
@ -602,7 +602,7 @@ int Fl::run_also_windowless() {
|
|||
\version 1.4.0
|
||||
*/
|
||||
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;
|
||||
|
|
|
@ -520,6 +520,15 @@ 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$".
|
||||
//
|
||||
|
|
|
@ -445,15 +445,6 @@ void Fl_System_Driver::gettime(time_t *sec, int *usec) {
|
|||
*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$".
|
||||
//
|
||||
|
|
|
@ -1719,14 +1719,14 @@ static void drain_dropped_files_list() {
|
|||
free(fname);
|
||||
}
|
||||
|
||||
int Fl_Darwin_System_Driver::run_also_windowless() {
|
||||
int Fl_Cocoa_Screen_Driver::run_also_windowless() {
|
||||
while (!Fl::program_should_quit()) {
|
||||
Fl::wait(1e20);
|
||||
}
|
||||
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);
|
||||
return !Fl::program_should_quit();
|
||||
}
|
||||
|
|
|
@ -100,6 +100,8 @@ public:
|
|||
virtual APP_SCALING_CAPABILITY rescalable() { return SYSTEMWIDE_APP_SCALING; }
|
||||
virtual float scale(int n) {return scale_;}
|
||||
virtual void scale(int n, float f) { scale_ = f;}
|
||||
virtual int run_also_windowless();
|
||||
virtual int wait_also_windowless(double delay);
|
||||
private:
|
||||
float scale_;
|
||||
};
|
||||
|
|
|
@ -81,8 +81,6 @@ public:
|
|||
virtual const char *meta_name();
|
||||
virtual const char *alt_name();
|
||||
virtual const char *control_name();
|
||||
virtual int run_also_windowless();
|
||||
virtual int wait_also_windowless(double delay);
|
||||
};
|
||||
|
||||
#endif // FL_DARWIN_SYSTEM_DRIVER_H
|
||||
|
|
Loading…
Reference in New Issue