]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/container.h
Use nullptr instead of 0 for pointers
[libs/gltk.git] / source / container.h
index a80cc4e214551cda4348ee10a2986024b030684c..adaee6f4bb02c17b021e6386e6eb988809c15051 100644 (file)
@@ -4,12 +4,13 @@
 #include <list>
 #include <stdexcept>
 #include <sigc++/trackable.h>
+#include "mspgltk_api.h"
 #include "widget.h"
 
 namespace Msp {
 namespace GLtk {
 
-class hierarchy_error: public std::logic_error
+class MSPGLTK_API hierarchy_error: public std::logic_error
 {
 public:
        hierarchy_error(const std::string &);
@@ -17,13 +18,13 @@ public:
 };
 
 
-class Container: virtual public Widget
+class MSPGLTK_API Container: virtual public Widget
 {
 protected:
        struct Child: public sigc::trackable
        {
                Container &container;
-               Widget *widget;
+               Widget *widget = nullptr;
                Time::TimeDelta time_since_animate;
 
                Child(Container &, Widget *);
@@ -38,16 +39,16 @@ protected:
        };
 
        std::list<Child *> children;
-       Widget *click_focus;
-       unsigned click_button;
-       Widget *pointer_focus;
-       bool pointer_grabbed;
-       Widget *input_focus;
-       Widget *saved_input_focus;
-       Widget *touch_focus;
-       bool children_rebuild_needed;
-
-       Container();
+       Widget *click_focus = nullptr;
+       unsigned click_button = 0;
+       Widget *pointer_focus = nullptr;
+       bool pointer_grabbed = false;
+       Widget *input_focus = nullptr;
+       Widget *saved_input_focus = nullptr;
+       Widget *touch_focus = nullptr;
+       bool children_rebuild_needed = false;
+
+       Container() = default;
 public:
        virtual ~Container();