File: status.hpp

package info (click to toggle)
abuse 2.00-12
  • links: PTS
  • area: main
  • in suites: slink
  • size: 12,708 kB
  • ctags: 15,389
  • sloc: ansic: 115,852; cpp: 6,792; lisp: 2,066; sh: 1,734; makefile: 1,601; asm: 264
file content (42 lines) | stat: -rw-r--r-- 880 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef __STATUS_HPP_
#define __STATUS_HPP_

#include "visobj.hpp"      // get visual object declaration


class status_manager
{
  public :
  virtual void push(char *name, visual_object *show) = 0;
  virtual void update(int percentage) = 0;
  virtual void pop() = 0;
  virtual void force_display() { ; }
} ;


class text_status_node;

class text_status_manager : public status_manager
{
  public :
  int level;
  text_status_node *first;
  text_status_manager();
  virtual void push(char *name, visual_object *show);
  virtual void update(int percentage);
  virtual void pop();
} ;


extern status_manager *stat_man;

class stack_stat  // something you can declare on the stact that is sure to get cleaned up
{
  public :
  stack_stat(char *st, visual_object *show=NULL) { if (stat_man) stat_man->push(st,show); }
  ~stack_stat() { if (stat_man) stat_man->pop(); }
} ;


#endif