**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+** Copyright (c) 2007 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
{
// assert(view->layer_tree);
- if(!view->layer_tree) { DEBUGPOINT(); synfig::error("canvas_view.layer_tree not defined!?"); return LayerList(); }
+ if(!view->layer_tree) { DEBUGPOINT(); synfig::error("%s:%d canvas_view.layer_tree not defined!?", __FILE__, __LINE__); return LayerList(); }
return view->layer_tree->get_selected_layers();
}
{
// assert(view->layer_tree);
- if(!view->layer_tree) { DEBUGPOINT(); synfig::error("canvas_view.layer_tree not defined!?"); return 0; }
+ if(!view->layer_tree) { DEBUGPOINT(); synfig::error("%s:%d canvas_view.layer_tree not defined!?", __FILE__, __LINE__); return 0; }
return view->layer_tree->get_selected_layer();
}
{
// assert(view->layer_tree);
- if(!view->layer_tree) { DEBUGPOINT(); synfig::error("canvas_view.layer_tree not defined!?"); return; }
+ if(!view->layer_tree) { DEBUGPOINT(); synfig::error("%s:%d canvas_view.layer_tree not defined!?", __FILE__, __LINE__); return; }
view->layer_tree->select_layers(layer_list);
//view->get_smach().process_event(EVENT_REFRESH_DUCKS);
}
//! Sets which value_nodes should be selected
- virtual void set_selected_children(const ChildrenList &children_list)
+ virtual void set_selected_children(const ChildrenList &/*children_list*/)
{
return;
}
//! Sets which value_node should be selected. Empty handle if none.
- virtual void set_selected_child(const ChildrenList::value_type &child)
+ virtual void set_selected_child(const ChildrenList::value_type &/*child*/)
{
return;
}
return get_selected_layer_parameters().front();
}
- void set_selected_layer_parameters(const LayerParamList &layer_param_list)
+ void set_selected_layer_parameters(const LayerParamList &/*layer_param_list*/)
{
return;
}
- void set_selected_layer_param(const LayerParam &layer_param)
+ void set_selected_layer_param(const LayerParam &/*layer_param*/)
{
return;
}
// If the canvas is really big, zoom out so that we can fit it all in the window
/*! \todo In other words, this is a zoom-to-fit, and should be
- ** in it's own function.
+ ** in its own function.
*/
int w=get_canvas()->rend_desc().get_w()+70;
int h=get_canvas()->rend_desc().get_h()+70;
while(w>700 || h>600)
{
+ // Minor hack:
+ // zoom_out() =>
+ // WorkArea::async_update_preview() =>
+ // WorkArea::set_zoom(float) =>
+ // WorkArea::async_update_preview() =>
+ // desc.set_time(cur_time), where cur_time isn't initialised
+ work_area->set_time(0);
work_area->zoom_out();
w=round_to_int(get_canvas()->rend_desc().get_w()*work_area->get_zoom()+70);
h=round_to_int(get_canvas()->rend_desc().get_h()*work_area->get_zoom()+70);
hide();
+ // don't be calling on_dirty_preview once this object has been deleted;
+ // this was causing a crash before
+ canvas_interface()->signal_dirty_preview().clear();
+
synfig::info("CanvasView:~CanvasView(): Destructor Finished");
}
Gtk::Table *table= manage(new class Gtk::Table(2, 3, false));
//setup the audio display
- disp_audio->set_size_request(-1,32); //disp_audio.show();
+ disp_audio->set_size_request(-1,32); //disp_audio->show();
disp_audio->set_time_adjustment(&time_adjustment());
disp_audio->signal_start_scrubbing().connect(
sigc::mem_fun(*audio,&AudioContainer::start_scrubbing)
{
Glib::RefPtr<Gtk::RadioAction> action(Gtk::RadioAction::create(quality_group,strprintf("quality-%02d",i), strprintf("Set Quality to %d",i)));
if(i==10)
- action->property_value()=10;
+ {
+ action->set_active();
+ work_area->set_quality(i);
+ }
action_group->add( action,
sigc::bind(
sigc::mem_fun(*work_area, &studio::WorkArea::set_quality),
}
}
- action_group->add( Gtk::Action::create("play", Gtk::StockID("synfig-play")),
+ action_group->add( Gtk::Action::create("play", Gtk::Stock::MEDIA_PLAY),
sigc::mem_fun(*this, &studio::CanvasView::play)
);
action=Gtk::Action::create("seek-prev-frame", Gtk::Stock::GO_BACK,_("Prev Frame"),_("Prev Frame"));
action_group->add( action, sigc::bind(sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::seek_frame),-1));
- action=Gtk::Action::create("seek-next-second", Gtk::Stock::GO_FORWARD,_("Seek Foward"),_("Seek Foward"));
+ action=Gtk::Action::create("seek-next-second", Gtk::Stock::GO_FORWARD,_("Seek Forward"),_("Seek Forward"));
action_group->add(action,sigc::bind(sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::seek_time),Time(1)));
action=Gtk::Action::create("seek-prev-second", Gtk::Stock::GO_BACK,_("Seek Backward"),_("Seek Backward"));
action_group->add( action, sigc::bind(sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::seek_time),Time(-1)));
- // Broken...!?
- /*
action=Gtk::Action::create("seek-end", Gtk::Stock::GOTO_LAST,_("Seek to End"),_("Seek to End"));
action_group->add(action,sigc::bind(sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::seek_time),Time::end()));
- */
+
action=Gtk::Action::create("seek-begin", Gtk::Stock::GOTO_FIRST,_("Seek to Begin"),_("Seek to Begin"));
action_group->add( action, sigc::bind(sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::seek_time),Time::begin()));
editmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("gtk-stop"),Gtk::AccelKey(GDK_Escape,static_cast<Gdk::ModifierType>(0)),SLOT_EVENT(EVENT_STOP)));
editmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("gtk-refresh"),Gtk::AccelKey('k',Gdk::CONTROL_MASK),SLOT_EVENT(EVENT_REFRESH)));
editmenu.items().push_back(Gtk::Menu_Helpers::SeparatorElem());
- editmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("synfig-rotoscope_bline"),
- sigc::mem_fun(*this, &studio::CanvasView::do_rotoscope_bline)));
- editmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("synfig-rotoscope_polygon"),
- sigc::mem_fun(*this, &studio::CanvasView::do_rotoscope_poly)));
- editmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("synfig-eyedrop"),
- sigc::mem_fun(*this, &studio::CanvasView::do_eyedrop)));
- editmenu.items().push_back(Gtk::Menu_Helpers::SeparatorElem());
editmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("gtk-properties"),Gtk::AccelKey("F8"),
sigc::mem_fun(canvas_properties,&studio::CanvasProperties::present)
));
viewmenu.items().push_back(Gtk::Menu_Helpers::MenuElem(_("Preview Quality"),qualitymenu));
}
- viewmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("synfig-play"),
+ viewmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::Stock::MEDIA_PLAY,
sigc::mem_fun(*this, &studio::CanvasView::play)));
viewmenu.items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("Flipbook Dialog"),
sigc::mem_fun(*preview_dialog, &studio::Dialog_Preview::present)));
}
void
-CanvasView::register_layer_type(synfig::Layer::Book::value_type &lyr,std::map<synfig::String,Gtk::Menu*>* category_map)
+CanvasView::register_layer_type(synfig::Layer::Book::value_type &/*lyr*/,std::map<synfig::String,Gtk::Menu*>* /*category_map*/)
{
/* if(lyr.second.category==_("Do Not Use"))
return;
}
void
-CanvasView::build_new_layer_menu(Gtk::Menu &menu)
+CanvasView::build_new_layer_menu(Gtk::Menu &/*menu*/)
{
/*
std::map<synfig::String,Gtk::Menu*> category_map;
}
bool
-CanvasView::on_layer_user_click(int button, Gtk::TreeRow row, LayerTree::ColumnID column_id)
+CanvasView::on_layer_user_click(int button, Gtk::TreeRow /*row*/, LayerTree::ColumnID /*column_id*/)
{
switch(button)
{
if(!(bool)row[children_tree_model.is_canvas])
{
synfigapp::ValueDesc value_desc=row[children_tree_model.value_desc];
+ if (!value_desc)
+ {
+ //! \todo fix properly -- what is the child dialog for?
+ synfig::info("preventing child dialog right-click crash");
+ return true;
+ }
assert(value_desc);
popup_param_menu(value_desc);
return true;
if(!work_area->sync_render_preview())
break;
- studio::App::iteration(false);
+ // wait for the workarea to refresh itself
+ while (studio::App::events_pending())
+ studio::App::iteration(false);
if(get_cancel_status())
+ {
+ is_playing_=false;
return;
+ }
}
is_playing_=false;
}
void
-CanvasView::do_rotoscope_bline()
-{
- smach_.enter(&state_bline);
-}
-
-void
-CanvasView::do_rotoscope()
-{
- smach_.enter(&state_draw);
-}
-
-void
-CanvasView::do_rotoscope_poly()
-{
- smach_.enter(&state_polygon);
-}
-
-void
-CanvasView::do_eyedrop()
-{
- smach_.enter(&state_eyedrop);
-}
-
-void
CanvasView::show_timebar()
{
timebar->show();
}
void
-CanvasView::timebar_set_sensitive(bool sensitive)
+CanvasView::set_sensitive_timebar(bool sensitive)
{
timebar->set_sensitive(sensitive);
current_time_widget->set_sensitive(sensitive);
}
void
-CanvasView::on_drop_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, const Gtk::SelectionData& selection_data_, guint info, guint time)
+CanvasView::on_drop_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int /*x*/, int /*y*/, const Gtk::SelectionData& selection_data_, guint /*info*/, guint time)
{
// We will make this true once we have a solid drop
bool success(false);
if(!get_instance()->perform_action(action))
break;
- // Ok, we have successfuly imported at least one item.
+ // Ok, we have successfully imported at least one item.
success=true;
} while(0); // END of "STRING"
sound_dialog->set_offset(t);
disp_audio->queue_draw();
- synfig::info("CanvasView::on_audio_offset_notify(): offset time set to %s",t.get_string(get_canvas()->rend_desc().get_frame_rate()).c_str());
+ // synfig::info("CanvasView::on_audio_offset_notify(): offset time set to %s",t.get_string(get_canvas()->rend_desc().get_frame_rate()).c_str());
}
void