mirror of
https://github.com/fltk/fltk.git
synced 2026-05-30 21:25:30 +08:00
Remove fl_wait() that is not part of the public API.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11953 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -492,8 +492,6 @@ void fl_trigger_clipboard_notify(int source) {
|
||||
|
||||
void (*Fl::idle)(); // see Fl::add_idle.cxx for the add/remove functions
|
||||
|
||||
extern int fl_wait(double time); // in Fl_<platform>.cxx
|
||||
|
||||
/**
|
||||
See int Fl::wait()
|
||||
*/
|
||||
|
||||
+3
-14
@@ -839,19 +839,6 @@ static double do_queued_events( double time = 0.0 )
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This public function handles all events. It wait a maximum of
|
||||
* 'time' seconds for an event. This version returns 1 if events
|
||||
* other than the timeout timer were processed.
|
||||
*
|
||||
* \todo there is no socket handling in this code whatsoever
|
||||
*/
|
||||
int fl_wait( double time )
|
||||
{
|
||||
do_queued_events( time );
|
||||
return (got_events);
|
||||
}
|
||||
|
||||
double fl_mac_flush_and_wait(double time_to_wait) {
|
||||
static int in_idle = 0;
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
@@ -869,7 +856,9 @@ double fl_mac_flush_and_wait(double time_to_wait) {
|
||||
NSEnableScreenUpdates(); // 10.3
|
||||
if (Fl::idle && !in_idle) // 'idle' may have been set within flush()
|
||||
time_to_wait = 0.0;
|
||||
double retval = fl_wait(time_to_wait);
|
||||
do_queued_events( time_to_wait );
|
||||
double retval = got_events;
|
||||
|
||||
Fl_Cocoa_Window_Driver::q_release_context();
|
||||
[pool release];
|
||||
return retval;
|
||||
|
||||
+5
-5
@@ -369,10 +369,10 @@ static void process_awake_handler_requests(void) {
|
||||
|
||||
// This is never called with time_to_wait < 0.0.
|
||||
// It *should* return negative on error, 0 if nothing happens before
|
||||
// timeout, and >0 if any callbacks were done. This version only
|
||||
// returns zero if nothing happens during a 0.0 timeout, otherwise
|
||||
// it returns 1.
|
||||
int fl_wait(double time_to_wait) {
|
||||
// timeout, and >0 if any callbacks were done. This version
|
||||
// always returns 1.
|
||||
double Fl_WinAPI_Screen_Driver::wait(double time_to_wait) {
|
||||
|
||||
int have_message = 0;
|
||||
|
||||
Fl::run_checks();
|
||||
@@ -477,7 +477,7 @@ int fl_wait(double time_to_wait) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// just like fl_wait(0.0) except no callbacks are done:
|
||||
// just like Fl_WinAPI_Screen_Driver::wait(0.0) except no callbacks are done:
|
||||
int Fl_WinAPI_Screen_Driver::ready() {
|
||||
if (PeekMessage(&fl_msg, NULL, 0, 0, PM_NOREMOVE)) return 1;
|
||||
if (!nfds) return 0;
|
||||
|
||||
+2
-2
@@ -230,7 +230,7 @@ void (*fl_unlock_function)() = nothing;
|
||||
// This is never called with time_to_wait < 0.0:
|
||||
// It should return negative on error, 0 if nothing happens before
|
||||
// timeout, and >0 if any callbacks were done.
|
||||
int fl_wait(double time_to_wait) {
|
||||
int Fl_X11_Screen_Driver::poll_or_select_with_delay(double time_to_wait) {
|
||||
|
||||
// OpenGL and other broken libraries call XEventsQueued
|
||||
// unnecessarily and thus cause the file descriptor to not be ready,
|
||||
@@ -283,7 +283,7 @@ int fl_wait(double time_to_wait) {
|
||||
return n;
|
||||
}
|
||||
|
||||
// just like fl_wait(0.0) except no callbacks are done:
|
||||
// just like Fl_X11_Screen_Driver::poll_or_select_with_delay(0.0) except no callbacks are done:
|
||||
int Fl_X11_Screen_Driver::poll_or_select() {
|
||||
if (XQLength(fl_display)) return 1;
|
||||
if (!nfds) return 0; // nothing to select or poll
|
||||
|
||||
@@ -27,9 +27,6 @@
|
||||
#include <FL/fl_ask.H>
|
||||
#include <stdio.h>
|
||||
|
||||
// Add these externs to allow Win32 port to build - suspect that Fl_X11_Screen_Driver.cxx also might need these
|
||||
// but I don't have a X11 box to hand for testing. These should be in an internal header somewhere?
|
||||
extern int fl_wait(double time); // in Fl_win32.cxx
|
||||
|
||||
// these are set by Fl::args() and override any system colors: from Fl_get_system_colors.cxx
|
||||
extern const char *fl_fg;
|
||||
@@ -267,12 +264,6 @@ void Fl_WinAPI_Screen_Driver::flush()
|
||||
}
|
||||
|
||||
|
||||
double Fl_WinAPI_Screen_Driver::wait(double time_to_wait)
|
||||
{
|
||||
return fl_wait(time_to_wait);
|
||||
}
|
||||
|
||||
|
||||
extern void fl_fix_focus(); // in Fl.cxx
|
||||
|
||||
// We have to keep track of whether we have captured the mouse, since
|
||||
|
||||
@@ -43,6 +43,7 @@ protected:
|
||||
FLScreenInfo screens[MAX_SCREENS];
|
||||
float dpi[MAX_SCREENS][2];
|
||||
int poll_or_select();
|
||||
int poll_or_select_with_delay(double time_to_wait);
|
||||
|
||||
public:
|
||||
static int ewmh_supported();
|
||||
|
||||
@@ -48,11 +48,6 @@
|
||||
extern Atom fl_NET_WORKAREA;
|
||||
extern XIC fl_xim_ic; // in Fl_x.cxx
|
||||
|
||||
// Add these externs to allow X11 port to build - same as Fl_WinAPI_Screen_Driver.cxx.
|
||||
// These should be in an internal header somewhere?
|
||||
// AlbrechtS (Comment by Ian, modified...)
|
||||
extern int fl_wait(double time); // in Fl_x.cxx
|
||||
|
||||
// these are set by Fl::args() and override any system colors: from Fl_get_system_colors.cxx
|
||||
extern const char *fl_fg;
|
||||
extern const char *fl_bg;
|
||||
@@ -464,7 +459,7 @@ double Fl_X11_Screen_Driver::wait(double time_to_wait)
|
||||
time_to_wait = first_timeout->time;
|
||||
if (time_to_wait <= 0.0) {
|
||||
// do flush second so that the results of events are visible:
|
||||
int ret = fl_wait(0.0);
|
||||
int ret = this->poll_or_select_with_delay(0.0);
|
||||
Fl::flush();
|
||||
return ret;
|
||||
} else {
|
||||
@@ -472,7 +467,7 @@ double Fl_X11_Screen_Driver::wait(double time_to_wait)
|
||||
Fl::flush();
|
||||
if (Fl::idle && !in_idle) // 'idle' may have been set within flush()
|
||||
time_to_wait = 0.0;
|
||||
return fl_wait(time_to_wait);
|
||||
return this->poll_or_select_with_delay(time_to_wait);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user