#define MSP_GLTK_WIDGET_H_
#include <string>
+#include <msp/core/noncopyable.h>
#include <msp/datafile/objectloader.h>
#include <msp/gl/renderer.h>
#include "geometry.h"
/**
Base class for all widgets.
*/
-class MSPGLTK_API Widget
+class MSPGLTK_API Widget: public NonCopyable
{
friend class Container;
{
public:
Loader(Widget &);
+
private:
void position(int, int);
void size(unsigned, unsigned);
protected:
Geometry geom;
std::string style_name;
- const Style *style;
- State state;
- bool visible;
- InputType input_type;
- Container *parent;
+ const Style *style = nullptr;
+ State state = NORMAL;
+ bool visible = true;
+ InputType input_type = INPUT_NONE;
+ Container *parent = nullptr;
std::string tooltip;
PartCache part_cache;
- bool rebuild_needed;
+ bool rebuild_needed = false;
Time::TimeDelta anim_interval;
- Widget();
-private:
- Widget(const Widget &);
- Widget &operator=(const Widget &);
+ Widget() = default;
public:
virtual ~Widget();