-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
/*! \file keyframetree.cpp
** \brief Template File
**
-** $Id: keyframetree.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
*/
/* ========================================================================= */
using namespace std;
using namespace etl;
-using namespace sinfg;
+using namespace synfig;
using namespace studio;
/* === M A C R O S ========================================================= */
KeyframeTree::KeyframeTree()
{
const KeyframeTreeStore::Model model;
-
+
{
Gtk::TreeView::Column* column = Gtk::manage( new Gtk::TreeView::Column(_("Time")) );
cell_renderer_time = Gtk::manage( new CellRenderer_Time() );
column->pack_start(*cell_renderer_time,true);
column->add_attribute(cell_renderer_time->property_time(), model.time);
-
+
cell_renderer_time->signal_edited().connect(sigc::mem_fun(*this,&studio::KeyframeTree::on_edited_time));
column->set_reorderable();
cell_renderer_time_delta = Gtk::manage( new CellRenderer_Time() );
column->pack_start(*cell_renderer_time_delta,true);
column->add_attribute(cell_renderer_time_delta->property_time(), model.time_delta);
-
+
cell_renderer_time_delta->signal_edited().connect(sigc::mem_fun(*this,&studio::KeyframeTree::on_edited_time_delta));
column->set_reorderable();
Gtk::CellRendererText* cell_renderer_jump=Gtk::manage(new Gtk::CellRendererText());
column->pack_start(*cell_renderer_jump,true);
-
+
cell_renderer_jump->property_text()="(JMP)";
cell_renderer_jump->property_foreground()="#003a7f";
-
+
column->set_reorderable();
column->set_resizable();
-
+
column->set_sort_column_id(COLUMNID_JUMP);
column->set_clickable(false);
//append_column_editable(_("Description"),model.description);
{
Gtk::TreeView::Column* column = Gtk::manage( new Gtk::TreeView::Column(_("Description")) );
-
+
cell_renderer_description=Gtk::manage(new Gtk::CellRendererText());
column->pack_start(*cell_renderer_description,true);
column->add_attribute(cell_renderer_description->property_text(), model.description);
// 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);
}
KeyframeTree::~KeyframeTree()
{
- sinfg::info("KeyframeTree::~KeyframeTree(): deleted");
+ synfig::info("KeyframeTree::~KeyframeTree(): deleted");
}
void
{
keyframe_tree_store_=keyframe_tree_store;
KeyframeTreeStore::Model model;
-
+
if(true)
{
Glib::RefPtr<Gtk::TreeModelSort> sorted_store(Gtk::TreeModelSort::create(keyframe_tree_store_));
}
else
Gtk::TreeView::set_model(keyframe_tree_store);
-
+
keyframe_tree_store_->canvas_interface()->signal_rend_desc_changed().connect(
sigc::mem_fun(
*this,
KeyframeTree::set_editable(bool x)
{
editable_=x;
-
+
if(editable_)
{
cell_renderer_time->property_editable()=true;
}
void
-KeyframeTree::on_edited_time(const Glib::ustring&path_string,sinfg::Time time)
+KeyframeTree::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;
}
void
-KeyframeTree::on_edited_time_delta(const Glib::ustring&path_string,sinfg::Time time)
+KeyframeTree::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;
}
KeyframeTree::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;
)
) break;
const Gtk::TreeRow row = *(get_model()->get_iter(path));
-
+
signal_user_click()(event->button.button,row,(ColumnID)column->get_sort_column_id());
if((ColumnID)column->get_sort_column_id()==COLUMNID_JUMP)
{
)
) break;
const Gtk::TreeRow row = *(get_model()->get_iter(path));
-
+
{
keyframe_tree_store_->canvas_interface()->set_time(row[model.time]);
return true;
}
}
break;
-
+
case GDK_BUTTON_RELEASE:
break;
default: