Added copyright lines for files I've edited this year.
[synfig.git] / synfig-studio / trunk / src / gtkmm / state_draw.cpp
index 9782f91..b8c90f3 100644 (file)
@@ -62,6 +62,8 @@
 #include <gtkmm/scale.h>
 #include <sigc++/connection.h>
 
+#include "general.h"
+
 #endif
 
 /* === U S I N G =========================================================== */
@@ -97,7 +99,7 @@ class studio::StateDraw_Context : public sigc::trackable
        bool prev_workarea_layer_status_;
 
        int nested;
-       SigC::Connection process_queue_connection;
+       sigc::connection process_queue_connection;
 
        ValueNode_BLine::Handle last_stroke;
        synfig::String last_stroke_id;
@@ -366,7 +368,10 @@ StateDraw_Context::increment_id()
        if(id[id.size()-1]<='9' && id[id.size()-1]>='0')
        {
                // figure out how many digits it is
-               for(digits=0;(int)id.size()-1>=digits && id[id.size()-1-digits]<='9' && id[id.size()-1-digits]>='0';digits++)while(false);
+               for (digits = 0;
+                        (int)id.size()-1 >= digits && id[id.size()-1-digits] <= '9' && id[id.size()-1-digits] >= '0';
+                        digits++)
+                       ;
 
                String str_number;
                str_number=String(id,id.size()-digits,id.size());
@@ -820,6 +825,7 @@ StateDraw_Context::new_bline(std::list<synfig::BLinePoint> bline,bool loop_bline
                        // don't extend looped blines
                        if(finish_duck_value_node_bline&&!finish_duck_value_node_bline->get_loop()&&
                           (finish_duck_index==0||finish_duck_index==finish_duck_value_node_bline->link_count()-1))
+                       {
                                if(extend_start)
                                {
                                        // we've started and finished drawing at the end of a bline.  we can't
@@ -832,6 +838,7 @@ StateDraw_Context::new_bline(std::list<synfig::BLinePoint> bline,bool loop_bline
                                        shift_offset=true;
                                        shift_offset_vector=finish_duck->get_origin();
                                }
+                       }
                }while(0);
 
                // if the new line's start didn't extend an existing line,
@@ -1230,10 +1237,12 @@ debug_show_vertex_list(int iteration, std::list<synfigapp::ValueDesc>& vertex_li
        {
                if (started) printf(", "); else started = true;
                if (start != -1)
+               {
                        if (dir != 0)
                                printf("%d--%d", start, prev);
                        else
                                printf("%d", start);
+               }
                printf(")");
        }
        printf("\n");
@@ -1386,12 +1395,14 @@ StateDraw_Context::new_region(std::list<synfig::BLinePoint> bline, synfig::Real
                                this_index = iter->get_index();
                                // printf("index went from %d to %d\n", last_index, this_index);
                                if (looped)
+                               {
                                        if (this_index - last_index > points_in_line/2)
                                                while (this_index - last_index > points_in_line/2)
                                                        this_index -= points_in_line;
                                        else if (last_index - this_index > points_in_line/2)
                                                while (last_index - this_index > points_in_line/2)
                                                        this_index += points_in_line;
+                               }
 
                                if (this_index < min_index) min_index = this_index;
                                if (this_index > max_index) max_index = this_index;
@@ -1520,7 +1531,6 @@ StateDraw_Context::new_region(std::list<synfig::BLinePoint> bline, synfig::Real
                                  if(value_prev.get_parent_value_node()==value_next.get_parent_value_node() &&
                                  value_prev.get_parent_value_node()!=value_desc.get_parent_value_node())
                                  {
-                                 DEBUGPOINT();
                                  vertex_list.erase(iter);
                                  done=false;
                                  break;
@@ -1535,7 +1545,6 @@ StateDraw_Context::new_region(std::list<synfig::BLinePoint> bline, synfig::Real
                                // if(value_prev.get_value_node()==value_desc.get_value_node() ||
                                //    value_desc.get_value_node()==value_next.get_value_node())
                                // {
-                               //      // DEBUGPOINT();
                                //      vertex_list.erase(iter);
                                //      done=false;
                                //      printf("erased node - i = %d\n", i);
@@ -1545,7 +1554,6 @@ StateDraw_Context::new_region(std::list<synfig::BLinePoint> bline, synfig::Real
                                // // if previous is the same as next, remove previous?  or next?
                                // if(value_prev.get_value_node()==value_next.get_value_node())
                                // {
-                               //      // DEBUGPOINT();
                                //      vertex_list.erase(next);
                                //      // vertex_list.erase(prev);
                                //      done=false;
@@ -1574,7 +1582,6 @@ StateDraw_Context::new_region(std::list<synfig::BLinePoint> bline, synfig::Real
                                                //                                                         strprintf("same parent, different points this %d < next-1 %d",
                                                //                                                                               value_desc.get_index(), ((value_next.get_index()-1))),
                                                //                                                         current);
-                                               //              // DEBUGPOINT();
                                                //              for (int index = value_desc.get_index()+1; index < value_next.get_index(); index++)
                                                //              {
                                                //                      printf("inserting up %d\n", index);
@@ -1590,7 +1597,6 @@ StateDraw_Context::new_region(std::list<synfig::BLinePoint> bline, synfig::Real
                                                //                                                         strprintf("same parent, different points next %d < this-1 %d",
                                                //                                                                               value_next.get_index(), ((value_desc.get_index()-1))),
                                                //                                                         current);
-                                               //              // DEBUGPOINT();
                                                //              for (int index = value_desc.get_index()-1; index > value_next.get_index(); index--)
                                                //              {
                                                //                      printf("inserting down %d\n", index);
@@ -1630,7 +1636,6 @@ StateDraw_Context::new_region(std::list<synfig::BLinePoint> bline, synfig::Real
                                                        if((vertex.get_vertex()-vertex_next.get_vertex()).mag_squared()<radius*radius)
                                                        {
                                                                printf("in one - it's close\n");
-                                                               // DEBUGPOINT();
                                                                ValueNode_Composite::Handle value_node;
                                                                ValueNode_Composite::Handle value_node_next;
                                                                value_node=ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node().clone());
@@ -1640,7 +1645,6 @@ StateDraw_Context::new_region(std::list<synfig::BLinePoint> bline, synfig::Real
                                                                        synfig::info(__FILE__":%d: Unable to properly connect blines.",__LINE__);
                                                                        continue;
                                                                }
-                                                               // DEBUGPOINT();
                                                                // \todo if next isn't split, don't we want to copy its 'Tangent 1' instead?
                                                                value_node->set_link(5,value_node_next->get_link(5)); // Tangent 2
                                                                value_node->set_link(3,ValueNode_Const::create(true)); // Split Tangents
@@ -1661,7 +1665,6 @@ StateDraw_Context::new_region(std::list<synfig::BLinePoint> bline, synfig::Real
                                                        else if (value_prev.parent_is_value_node())
                                                        {
                                                                printf("in two - it's far\n");
-                                                               // DEBUGPOINT();
                                                                // \todo this only makes sense if prev is on the same bline
                                                                printf("this is index %d\n", value_desc.get_index());
                                                                printf("prev is index %d\n", value_prev.get_index());
@@ -1677,7 +1680,6 @@ StateDraw_Context::new_region(std::list<synfig::BLinePoint> bline, synfig::Real
                                                                        if (value_desc.get_index()<LinkableValueNode::Handle::cast_static(value_desc.get_parent_value_node())->link_count()-1)
                                                                        {
                                                                                printf("in two - b\n");
-                                                                               // DEBUGPOINT();
                                                                                printf("inserting node with index %d\n", value_desc.get_index()+1);
                                                                                vertex_list.insert(next,
                                                                                                                   synfigapp::ValueDesc(value_desc.get_parent_value_node(),
@@ -1692,7 +1694,6 @@ StateDraw_Context::new_region(std::list<synfig::BLinePoint> bline, synfig::Real
                                                                        if(value_desc.get_index()>0)
                                                                        {
                                                                                printf("in two - a\n");
-                                                                               // DEBUGPOINT();
                                                                                printf("inserting node on this line with index %d\n",
                                                                                           value_desc.get_index()-1);
                                                                                vertex_list.insert(next,