X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Flayerparamtreestore.cpp;h=af444954b0c68645099c2adb4580bb75bc1df770;hb=e7e1794959f6b4af0d60d69b5501adcd305f2207;hp=c36abad8054742eb8e03d230a6acee238f46828b;hpb=3a3c4bca3a17137bec5d7960560934b91ef4146e;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/layerparamtreestore.cpp b/synfig-studio/trunk/src/gtkmm/layerparamtreestore.cpp index c36abad..af44495 100644 --- a/synfig-studio/trunk/src/gtkmm/layerparamtreestore.cpp +++ b/synfig-studio/trunk/src/gtkmm/layerparamtreestore.cpp @@ -1,20 +1,21 @@ -/* === S I N F G =========================================================== */ +/* === S Y N F I G ========================================================= */ /*! \file childrentreestore.cpp ** \brief Template File ** ** $Id: layerparamtreestore.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 */ /* ========================================================================= */ @@ -31,10 +32,10 @@ #include "layerparamtreestore.h" #include "iconcontroler.h" #include -#include +#include #include "layertree.h" -#include -#include +#include +#include #include "app.h" #include @@ -44,7 +45,7 @@ using namespace std; using namespace etl; -using namespace sinfg; +using namespace synfig; using namespace studio; /* === M A C R O S ========================================================= */ @@ -54,7 +55,7 @@ class Profiler : private etl::clock const std::string name; public: Profiler(const std::string& name):name(name) { reset(); } - ~Profiler() { float time(operator()()); sinfg::info("%s: took %f msec",name.c_str(),time*1000); } + ~Profiler() { float time(operator()()); synfig::info("%s: took %f msec",name.c_str(),time*1000); } }; /* === G L O B A L S ======================================================= */ @@ -70,7 +71,7 @@ static LayerParamTreeStore::Model& ModelHack() return *model; } -LayerParamTreeStore::LayerParamTreeStore(etl::loose_handle canvas_interface_,LayerTree* layer_tree): +LayerParamTreeStore::LayerParamTreeStore(etl::loose_handle canvas_interface_,LayerTree* layer_tree): Gtk::TreeStore (ModelHack()), CanvasTreeStore (canvas_interface_), layer_tree (layer_tree) @@ -100,11 +101,11 @@ LayerParamTreeStore::~LayerParamTreeStore() changed_connection_list.back().disconnect(); changed_connection_list.pop_back(); } - sinfg::info("LayerParamTreeStore::~LayerParamTreeStore(): Deleted"); + synfig::info("LayerParamTreeStore::~LayerParamTreeStore(): Deleted"); } Glib::RefPtr -LayerParamTreeStore::create(etl::loose_handle canvas_interface_, LayerTree*layer_tree) +LayerParamTreeStore::create(etl::loose_handle canvas_interface_, LayerTree*layer_tree) { return Glib::RefPtr(new LayerParamTreeStore(canvas_interface_,layer_tree)); } @@ -116,13 +117,13 @@ LayerParamTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int { if(column<0) { - sinfg::error("LayerParamTreeStore::get_value_vfunc(): Bad column!"); + synfig::error("LayerParamTreeStore::get_value_vfunc(): Bad column!"); return; } /* if(column==model.label.index()) { - sinfg::Layer::Handle layer((*iter)[model.layer]); + synfig::Layer::Handle layer((*iter)[model.layer]); if(!layer)return; @@ -142,12 +143,12 @@ LayerParamTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int */ if(column==model.label.index()) { - sinfgapp::ValueDesc value_desc((*iter)[model.value_desc]); + synfigapp::ValueDesc value_desc((*iter)[model.value_desc]); Glib::ustring label; if(!(*iter)[model.is_toplevel]) return CanvasTreeStore::get_value_vfunc(iter,column,value); - sinfg::ParamDesc param_desc((*iter)[model.param_desc]); + synfig::ParamDesc param_desc((*iter)[model.param_desc]); label=param_desc.get_local_name(); if(!(*iter)[model.is_inconsistent]) @@ -222,21 +223,21 @@ LayerParamTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int co { if(column==model.value.index()) { - Glib::Value x; + Glib::Value x; g_value_init(x.gobj(),model.value.type()); g_value_copy(value.gobj(),x.gobj()); if((bool)(*iter)[model.is_toplevel]) { - sinfgapp::Action::PassiveGrouper group(canvas_interface()->get_instance().get(),_("Set Layer Params")); + synfigapp::Action::PassiveGrouper group(canvas_interface()->get_instance().get(),_("Set Layer Params")); - sinfg::ParamDesc param_desc((*iter)[model.param_desc]); + synfig::ParamDesc param_desc((*iter)[model.param_desc]); LayerList::iterator iter2(layer_list.begin()); for(;iter2!=layer_list.end();++iter2) { - if(!canvas_interface()->change_value(sinfgapp::ValueDesc(*iter2,param_desc.get_name()),x.get())) + if(!canvas_interface()->change_value(synfigapp::ValueDesc(*iter2,param_desc.get_name()),x.get())) { // ERROR! group.cancel(); @@ -256,7 +257,7 @@ LayerParamTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int co /* if(column==model.active.index()) { - sinfg::Layer::Handle layer((*iter)[model.layer]); + synfig::Layer::Handle layer((*iter)[model.layer]); if(!layer)return; @@ -264,7 +265,7 @@ LayerParamTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int co g_value_init(x.gobj(),model.active.type()); g_value_copy(value.gobj(),x.gobj()); - sinfgapp::Action::Handle action(sinfgapp::Action::create("layer_activate")); + synfigapp::Action::Handle action(synfigapp::Action::create("layer_activate")); if(!action) return; @@ -320,7 +321,7 @@ LayerParamTreeStore::rebuild() { ParamVocab vocab; - static ParamVocab::iterator find_param_desc(ParamVocab& vocab, const sinfg::String& x) + static ParamVocab::iterator find_param_desc(ParamVocab& vocab, const synfig::String& x) { ParamVocab::iterator iter; @@ -384,7 +385,7 @@ LayerParamTreeStore::rebuild() } */ Gtk::TreeRow row(*(append())); - sinfgapp::ValueDesc value_desc(layer_list.front(),iter->get_name()); + synfigapp::ValueDesc value_desc(layer_list.front(),iter->get_name()); CanvasTreeStore::set_row(row,value_desc); if(value_desc.is_value_node()) { @@ -508,7 +509,7 @@ LayerParamTreeStore::refresh_row(Gtk::TreeModel::Row &row) } void -LayerParamTreeStore::set_row(Gtk::TreeRow row,sinfgapp::ValueDesc value_desc) +LayerParamTreeStore::set_row(Gtk::TreeRow row,synfigapp::ValueDesc value_desc) { Gtk::TreeModel::Children children = row.children(); while(!children.empty() && erase(children.begin())); @@ -529,13 +530,13 @@ LayerParamTreeStore::on_value_node_deleted(etl::handle value_node) } void -LayerParamTreeStore::on_value_node_child_added(sinfg::ValueNode::Handle value_node,sinfg::ValueNode::Handle child) +LayerParamTreeStore::on_value_node_child_added(synfig::ValueNode::Handle value_node,synfig::ValueNode::Handle child) { queue_rebuild(); } void -LayerParamTreeStore::on_value_node_child_removed(sinfg::ValueNode::Handle value_node,sinfg::ValueNode::Handle child) +LayerParamTreeStore::on_value_node_child_removed(synfig::ValueNode::Handle value_node,synfig::ValueNode::Handle child) { queue_rebuild(); } @@ -547,13 +548,13 @@ LayerParamTreeStore::on_value_node_changed(etl::handle value_node) } void -LayerParamTreeStore::on_value_node_replaced(sinfg::ValueNode::Handle replaced_value_node,sinfg::ValueNode::Handle new_value_node) +LayerParamTreeStore::on_value_node_replaced(synfig::ValueNode::Handle replaced_value_node,synfig::ValueNode::Handle new_value_node) { queue_rebuild(); } void -LayerParamTreeStore::on_layer_param_changed(sinfg::Layer::Handle handle,sinfg::String param_name) +LayerParamTreeStore::on_layer_param_changed(synfig::Layer::Handle handle,synfig::String param_name) { queue_refresh(); }