0883ca27cc4d24591b4e5d764d28e711820c91d8
[ccbs] / bigscreen / rotatescreen.h
1 #ifndef _ROTATESCREEN_H
2 #define _ROTATESCREEN_H 1
3
4 #include <vector>
5 #include <time.h>
6 #include <sys/time.h>
7 #include "screen.h"
8
9 /* 
10  * Doesn't rotate the screens, but rotate _between_ them (ie. show
11  * one at a time). :-)
12  */
13 struct Subscreen {
14         unsigned char *buf;
15         GenericScreen *screen;
16 };
17
18 class RotateScreen : public GenericScreen {
19 private:
20         bool valid;
21         std::vector<Subscreen> subscreens;
22         unsigned current_screen;
23
24         struct timeval last_update;
25
26         bool needs_update();
27         
28 public:
29         RotateScreen();
30         virtual ~RotateScreen();
31
32         bool check_invalidated();
33         void draw(unsigned char *buf);
34
35         void add_screen(GenericScreen *screen);
36 //      void remove_screen(GenericScreen *screen);
37 };
38
39 #endif /* !defined(_ROTATESCREEN_H) */