source: abuse/trunk/src/imlib/include/status.hpp @ 17

Last change on this file since 17 was 14, checked in by Sam Hocevar, 17 years ago
  • fix C++ warning with classes that have virtual functions but not virtual dtor.
File size: 911 bytes
Line 
1#ifndef __STATUS_HPP_
2#define __STATUS_HPP_
3
4#include "visobj.hpp"      // get visual object declaration
5
6
7class status_manager
8{
9  public :
10  virtual void push(char *name, visual_object *show) = 0;
11  virtual void update(int percentage) = 0;
12  virtual void pop() = 0;
13  virtual void force_display() { ; }
14  virtual ~status_manager() {}
15} ;
16
17
18class text_status_node;
19
20class text_status_manager : public status_manager
21{
22  public :
23  int level;
24  text_status_node *first;
25  text_status_manager();
26  virtual void push(char *name, visual_object *show);
27  virtual void update(int percentage);
28  virtual void pop();
29} ;
30
31
32extern status_manager *stat_man;
33
34class stack_stat  // something you can declare on the stact that is sure to get cleaned up
35{
36  public :
37  stack_stat(char *st, visual_object *show=NULL) { if (stat_man) stat_man->push(st,show); }
38  ~stack_stat() { if (stat_man) stat_man->pop(); }
39} ;
40
41
42#endif
43
Note: See TracBrowser for help on using the repository browser.