X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Flayeractionmanager.cpp;h=6d14b73460d5e7915c280bee4fe828e196568257;hb=74d03302d1e6f05f1f90d4c2a3b38a03aa51dc86;hp=5f1c5da7bcc97edc71688d1edb0755a9550838e2;hpb=3a3c4bca3a17137bec5d7960560934b91ef4146e;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/layeractionmanager.cpp b/synfig-studio/trunk/src/gtkmm/layeractionmanager.cpp index 5f1c5da..6d14b73 100644 --- a/synfig-studio/trunk/src/gtkmm/layeractionmanager.cpp +++ b/synfig-studio/trunk/src/gtkmm/layeractionmanager.cpp @@ -1,20 +1,21 @@ -/* === S I N F G =========================================================== */ +/* === S Y N F I G ========================================================= */ /*! \file template.cpp ** \brief Template File ** ** $Id: layeractionmanager.cpp,v 1.1.1.1 2005/01/07 03:34:36 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 */ /* ========================================================================= */ @@ -30,9 +31,9 @@ #include "layeractionmanager.h" #include "layertree.h" -#include +#include #include "instance.h" -#include +#include #endif @@ -40,7 +41,7 @@ using namespace std; using namespace etl; -using namespace sinfg; +using namespace synfig; using namespace studio; static const guint no_prev_popup((guint)-1); @@ -158,7 +159,7 @@ LayerActionManager::set_layer_tree(LayerTree* x) } void -LayerActionManager::set_canvas_interface(const etl::handle &x) +LayerActionManager::set_canvas_interface(const etl::handle &x) { canvas_interface_=x; } @@ -222,7 +223,7 @@ LayerActionManager::refresh() // Make sure we are ready if(!ui_manager_ || !layer_tree_ || !canvas_interface_) { - sinfg::error("LayerActionManager::refresh(): Not ready!"); + synfig::error("LayerActionManager::refresh(): Not ready!"); return; } @@ -239,12 +240,12 @@ LayerActionManager::refresh() { bool canvas_set(false); - sinfgapp::Action::ParamList param_list; + synfigapp::Action::ParamList param_list; param_list.add("time",get_canvas_interface()->get_time()); param_list.add("canvas_interface",get_canvas_interface()); { - sinfgapp::SelectionManager::LayerList layer_list(layer_tree_->get_selected_layers()); - sinfgapp::SelectionManager::LayerList::iterator iter; + synfigapp::SelectionManager::LayerList layer_list(layer_tree_->get_selected_layers()); + synfigapp::SelectionManager::LayerList::iterator iter; action_copy_->set_sensitive(!layer_list.empty()); action_cut_->set_sensitive(!layer_list.empty()); action_group_->add(action_copy_); @@ -296,7 +297,7 @@ LayerActionManager::refresh() ui_info+=""; } handle::cast_static(get_canvas_interface()->get_instance())-> - add_actions_to_group(action_group_, ui_info, param_list, sinfgapp::Action::CATEGORY_LAYER); + add_actions_to_group(action_group_, ui_info, param_list, synfigapp::Action::CATEGORY_LAYER); } } @@ -320,9 +321,9 @@ LayerActionManager::cut() void LayerActionManager::copy() { - sinfgapp::SelectionManager::LayerList layer_list(layer_tree_->get_selected_layers()); + synfigapp::SelectionManager::LayerList layer_list(layer_tree_->get_selected_layers()); clipboard_.clear(); - sinfg::GUID guid; + synfig::GUID guid; while(!layer_list.empty()) { @@ -338,10 +339,10 @@ LayerActionManager::copy() void LayerActionManager::paste() { - sinfg::GUID guid; + synfig::GUID guid; // Create the action group - sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Paste")); + synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Paste")); Canvas::Handle canvas(get_canvas_interface()->get_canvas()); int depth(0); @@ -354,20 +355,20 @@ LayerActionManager::paste() canvas=layer->get_canvas(); } - sinfgapp::SelectionManager::LayerList layer_selection; + synfigapp::SelectionManager::LayerList layer_selection; - for(std::list::iterator iter=clipboard_.begin();iter!=clipboard_.end();++iter) + for(std::list::iterator iter=clipboard_.begin();iter!=clipboard_.end();++iter) { layer=(*iter)->clone(guid); layer_selection.push_back(layer); - sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_add")); + synfigapp::Action::Handle action(synfigapp::Action::create("layer_add")); assert(action); if(!action) return; action->set_param("canvas",canvas); - action->set_param("canvas_interface",etl::loose_handle(get_canvas_interface())); + action->set_param("canvas_interface",etl::loose_handle(get_canvas_interface())); action->set_param("new",layer); if(!action->is_ready()) @@ -380,18 +381,18 @@ LayerActionManager::paste() return; } - sinfg::info("DEPTH=%d",depth); + synfig::info("DEPTH=%d",depth); // Action to move the layer (if necessary) if(depth>0) { - sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_move")); + synfigapp::Action::Handle action(synfigapp::Action::create("layer_move")); assert(action); if(!action) return; action->set_param("canvas",canvas); - action->set_param("canvas_interface",etl::loose_handle(get_canvas_interface())); + action->set_param("canvas_interface",etl::loose_handle(get_canvas_interface())); action->set_param("layer",layer); action->set_param("new_index",depth); @@ -421,19 +422,19 @@ LayerActionManager::amount_inc() float adjust(0.1); // Create the action group - sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Decrease Amount")); + synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Decrease Amount")); if(adjust>0) group.set_name(_("Increase Amount")); - sinfgapp::SelectionManager::LayerList layer_list(layer_tree_->get_selected_layers()); + synfigapp::SelectionManager::LayerList layer_list(layer_tree_->get_selected_layers()); while(!layer_list.empty()) { ValueBase value(layer_list.front()->get_param("amount")); if(value.same_as(Real())) { - get_canvas_interface()->change_value(sinfgapp::ValueDesc(layer_list.front(),"amount"),value.get(Real())+adjust); + get_canvas_interface()->change_value(synfigapp::ValueDesc(layer_list.front(),"amount"),value.get(Real())+adjust); } layer_list.pop_front(); } @@ -445,19 +446,19 @@ LayerActionManager::amount_dec() float adjust(-0.1); // Create the action group - sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Decrease Amount")); + synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Decrease Amount")); if(adjust>0) group.set_name(_("Increase Amount")); - sinfgapp::SelectionManager::LayerList layer_list(layer_tree_->get_selected_layers()); + synfigapp::SelectionManager::LayerList layer_list(layer_tree_->get_selected_layers()); while(!layer_list.empty()) { ValueBase value(layer_list.front()->get_param("amount")); if(value.same_as(Real())) { - get_canvas_interface()->change_value(sinfgapp::ValueDesc(layer_list.front(),"amount"),value.get(Real())+adjust); + get_canvas_interface()->change_value(synfigapp::ValueDesc(layer_list.front(),"amount"),value.get(Real())+adjust); } layer_list.pop_front(); }