home *** CD-ROM | disk | FTP | other *** search
/ Borland Programmer's Resource / Borland_Programmers_Resource_CD_1995.iso / code / wxwin140 / include / wx_timer.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-19  |  2.0 KB  |  71 lines

  1. /*
  2.  * File:     wx_timer.h
  3.  * Purpose:  wxTimer - provides simple timer functionality
  4.  *
  5.  *                       wxWindows 1.40
  6.  * Copyright (c) 1993 Artificial Intelligence Applications Institute,
  7.  *                   The University of Edinburgh
  8.  *
  9.  *                     Author: Julian Smart
  10.  *                       Date: 18-4-93
  11.  *
  12.  * Permission to use, copy, modify, and distribute this software and its
  13.  * documentation for any purpose is hereby granted without fee, provided
  14.  * that the above copyright notice, author statement and this permission
  15.  * notice appear in all copies of this software and related documentation.
  16.  *
  17.  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS,
  18.  * IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
  19.  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  20.  *
  21.  * IN NO EVENT SHALL THE ARTIFICIAL INTELLIGENCE APPLICATIONS INSTITUTE OR THE
  22.  * UNIVERSITY OF EDINBURGH BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR
  23.  * CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM
  24.  * LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF
  25.  * DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH
  26.  * THE USE OR PERFORMANCE OF THIS SOFTWARE.
  27.  */
  28.  
  29. #ifndef wx_timerh
  30. #define wx_timerh
  31.  
  32. #ifdef wx_xview
  33. #include <xview/notify.h>
  34. #endif
  35.  
  36. #ifdef wx_x
  37. #include <sys/time.h>
  38. #endif
  39.  
  40. #include "common.h"
  41. #include "wx_obj.h"
  42.  
  43. class wxTimer: public wxObject
  44. {
  45.  public:
  46. #ifdef wx_motif
  47.   int milli;
  48.   long timerId;
  49. #endif
  50. #ifdef wx_xview
  51.   struct itimerval timerval;
  52. #endif
  53. #ifdef wx_msw
  54.   long id;
  55.   int milli;
  56. #endif
  57.  public:
  58.   wxTimer(void);
  59.   ~wxTimer(void);
  60.   virtual Bool Start(int milliseconds = -1); // Start timer
  61.   virtual void Stop(void);                   // Stop timer
  62.   virtual void Notify(void);                 // Override this member
  63. };
  64.  
  65. // Timer functions (milliseconds)
  66. void wxStartTimer(void);
  67. // Gets time since last wxStartTimer or wxGetElapsedTime
  68. long wxGetElapsedTime(void);
  69.  
  70. #endif wx_timerh
  71.