Applied the following dooglus patches from the sourceforge tracker:
[synfig.git] / synfig-studio / trunk / src / gtkmm / state_scale.cpp
index 94525b3..35aca82 100644 (file)
@@ -1,20 +1,21 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file state_scale.cpp
 **     \brief Template File
 **
 **     $Id: state_scale.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
 **
 **     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
 **
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
+**     This package is free software; you can redistribute it and/or
+**     modify it under the terms of the GNU General Public License as
+**     published by the Free Software Foundation; either version 2 of
+**     the License, or (at your option) any later version.
 **
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
+**     This package is distributed in the hope that it will be useful,
+**     but WITHOUT ANY WARRANTY; without even the implied warranty of
+**     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+**     General Public License for more details.
 **     \endlegal
 */
 /* ========================================================================= */
 #include <gtkmm/dialog.h>
 #include <gtkmm/entry.h>
 
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfgapp/action_system.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfigapp/action_system.h>
 
 #include "state_scale.h"
 #include "canvasview.h"
 #include "workarea.h"
 #include "app.h"
 
-#include <sinfgapp/action.h>
+#include <synfigapp/action.h>
 #include "event_mouse.h"
 #include "event_layerclick.h"
 #include "toolbox.h"
 #include "dialog_tooloptions.h"
 #include <gtkmm/optionmenu.h>
 #include "duck.h"
-#include <sinfgapp/main.h>
+#include <synfigapp/main.h>
 
 #endif
 
@@ -54,7 +55,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -68,12 +69,12 @@ StateScale studio::state_scale;
 class DuckDrag_Scale : public DuckDrag_Base
 {
 
-       sinfg::Vector last_scale;
-       sinfg::Vector drag_offset;
-       sinfg::Vector center;
-       sinfg::Vector snap;
+       synfig::Vector last_scale;
+       synfig::Vector drag_offset;
+       synfig::Vector center;
+       synfig::Vector snap;
 
-       std::vector<sinfg::Vector> positions;
+       std::vector<synfig::Vector> positions;
 
        bool move_only;
        
@@ -81,9 +82,9 @@ class DuckDrag_Scale : public DuckDrag_Base
 public:
        bool lock_aspect;
        DuckDrag_Scale();
-       void begin_duck_drag(Duckmatic* duckmatic, const sinfg::Vector& begin);
+       void begin_duck_drag(Duckmatic* duckmatic, const synfig::Vector& begin);
        bool end_duck_drag(Duckmatic* duckmatic);
-       void duck_drag(Duckmatic* duckmatic, const sinfg::Vector& vector);
+       void duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector);
 };
 
 
@@ -91,7 +92,7 @@ class studio::StateScale_Context : public sigc::trackable
 {
        etl::handle<CanvasView> canvas_view_;
                
-       sinfgapp::Settings& settings;
+       synfigapp::Settings& settings;
 
        etl::handle<DuckDrag_Scale> duck_dragger_;
 
@@ -116,8 +117,8 @@ public:
        ~StateScale_Context();
 
        const etl::handle<CanvasView>& get_canvas_view()const{return canvas_view_;}
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
-       sinfg::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
+       synfig::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
        WorkArea * get_work_area()const{return canvas_view_->get_work_area();}
        
        void load_settings();
@@ -155,7 +156,7 @@ StateScale_Context::save_settings()
 
 StateScale_Context::StateScale_Context(CanvasView* canvas_view):
        canvas_view_(canvas_view),
-       settings(sinfgapp::Main::get_selected_input_device()->settings()),
+       settings(synfigapp::Main::get_selected_input_device()->settings()),
        duck_dragger_(new DuckDrag_Scale()),
        checkbutton_aspect_lock(_("Lock Aspect Ratio"))
 {      
@@ -222,7 +223,7 @@ DuckDrag_Scale::DuckDrag_Scale():
 #endif
 
 void
-DuckDrag_Scale::begin_duck_drag(Duckmatic* duckmatic, const sinfg::Vector& offset)
+DuckDrag_Scale::begin_duck_drag(Duckmatic* duckmatic, const synfig::Vector& offset)
 {
        last_scale=Vector(1,1);
        const DuckList selected_ducks(duckmatic->get_selected_ducks());
@@ -266,7 +267,7 @@ DuckDrag_Scale::begin_duck_drag(Duckmatic* duckmatic, const sinfg::Vector& offse
 
 
 void
-DuckDrag_Scale::duck_drag(Duckmatic* duckmatic, const sinfg::Vector& vector)
+DuckDrag_Scale::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector)
 {
        const DuckList selected_ducks(duckmatic->get_selected_ducks());
        DuckList::const_iterator iter;
@@ -275,7 +276,7 @@ DuckDrag_Scale::duck_drag(Duckmatic* duckmatic, const sinfg::Vector& vector)
                return;
        
        //std::set<etl::handle<Duck> >::iterator iter;
-       sinfg::Vector vect(duckmatic->snap_point_to_grid(vector)-center);
+       synfig::Vector vect(duckmatic->snap_point_to_grid(vector)-center);
        last_scale=vect;
 
        if(move_only)