]> Shamusworld >> Repos - virtualjaguar/blob - src/gui/window.h
Creating Qt/Experimental branch of trunk.
[virtualjaguar] / src / gui / window.h
1 //
2 // Window class
3 //
4 // by James L. Hammons
5
6 #ifndef __WINDOW_H__
7 #define __WINDOW_H__
8
9 #include <vector>
10 #include "button.h"
11 #include "element.h"
12
13 class Window: public Element
14 {
15         public:
16                 Window(uint32 x = 0, uint32 y = 0, uint32 w = 0, uint32 h = 0,
17                         void (* f)(Element *) = NULL);
18                 virtual ~Window();
19                 virtual void HandleKey(SDLKey key);
20                 virtual void HandleMouseMove(uint32 x, uint32 y);
21                 virtual void HandleMouseButton(uint32 x, uint32 y, bool mouseDown);
22                 virtual void Draw(uint32 offsetX = 0, uint32 offsetY = 0);
23                 virtual void Notify(Element * e);
24                 void AddElement(Element * e);
25
26         protected:
27                 uint32 fgColor, bgColor;
28                 void (* handler)(Element *);
29                 Button * close;
30                 // We have to use a list of Element *pointers* because we can't make a
31                 // list that will hold all the different object types in the same list...
32                 std::vector<Element *> list;
33 };
34
35 #endif  // __WINDOW_H__