istereo2

view libs/goatkit/screen.h @ 11:03cc3b1884d1

implemented builtin themes registration and lookup in goatkit
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 28 Sep 2015 06:53:06 +0300
parents
children 7bd4264bf74a
line source
1 /*
2 GoatKit - a themable/animated widget toolkit for games
3 Copyright (C) 2014 John Tsiombikas <nuclear@member.fsf.org>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
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 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef SCREEN_H_
19 #define SCREEN_H_
21 #include "vec.h"
22 #include "widget.h"
24 namespace goatkit {
26 class ScreenImpl;
28 class Screen {
29 private:
30 ScreenImpl *scr;
32 public:
33 Screen();
34 ~Screen();
36 void set_position(float x, float y);
37 void set_position(const Vec2 &pos);
38 const Vec2 &get_position() const;
39 void set_size(float x, float y);
40 void set_size(const Vec2 &sz);
41 const Vec2 get_size() const;
42 const BBox &get_box() const;
44 void add_widget(Widget *w);
45 int get_widget_count() const;
46 Widget *get_widget(int idx) const;
47 Widget *get_widget(const char *name) const;
49 void show();
50 void hide();
51 bool is_visible() const;
53 bool grab_mouse(Widget *w);
55 void draw() const;
57 // window system events used to generate widget events (see event.h)
58 void sysev_keyboard(int key, bool press);
59 // mouse position as reported by the window system. might fall outside
60 void sysev_mouse_button(int bn, bool press, float x, float y);
61 void sysev_mouse_motion(float x, float y);
62 };
64 } // namespace goatkit
66 #endif /* SCREEN_H_ */