X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftags%2Fstable%2Fsrc%2Fgtkmm%2Flayergrouptree.cpp;h=9fcc62b74cc3c93cfb1f565cbc7f81b048211a94;hb=a42ee14a3397a3fbb31d14e6eece4236620ae2db;hp=88dc5fe0ec03b70bc3b213037ca5cbaa1513d54e;hpb=7c6d5426922cb3cda793f688dcd4d534b02765c8;p=synfig.git diff --git a/synfig-studio/tags/stable/src/gtkmm/layergrouptree.cpp b/synfig-studio/tags/stable/src/gtkmm/layergrouptree.cpp index 88dc5fe..9fcc62b 100644 --- a/synfig-studio/tags/stable/src/gtkmm/layergrouptree.cpp +++ b/synfig-studio/tags/stable/src/gtkmm/layergrouptree.cpp @@ -1,20 +1,21 @@ -/* === S I N F G =========================================================== */ +/* === S Y N F I G ========================================================= */ /*! \file layergrouptree.cpp ** \brief Template File ** -** $Id: layergrouptree.cpp,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $ +** $Id$ ** ** \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 */ /* ========================================================================= */ @@ -28,7 +29,7 @@ # include #endif -#include +#include #include "layergrouptree.h" #include #include @@ -39,7 +40,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 @@ LayerGroupTree::LayerGroupTree() { const LayerGroupTreeStore::Model model; - + { // --- O N / O F F ---------------------------------------------------- int index; index=append_column_editable(_(" "),model.active); @@ -77,7 +78,7 @@ LayerGroupTree::LayerGroupTree() //column->set_reorderable(); //column->set_resizable(); //column->set_clickable(false); - + //Gtk::CellRendererPixbuf* icon_cellrenderer = Gtk::manage( new Gtk::CellRendererPixbuf() ); //column->pack_start(*icon_cellrenderer,false); //column->add_attribute(icon_cellrenderer->property_pixbuf(), layer_model.icon); @@ -89,7 +90,7 @@ LayerGroupTree::LayerGroupTree() // This makes things easier to read. set_rules_hint(); - + // Make us more sensitive to several events add_events(Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::BUTTON1_MOTION_MASK | Gdk::BUTTON2_MOTION_MASK|Gdk::POINTER_MOTION_MASK); @@ -107,7 +108,7 @@ LayerGroupTree::LayerGroupTree() LayerGroupTree::~LayerGroupTree() { - sinfg::info("LayerGroupTree::~LayerGroupTree(): deleted"); + synfig::info("LayerGroupTree::~LayerGroupTree(): deleted"); } void @@ -115,7 +116,7 @@ LayerGroupTree::set_model(Glib::RefPtr layer_group_tree_sto { layer_group_tree_store_=layer_group_tree_store; LayerGroupTreeStore::Model model; - + #if 0 { Glib::RefPtr sorted_store(Gtk::TreeModelSort::create(layer_group_tree_store_)); @@ -133,7 +134,7 @@ void LayerGroupTree::set_editable(bool x) { editable_=x; -/* +/* if(editable_) { cell_renderer_time->property_editable()=true; @@ -150,13 +151,13 @@ LayerGroupTree::set_editable(bool x) } /* void -LayerGroupTree::on_edited_time(const Glib::ustring&path_string,sinfg::Time time) +LayerGroupTree::on_edited_time(const Glib::ustring&path_string,synfig::Time time) { Gtk::TreePath path(path_string); - + const Gtk::TreeRow row(*(get_model()->get_iter(path))); - - sinfg::Keyframe keyframe(row[model.keyframe]); + + synfig::Keyframe keyframe(row[model.keyframe]); if(time!=keyframe.get_time()) { row[model.time]=time; @@ -167,12 +168,12 @@ LayerGroupTree::on_edited_time(const Glib::ustring&path_string,sinfg::Time time) } void -LayerGroupTree::on_edited_time_delta(const Glib::ustring&path_string,sinfg::Time time) +LayerGroupTree::on_edited_time_delta(const Glib::ustring&path_string,synfig::Time time) { Gtk::TreePath path(path_string); - + const Gtk::TreeRow row(*(get_model()->get_iter(path))); - + if(row)row[model.time_delta]=time; } @@ -180,11 +181,11 @@ void LayerGroupTree::on_edited_description(const Glib::ustring&path_string,const Glib::ustring &desc) { Gtk::TreePath path(path_string); - + const Gtk::TreeRow row = *(get_model()->get_iter(path)); - - const sinfg::String description(desc); - sinfg::Keyframe keyframe(row[model.keyframe]); + + const synfig::String description(desc); + synfig::Keyframe keyframe(row[model.keyframe]); if(description!=keyframe.get_description()) { row[model.description]=desc; @@ -221,7 +222,7 @@ LayerGroupTree::on_event(GdkEvent *event) signal_popup_layer_menu()((Layer::Handle)row[model.layer]); return true; } - + /*signal_user_click()(event->button.button,row,(ColumnID)column->get_sort_column_id()); if((ColumnID)column->get_sort_column_id()==COLUMNID_JUMP) { @@ -242,7 +243,7 @@ LayerGroupTree::on_event(GdkEvent *event) ) ) break; const Gtk::TreeRow row = *(get_model()->get_iter(path)); - + LayerList layer_list(row[model.all_layers]); if(!layer_list.empty()) { @@ -264,22 +265,22 @@ LayerGroupTree::on_event(GdkEvent *event) //return false; } -static inline void __group_grabber(const Gtk::TreeModel::iterator& iter, std::list* ret) +static inline void __group_grabber(const Gtk::TreeModel::iterator& iter, std::list* ret) { const LayerGroupTreeStore::Model model; if((bool)(*iter)[model.is_group]) ret->push_back((Glib::ustring)(*iter)[model.group_name]); } -std::list +std::list LayerGroupTree::get_selected_groups()const { Glib::RefPtr selection=const_cast(*this).get_selection(); if(!selection) - return std::list(); + return std::list(); - std::list ret; + std::list ret; selection->selected_foreach_iter( sigc::bind(