istereo2

annotate libs/goatkit/screen.h @ 6:3bccfc7d10fe

goatkit is drawing
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 23 Sep 2015 05:44:58 +0300
parents
children 7bd4264bf74a
rev   line source
nuclear@6 1 /*
nuclear@6 2 GoatKit - a themable/animated widget toolkit for games
nuclear@6 3 Copyright (C) 2014 John Tsiombikas <nuclear@member.fsf.org>
nuclear@6 4
nuclear@6 5 This program is free software: you can redistribute it and/or modify
nuclear@6 6 it under the terms of the GNU Lesser General Public License as published by
nuclear@6 7 the Free Software Foundation, either version 3 of the License, or
nuclear@6 8 (at your option) any later version.
nuclear@6 9
nuclear@6 10 This program is distributed in the hope that it will be useful,
nuclear@6 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
nuclear@6 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
nuclear@6 13 GNU Lesser General Public License for more details.
nuclear@6 14
nuclear@6 15 You should have received a copy of the GNU Lesser General Public License
nuclear@6 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
nuclear@6 17 */
nuclear@6 18 #ifndef SCREEN_H_
nuclear@6 19 #define SCREEN_H_
nuclear@6 20
nuclear@6 21 #include "vec.h"
nuclear@6 22 #include "widget.h"
nuclear@6 23
nuclear@6 24 namespace goatkit {
nuclear@6 25
nuclear@6 26 class ScreenImpl;
nuclear@6 27
nuclear@6 28 class Screen {
nuclear@6 29 private:
nuclear@6 30 ScreenImpl *scr;
nuclear@6 31
nuclear@6 32 public:
nuclear@6 33 Screen();
nuclear@6 34 ~Screen();
nuclear@6 35
nuclear@6 36 void set_position(float x, float y);
nuclear@6 37 void set_position(const Vec2 &pos);
nuclear@6 38 const Vec2 &get_position() const;
nuclear@6 39 void set_size(float x, float y);
nuclear@6 40 void set_size(const Vec2 &sz);
nuclear@6 41 const Vec2 get_size() const;
nuclear@6 42 const BBox &get_box() const;
nuclear@6 43
nuclear@6 44 void add_widget(Widget *w);
nuclear@6 45 int get_widget_count() const;
nuclear@6 46 Widget *get_widget(int idx) const;
nuclear@6 47 Widget *get_widget(const char *name) const;
nuclear@6 48
nuclear@6 49 void show();
nuclear@6 50 void hide();
nuclear@6 51 bool is_visible() const;
nuclear@6 52
nuclear@6 53 bool grab_mouse(Widget *w);
nuclear@6 54
nuclear@6 55 void draw() const;
nuclear@6 56
nuclear@6 57 // window system events used to generate widget events (see event.h)
nuclear@6 58 void sysev_keyboard(int key, bool press);
nuclear@6 59 // mouse position as reported by the window system. might fall outside
nuclear@6 60 void sysev_mouse_button(int bn, bool press, float x, float y);
nuclear@6 61 void sysev_mouse_motion(float x, float y);
nuclear@6 62 };
nuclear@6 63
nuclear@6 64 } // namespace goatkit
nuclear@6 65
nuclear@6 66 #endif /* SCREEN_H_ */