istereo2

view libs/goatkit/screen.h @ 15:7bd4264bf74a

gui done?
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 30 Sep 2015 04:41:21 +0300
parents 3bccfc7d10fe
children
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;
52 float get_visibility() const;
53 void set_visibility_transition(long msec);
54 long get_visibility_transition() const;
56 bool grab_mouse(Widget *w);
58 void draw() const;
60 // window system events used to generate widget events (see event.h)
61 void sysev_keyboard(int key, bool press);
62 // mouse position as reported by the window system. might fall outside
63 void sysev_mouse_button(int bn, bool press, float x, float y);
64 void sysev_mouse_motion(float x, float y);
65 };
67 } // namespace goatkit
69 #endif /* SCREEN_H_ */