~ubuntu-branches/ubuntu/quantal/bbpager/quantal

« back to all changes in this revision

Viewing changes to Timer.hh

  • Committer: Bazaar Package Importer
  • Author(s): Stan Vasilyev
  • Date: 2005-09-14 21:29:20 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050914212920-x29ksl01wqio0buq
Tags: 0.4.1b1-1
* New maintainer. (Closes: #259583: ITA: bbpager -- Pager for the
  Blackbox window manager - Debian Bug report logs)
* New upstream release
* Updated Free Software Foundation address in Debian copyright
* Updated homepage in package description
* Changed Depends: blackbox (>= 0.60.2) | openbox | fluxbox to
  Suggests: blackbox (>= 0.70) | openbox | fluxbox since this version of
  bbpager is compatible with KDE and other window managers
* Closes: #322306: bbpager fails to start under blackbox and fluxbox
  (possibly others)
* Closes: #237837: windows list leak in void
  WMInterface::windowAttributeChange(Window win)
* Closes: #101217: bbpager cannot find blackbox style file
* Closes: #178163: bbpager does not parse ~ in resource file
* Closes: #219345: Always showing sticky windows closed under fluxbox
* Added Depends: libbt and Build-Depends: libbt-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Timer.hh for Blackbox - An X11 Window Manager
2
 
// Copyright (c) 1997 - 1999 Brad Hughes (bhughes@tcac.net)
3
 
//
4
 
// Permission is hereby granted, free of charge, to any person obtaining a
5
 
// copy of this software and associated documentation files (the "Software"),
6
 
// to deal in the Software without restriction, including without limitation
7
 
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
8
 
// and/or sell copies of the Software, and to permit persons to whom the 
9
 
// Software is furnished to do so, subject to the following conditions:
10
 
//
11
 
// The above copyright notice and this permission notice shall be included in 
12
 
// all copies or substantial portions of the Software. 
13
 
//
14
 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
15
 
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
16
 
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL 
17
 
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
18
 
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
19
 
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
20
 
// DEALINGS IN THE SOFTWARE.
21
 
  
22
 
#ifndef   __Timer_hh
23
 
#define   __Timer_hh
24
 
 
25
 
#ifdef    TIME_WITH_SYS_TIME
26
 
#  include <sys/time.h>
27
 
#  include <time.h> 
28
 
#else // !TIME_WITH_SYS_TIME 
29
 
#  ifdef    HAVE_SYS_TIME_H
30
 
#    include <sys/time.h>
31
 
#  else // !HAVE_SYS_TIME_H
32
 
#    include <time.h>
33
 
#  endif // HAVE_SYS_TIME_H
34
 
#endif // TIME_WITH_SYS_TIME
35
 
 
36
 
// forward declaration
37
 
class BTimer;
38
 
class TimeoutHandler;
39
 
 
40
 
#include "BaseDisplay.hh"
41
 
 
42
 
 
43
 
class TimeoutHandler {
44
 
public:
45
 
  virtual void timeout(void) = 0;
46
 
};
47
 
 
48
 
 
49
 
class BTimer {
50
 
  friend class BaseDisplay;
51
 
private:
52
 
  BaseDisplay *display;
53
 
  TimeoutHandler *handler;
54
 
  int timing, once;
55
 
 
56
 
  timeval _start, _timeout;
57
 
 
58
 
 
59
 
protected:
60
 
  void fireTimeout(void);
61
 
 
62
 
 
63
 
public:
64
 
  BTimer(BaseDisplay *, TimeoutHandler *);
65
 
  virtual ~BTimer(void);
66
 
 
67
 
  inline int &isTiming(void) { return timing; } 
68
 
  inline int &doOnce(void) { return once; }
69
 
 
70
 
  inline const timeval &getTimeout(void) const { return _timeout; }
71
 
  inline const timeval &getStartTime(void) const { return _start; }
72
 
 
73
 
  inline void fireOnce(int o) { once = o; }
74
 
 
75
 
  void setTimeout(long);
76
 
  void setTimeout(timeval);
77
 
  void start(void);
78
 
  void stop(void);
79
 
  void reset(void);
80
 
};
81
 
 
82
 
 
83
 
#endif // __Timer_hh
84