X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Flayertreestore.cpp;h=959582ce3888498283237c13542a4db22d9fd650;hb=756c0d29ac1742f231e6615f9a577e574e35a4af;hp=c76b003c79f6f8d515411a4c2a28b828176276e5;hpb=c74ce4738eff208de3bef4b63929b6975a896e93;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/layertreestore.cpp b/synfig-studio/trunk/src/gtkmm/layertreestore.cpp index c76b003..959582c 100644 --- a/synfig-studio/trunk/src/gtkmm/layertreestore.cpp +++ b/synfig-studio/trunk/src/gtkmm/layertreestore.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2008 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -30,18 +31,19 @@ #endif #include "layertreestore.h" -#include "iconcontroler.h" +#include "iconcontroller.h" #include #include #include #include #include "app.h" #include "instance.h" -#include "iconcontroler.h" #include #include #include +#include "general.h" + #endif /* === U S I N G =========================================================== */ @@ -96,8 +98,8 @@ LayerTreeStore::LayerTreeStore(etl::loose_handle can LayerTreeStore::~LayerTreeStore() { - synfig::info("LayerTreeStore::~LayerTreeStore()q: Deleted"); - + if (getenv("SYNFIG_DEBUG_DESTRUCTORS")) + synfig::info("LayerTreeStore::~LayerTreeStore(): Deleted"); } int @@ -158,8 +160,7 @@ LayerTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colum g_value_init(value.gobj(),x.value_type()); g_value_copy(x.gobj(),value.gobj()); } - else - if(column==model.z_depth.index()) + else if(column==model.z_depth.index()) { synfig::Layer::Handle layer((*iter)[model.layer]); @@ -173,8 +174,7 @@ LayerTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colum g_value_init(value.gobj(),x.value_type()); g_value_copy(x.gobj(),value.gobj()); } - else - if(column==model.children_lock.index()) + else if(column==model.children_lock.index()) { synfig::Layer::Handle layer((*iter)[model.layer]); @@ -191,8 +191,7 @@ LayerTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colum g_value_init(value.gobj(),x.value_type()); g_value_copy(x.gobj(),value.gobj()); } - else - if(column==model.label.index()) + else if(column==model.label.index()) { synfig::Layer::Handle layer((*iter)[model.layer]); @@ -201,18 +200,13 @@ LayerTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colum Glib::Value x; g_value_init(x.gobj(),x.value_type()); - - if(!layer->get_description().empty()) - x.set(layer->get_description()); - else - x.set(layer->get_local_name()); + x.set(layer->get_non_empty_description()); g_value_init(value.gobj(),x.value_type()); //g_value_copy(x.gobj(),value.gobj()); value=x; } - else - if(column==model.tooltip.index()) + else if(column==model.tooltip.index()) { synfig::Layer::Handle layer((*iter)[model.layer]); @@ -228,8 +222,7 @@ LayerTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colum //g_value_copy(x.gobj(),value.gobj()); value=x; } - else - if(column==model.canvas.index()) + else if(column==model.canvas.index()) { synfig::Layer::Handle layer((*iter)[model.layer]); @@ -245,8 +238,7 @@ LayerTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colum //g_value_copy(x.gobj(),value.gobj()); value=x; } - else - if(column==model.active.index()) + else if(column==model.active.index()) { synfig::Layer::Handle layer((*iter)[model.layer]); @@ -260,8 +252,7 @@ LayerTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colum g_value_init(value.gobj(),x.value_type()); g_value_copy(x.gobj(),value.gobj()); } - else - if(column==model.icon.index()) + else if(column==model.icon.index()) { synfig::Layer::Handle layer((*iter)[model.layer]); if(!layer)return; @@ -329,8 +320,7 @@ LayerTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int column, canvas_interface()->get_instance()->perform_action(action); return; } - else - if(column==model.active.index()) + else if(column==model.active.index()) { synfig::Layer::Handle layer((*iter)[model.layer]); @@ -367,7 +357,7 @@ LayerTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int column, bool -LayerTreeStore::row_draggable_vfunc (const TreeModel::Path& path)const +LayerTreeStore::row_draggable_vfunc (const TreeModel::Path& /*path*/)const { //if(!get_iter(path)) return false; // Gtk::TreeModel::Row row(*get_iter(path)); @@ -421,7 +411,7 @@ LayerTreeStore::drag_data_get_vfunc (const TreeModel::Path& path, Gtk::Selection } bool -LayerTreeStore::drag_data_delete_vfunc (const TreeModel::Path& path) +LayerTreeStore::drag_data_delete_vfunc (const TreeModel::Path& /*path*/) { return true; } @@ -450,13 +440,8 @@ LayerTreeStore::row_drop_possible_vfunc (const TreeModel::Path& dest, const Gtk: //dest_canvas=(Canvas::Handle)(row[model.canvas]); return true; } - else - { - if((bool)const_cast(this)->get_iter(dest_parent)) - return (bool)(Canvas::Handle)(*const_cast(this)->get_iter(dest_parent))[model.contained_canvas]; - else - return false; - } + else if((bool)const_cast(this)->get_iter(dest_parent)) + return (bool)(Canvas::Handle)(*const_cast(this)->get_iter(dest_parent))[model.contained_canvas]; } return false; } @@ -521,9 +506,7 @@ LayerTreeStore::drag_data_received_vfunc (const TreeModel::Path& dest, const Gtk continue; if(dest_canvas==src->get_canvas() && src->get_depth()get_canvas()) @@ -540,13 +523,9 @@ LayerTreeStore::drag_data_received_vfunc (const TreeModel::Path& dest, const Gtk action->set_param("new_index",dest_layer_depth); action->set_param("dest_canvas",dest_canvas); if(canvas_interface()->get_instance()->perform_action(action)) - { - //DEBUGPOINT(); ret=true; - } else { - //DEBUGPOINT(); passive_grouper.cancel(); return false; } @@ -598,7 +577,7 @@ LayerTreeStore::drag_data_received_vfunc (const TreeModel::Path& dest, const Gtk */ } } - synfig::info("I suposidly moved %d layers",i); + synfig::info("I supposedly moved %d layers",i); // Reselect the previously selected layers canvas_interface()->get_selection_manager()->set_selected_layers(selected_layer_list); @@ -606,12 +585,6 @@ LayerTreeStore::drag_data_received_vfunc (const TreeModel::Path& dest, const Gtk return ret; } - - - - - - void LayerTreeStore::rebuild() { @@ -741,7 +714,6 @@ LayerTreeStore::set_row_layer(Gtk::TreeRow &row,synfig::Layer::Handle &handle) continue; } - /* etl::handle value_node; if(handle.constant()->dynamic_param_list().count(iter->get_name())) @@ -805,7 +777,6 @@ LayerTreeStore::on_layer_inserted(synfig::Layer::Handle handle,int depth) return; } - Gtk::TreeModel::Children children_(children()); if(canvas_interface()->get_canvas()!=handle->get_canvas()) { @@ -833,11 +804,10 @@ LayerTreeStore::on_layer_inserted(synfig::Layer::Handle handle,int depth) Gtk::TreeModel::Row row(*insert(iter)); set_row_layer(row,handle); - } void -LayerTreeStore::on_layer_status_changed(synfig::Layer::Handle handle,bool x) +LayerTreeStore::on_layer_status_changed(synfig::Layer::Handle handle,bool /*x*/) { Gtk::TreeModel::Children::iterator iter; if(find_layer_row(handle,iter)) @@ -906,7 +876,7 @@ LayerTreeStore::on_layer_raised(synfig::Layer::Handle layer) } void -LayerTreeStore::on_layer_moved(synfig::Layer::Handle layer,int depth, synfig::Canvas::Handle canvas) +LayerTreeStore::on_layer_moved(synfig::Layer::Handle layer,int depth, synfig::Canvas::Handle /*canvas*/) { on_layer_removed(layer); on_layer_inserted(layer,depth); @@ -925,25 +895,21 @@ LayerTreeStore::on_layer_param_changed(synfig::Layer::Handle handle,synfig::Stri } /* - //DEBUGPOINT(); Gtk::TreeModel::Children::iterator iter; if(find_layer_row(handle,iter)) { - //DEBUGPOINT(); Gtk::TreeModel::Children children(iter->children()); for(iter = children.begin(); iter && iter != children.end(); ++iter) { if((Glib::ustring)(*iter)[model.param_name]==param_name) { - //DEBUGPOINT(); Gtk::TreeRow row=*iter; refresh_row(row); return; } } } - //DEBUGPOINT(); rebuild(); */ } @@ -1022,7 +988,7 @@ LayerTreeStore::find_canvas_row(synfig::Canvas::Handle canvas, Gtk::TreeModel::C bool -LayerTreeStore::find_layer_row_(const synfig::Layer::Handle &layer, synfig::Canvas::Handle canvas, Gtk::TreeModel::Children layers, Gtk::TreeModel::Children::iterator &iter, Gtk::TreeModel::Children::iterator &prev) +LayerTreeStore::find_layer_row_(const synfig::Layer::Handle &layer, synfig::Canvas::Handle /*canvas*/, Gtk::TreeModel::Children layers, Gtk::TreeModel::Children::iterator &iter, Gtk::TreeModel::Children::iterator &prev) { assert(layer); @@ -1036,7 +1002,6 @@ LayerTreeStore::find_layer_row_(const synfig::Layer::Handle &layer, synfig::Canv } iter=children().end(); - //DEBUGPOINT(); //return false; }