2 GoatKit - a themable/animated widget toolkit for games
3 Copyright (C) 2014-2018 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/>.
18 #ifndef GOATKIT_SCREEN_H_
19 #define GOATKIT_SCREEN_H_
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;
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);
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);
67 } // namespace goatkit
69 #endif /* GOATKIT_SCREEN_H_ */