X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fwidget.h;h=9b86691e48343344b723af0ad2d90726d82ff6b6;hb=9f38197854e699a6093a906ab43f4238f3cd2388;hp=555db7f4c8e2c87cd6d94128e209fc11c5c5a32b;hpb=6deafc9f236b90175a303944815f7c0eac1c95c1;p=libs%2Fgltk.git diff --git a/source/widget.h b/source/widget.h index 555db7f..9b86691 100644 --- a/source/widget.h +++ b/source/widget.h @@ -6,6 +6,7 @@ #include #include "geometry.h" #include "inputmethod.h" +#include "mspgltk_api.h" #include "partcache.h" #include "state.h" @@ -20,7 +21,7 @@ class Style; /** Base class for all widgets. */ -class Widget +class MSPGLTK_API Widget { friend class Container; @@ -46,17 +47,17 @@ public: protected: Geometry geom; std::string style_name; - const Style *style; - State state; - bool visible; - InputType input_type; - Container *parent; + const Style *style = 0; + State state = NORMAL; + bool visible = true; + InputType input_type = INPUT_NONE; + Container *parent = 0; std::string tooltip; PartCache part_cache; - bool rebuild_needed; + bool rebuild_needed = false; Time::TimeDelta anim_interval; - Widget(); + Widget() = default; private: Widget(const Widget &); Widget &operator=(const Widget &); @@ -119,9 +120,6 @@ public: void set_enabled(bool); bool is_enabled() const { return !(state&DISABLED); } - // Deprecated - void set_focusable(bool); - protected: void set_state(State s) { set_state(s, s); } void clear_state(State s) { set_state(s, NORMAL); } @@ -164,12 +162,9 @@ public: virtual bool navigate(Navigation) { return false; } virtual void animate(const Time::TimeDelta &) { } protected: - virtual void on_size_change() { on_geometry_change(); } + virtual void on_size_change() { } virtual void on_style_change() { } virtual void on_reparent() { } - - // Deprecated - virtual void on_geometry_change() { } }; } // namespace GLtk