]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/container.cpp
Style update: add spaces around assignments
[libs/gltk.git] / source / container.cpp
index a46492d4ea3a1b7bb5e464952d7db846db4633c8..2ce2c5efc367213c584197d158c1327b6a2eda4b 100644 (file)
@@ -63,11 +63,11 @@ Widget *Container::get_child_at(int x, int y)
 
 Widget *Container::get_descendant_at(int x, int y)
 {
-       Widget *wdg=get_child_at(x, y);
-       if(Container *cont=dynamic_cast<Container *>(wdg))
+       Widget *wdg = get_child_at(x, y);
+       if(Container *cont = dynamic_cast<Container *>(wdg))
        {
-               const Geometry &cgeom=wdg->get_geometry();
-               Widget *wdg2=cont->get_descendant_at(x-cgeom.x, y-cgeom.y);
+               const Geometry &cgeom = wdg->get_geometry();
+               Widget *wdg2 = cont->get_descendant_at(x-cgeom.x, y-cgeom.y);
                if(wdg2)
                        return wdg2;
        }
@@ -78,17 +78,17 @@ void Container::button_press(int x, int y, unsigned btn)
 {
        if(click_focus)
        {
-               const Geometry &cgeom=click_focus->get_geometry();
+               const Geometry &cgeom = click_focus->get_geometry();
                click_focus->button_press(x-cgeom.x, y-cgeom.y, btn);
        }
        else
        {
-               if(Widget *wdg=get_child_at(x, y))
+               if(Widget *wdg = get_child_at(x, y))
                {
-                       click_focus=wdg;
-                       click_button=btn;
+                       click_focus = wdg;
+                       click_button = btn;
 
-                       const Geometry &cgeom=wdg->get_geometry();
+                       const Geometry &cgeom = wdg->get_geometry();
                        wdg->button_press(x-cgeom.x, y-cgeom.y, btn);
                }
        }
@@ -98,19 +98,19 @@ void Container::button_release(int x, int y, unsigned btn)
 {
        if(click_focus)
        {
-               Widget *wdg=click_focus;
+               Widget *wdg = click_focus;
 
                if(btn==click_button)
-                       click_focus=0;
+                       click_focus = 0;
 
-               const Geometry &cgeom=wdg->get_geometry();
+               const Geometry &cgeom = wdg->get_geometry();
                wdg->button_release(x-cgeom.x, y-cgeom.y, btn);
        }
        else
        {
-               if(Widget *wdg=get_child_at(x, y))
+               if(Widget *wdg = get_child_at(x, y))
                {
-                       const Geometry &cgeom=wdg->get_geometry();
+                       const Geometry &cgeom = wdg->get_geometry();
                        wdg->button_release(x-cgeom.x, y-cgeom.y, btn);
                }
        }
@@ -120,15 +120,15 @@ void Container::pointer_motion(int x, int y)
 {
        if(click_focus)
        {
-               const Geometry &cgeom=click_focus->get_geometry();
+               const Geometry &cgeom = click_focus->get_geometry();
                click_focus->pointer_motion(x-cgeom.x, y-cgeom.y);
        }
        else
        {
-               Widget *wdg=get_child_at(x, y);
+               Widget *wdg = get_child_at(x, y);
                if(wdg)
                {
-                       const Geometry &cgeom=wdg->get_geometry();
+                       const Geometry &cgeom = wdg->get_geometry();
                        wdg->pointer_motion(x-cgeom.x, y-cgeom.y);
                }
        }
@@ -137,7 +137,7 @@ void Container::pointer_motion(int x, int y)
 void Container::pointer_leave()
 {
        Widget::pointer_leave();
-       click_focus=0;
+       click_focus = 0;
 }
 
 Container::Child *Container::create_child(Widget *wdg)
@@ -156,13 +156,13 @@ Container::Child::Child(Container &c, Widget *w):
 Container::Child::~Child()
 {
        if(widget==container.click_focus)
-               container.click_focus=0;
+               container.click_focus = 0;
 }
 
 void Container::Child::visibility_changed(bool v)
 {
        if(!v && widget==container.click_focus)
-               container.click_focus=0;
+               container.click_focus = 0;
 }
 
 } // namespace GLtk