curvedraw

annotate 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
rev   line source
nuclear@16 1 /*
nuclear@16 2 curvedraw - a simple program to draw curves
nuclear@16 3 Copyright (C) 2015 John Tsiombikas <nuclear@member.fsf.org>
nuclear@16 4
nuclear@16 5 This program is free software: you can redistribute it and/or modify
nuclear@16 6 it under the terms of the GNU General Public License as published by
nuclear@16 7 the Free Software Foundation, either version 3 of the License, or
nuclear@16 8 (at your option) any later version.
nuclear@16 9
nuclear@16 10 This program is distributed in the hope that it will be useful,
nuclear@16 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
nuclear@16 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
nuclear@16 13 GNU General Public License for more details.
nuclear@16 14
nuclear@16 15 You should have received a copy of the GNU General Public License
nuclear@16 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
nuclear@16 17 */
nuclear@0 18 #ifndef WIDGETS_H_
nuclear@0 19 #define WIDGETS_H_
nuclear@0 20
nuclear@0 21 #include <vmath/vmath.h>
nuclear@0 22
nuclear@0 23 class Widget {
nuclear@0 24 protected:
nuclear@0 25 Vector2 pos;
nuclear@0 26 char *text;
nuclear@0 27
nuclear@0 28 public:
nuclear@0 29 Widget();
nuclear@0 30 virtual ~Widget();
nuclear@0 31
nuclear@0 32 virtual void set_position(const Vector2 &p);
nuclear@0 33 virtual const Vector2 &get_position() const;
nuclear@0 34
nuclear@0 35 virtual void set_text(const char *str);
nuclear@0 36 virtual void set_textf(const char *str, ...);
nuclear@0 37 virtual const char *get_text() const;
nuclear@0 38
nuclear@0 39 virtual void draw() const = 0;
nuclear@0 40 };
nuclear@0 41
nuclear@0 42 class Label : public Widget {
nuclear@0 43 public:
nuclear@0 44 virtual void draw() const;
nuclear@0 45 };
nuclear@0 46
nuclear@0 47 #endif // WIDGETS_H_