X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fstate_rotate.cpp;h=4d96ed7121da02391a30db108643cf82ca4b6f44;hb=e7e1794959f6b4af0d60d69b5501adcd305f2207;hp=67614827702b98ac4af04a6a188a9aac2f965923;hpb=3a3c4bca3a17137bec5d7960560934b91ef4146e;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/state_rotate.cpp b/synfig-studio/trunk/src/gtkmm/state_rotate.cpp index 6761482..4d96ed7 100644 --- a/synfig-studio/trunk/src/gtkmm/state_rotate.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_rotate.cpp @@ -1,20 +1,21 @@ -/* === S I N F G =========================================================== */ +/* === S Y N F I G ========================================================= */ /*! \file state_rotate.cpp ** \brief Template File ** ** $Id: state_rotate.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 */ /* ========================================================================= */ @@ -31,23 +32,23 @@ #include #include -#include -#include +#include +#include #include "state_rotate.h" #include "canvasview.h" #include "workarea.h" #include "app.h" -#include +#include #include "event_mouse.h" #include "event_layerclick.h" #include "toolbox.h" #include "dialog_tooloptions.h" #include #include "duck.h" -#include -#include +#include +#include #endif @@ -55,7 +56,7 @@ using namespace std; using namespace etl; -using namespace sinfg; +using namespace synfig; using namespace studio; /* === M A C R O S ========================================================= */ @@ -73,15 +74,15 @@ StateRotate studio::state_rotate; class DuckDrag_Rotate : public DuckDrag_Base { - sinfg::Vector last_rotate; - sinfg::Vector drag_offset; - sinfg::Vector center; - sinfg::Vector snap; + synfig::Vector last_rotate; + synfig::Vector drag_offset; + synfig::Vector center; + synfig::Vector snap; Angle original_angle; Real original_mag; - std::vector positions; + std::vector positions; bool bad_drag; @@ -91,11 +92,11 @@ public: etl::handle canvas_view_; bool use_magnitude; DuckDrag_Rotate(); - 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); - etl::handle get_canvas_interface()const{return canvas_view_->canvas_interface();} + etl::handle get_canvas_interface()const{return canvas_view_->canvas_interface();} }; @@ -103,7 +104,7 @@ class studio::StateRotate_Context : public sigc::trackable { etl::handle canvas_view_; - sinfgapp::Settings& settings; + synfigapp::Settings& settings; etl::handle duck_dragger_; @@ -128,8 +129,8 @@ public: ~StateRotate_Context(); const etl::handle& get_canvas_view()const{return canvas_view_;} - etl::handle get_canvas_interface()const{return canvas_view_->canvas_interface();} - sinfg::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();} + etl::handle 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(); @@ -167,7 +168,7 @@ StateRotate_Context::save_settings() StateRotate_Context::StateRotate_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_Rotate()), checkbutton_scale(_("Allow Scale")) { @@ -233,7 +234,7 @@ DuckDrag_Rotate::DuckDrag_Rotate() } void -DuckDrag_Rotate::begin_duck_drag(Duckmatic* duckmatic, const sinfg::Vector& offset) +DuckDrag_Rotate::begin_duck_drag(Duckmatic* duckmatic, const synfig::Vector& offset) { last_rotate=Vector(1,1); @@ -277,20 +278,20 @@ DuckDrag_Rotate::begin_duck_drag(Duckmatic* duckmatic, const sinfg::Vector& offs move_only=false; - sinfg::Vector vect(offset-center); + synfig::Vector vect(offset-center); original_angle=Angle::tan(vect[1],vect[0]); original_mag=vect.mag(); } void -DuckDrag_Rotate::duck_drag(Duckmatic* duckmatic, const sinfg::Vector& vector) +DuckDrag_Rotate::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector) { if(bad_drag) return; //std::set >::iterator iter; - sinfg::Vector vect(duckmatic->snap_point_to_grid(vector)-center+snap); + synfig::Vector vect(duckmatic->snap_point_to_grid(vector)-center+snap); const DuckList selected_ducks(duckmatic->get_selected_ducks()); DuckList::const_iterator iter; @@ -363,12 +364,12 @@ DuckDrag_Rotate::end_duck_drag(Duckmatic* duckmatic) if(bad_drag)return false; if(move_only) { - sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Move Duck")); + synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Move Duck")); duckmatic->signal_edited_selected_ducks(); return true; } - sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Rotate Ducks")); + synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Rotate Ducks")); if((last_rotate-Vector(1,1)).mag()>0.0001) {