curvedraw

view src/widgets.h @ 16:7f795f7fecd6

readme and COPYING
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 20 Dec 2015 10:55:57 +0200
parents 8e524989c904
children
line source
1 /*
2 curvedraw - a simple program to draw curves
3 Copyright (C) 2015 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 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 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef WIDGETS_H_
19 #define WIDGETS_H_
21 #include <vmath/vmath.h>
23 class Widget {
24 protected:
25 Vector2 pos;
26 char *text;
28 public:
29 Widget();
30 virtual ~Widget();
32 virtual void set_position(const Vector2 &p);
33 virtual const Vector2 &get_position() const;
35 virtual void set_text(const char *str);
36 virtual void set_textf(const char *str, ...);
37 virtual const char *get_text() const;
39 virtual void draw() const = 0;
40 };
42 class Label : public Widget {
43 public:
44 virtual void draw() const;
45 };
47 #endif // WIDGETS_H_