BailDetector.h
Upload User: kellyonhid
Upload Date: 2013-10-12
Package Size: 932k
Code Size: 1k
Category:

3D Graphic

Development Platform:

Visual C++

  1. // BailDetector.cc    interface for peeking at events,
  2. //                    and bailing out of long operations
  3. // created 2/5/99     magi@cs
  4. #ifndef _BAILDETECTOR_H_
  5. #define _BAILDETECTOR_H_
  6. #include <tk.h>
  7. class BailDetector
  8. {
  9.  public:
  10.   BailDetector();
  11.   ~BailDetector();
  12.   static bool bail (void);
  13.   bool operator() (void) { return bail(); };
  14.  private:
  15.   static bool s_bBail;      // shared between bail detectors on stack
  16.   static int  s_iBailDepth; // keep track of when contstructor is master
  17.                             // in chain of several nested bail detectors
  18.   static bool s_bBailNoticed; // check if bail was acted on
  19.   static int  s_iLastChecked; // time events last pumped
  20.   static Tk_RestrictAction
  21.     filterproc (ClientData clientData, XEvent* eventPtr);
  22. };
  23. int PlvBailDetectCmd(ClientData clientData, Tcl_Interp *interp, 
  24.      int argc, char *argv[]);
  25. #endif // _BAILDETECTOR_H_