ROLAND  0.70
Amstrad Emulator based on Caprice Source rewritten in C++.
gui.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) by Fred Klaus *
3  * development@fkweb.de *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 #ifndef SDLTK_GUI_H
21 #define SDLTK_GUI_H
22 
23 #include "widget.h"
24 #include "video.h"
25 #include "SDL.h"
26 #include <list>
27 
28 
30 namespace sdltk
31 {
32 
34  class Gui : public std::list<Widget*>
35  {
36 
37  public:
38  Gui(Video * video);
39  ~Gui();
40 
41  void add(Widget * widget);
42  void del(Widget * widget);
43 
45  bool checkEvent(SDL_Event * event);
46  void update();
47 
48  bool enabled() const {return mEnabled;}
51 
52  void setFocus(Widget * focus) {mHasFocus = focus;}
53 
54  Video * video() const {return mVideo;}
55 
56  protected:
57  bool mEnabled;
58  Widget * mHasFocus; // receives the incoming events
59 
61  };
62 
63 } // sdltk
64 
65 #endif // SDLTK_GUI_H
void setEnabled(bool enabled)
Definition: gui.h:49
author Fred Klaus development@fkweb.de
Definition: gui.h:34
Widget * mHasFocus
Definition: gui.h:58
Video * mVideo
Definition: gui.h:60
void del(Widget *widget)
Definition: gui.cpp:42
~Gui()
Definition: gui.cpp:30
bool enabled() const
Definition: gui.h:48
void toggleEnabled()
Definition: gui.h:50
Video * video() const
Definition: gui.h:54
bool checkEvent(SDL_Event *event)
returns true if event was accepted
Definition: gui.cpp:49
bool mEnabled
Definition: gui.h:57
void add(Widget *widget)
Definition: gui.cpp:35
void update()
Definition: gui.cpp:104
Baseclass for all Widgets.
Definition: widget.h:37
Gui(Video *video)
Definition: gui.cpp:25
void setFocus(Widget *focus)
Definition: gui.h:52
Baseclass for all SDL Video drivers.
Definition: video.h:35
the SDL based Stuff
Definition: audio.cpp:22