/* === C L A S S E S ======================================================= */
-
class studio::UniversalScrubber
{
CanvasView *canvas_view;
}
};
-
class studio::CanvasViewUIInterface : public synfigapp::UIInterface
{
CanvasView *view;
CanvasViewUIInterface(CanvasView *view):
view(view)
{
-
view->statusbar->push(_("Idle"));
}
CanvasView *view;
CanvasView::LayerTreeModel layer_tree_model;
CanvasView::ChildrenTreeModel children_tree_model;
-public:
-
- CanvasViewSelectionManager(CanvasView *view): view(view)
-{
-
- }
+public:
+ CanvasViewSelectionManager(CanvasView *view): view(view) { }
private:
void _set_selected_layer(const synfig::Layer::Handle &layer)
view->layer_tree->clear_selected_layers();
}
-
-
//! Returns the number of value_nodes selected.
virtual int get_selected_children_count()const
{
return;
}
-
-
int get_selected_layer_parameter_count()const
{
return get_selected_layer_parameters().size();
}; // END of class SelectionManager
-
CanvasView::IsWorking::IsWorking(CanvasView &canvas_view_):
canvas_view_(canvas_view_)
{
//vpaned->pack2(*notebook, Gtk::SHRINK);
//vpaned->show_all();
-
//notebook->show();
//notebook->append_page(*create_layer_tree(),_("Layers"));
init_menus();
//layout_table->attach(*App::ui_manager()->get_widget("/menu-main"), 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
-
layout_table->attach(*create_time_bar(), 0, 1, 3, 4, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
layout_table->attach(*create_status_bar(), 0, 1, 4, 5, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
time_window_adjustment().signal_value_changed().connect(sigc::mem_fun(*this,&studio::CanvasView::refresh_time_window));
time_adjustment().signal_value_changed().connect(sigc::mem_fun(*this,&studio::CanvasView::time_was_changed));
-
work_area->signal_layer_selected().connect(sigc::mem_fun(*this,&studio::CanvasView::workarea_layer_selected));
work_area->signal_input_device_changed().connect(sigc::mem_fun(*this,&studio::CanvasView::on_input_device_changed));
)
);
-
//MUCH TIME STUFF TAKES PLACE IN HERE
refresh_rend_desc();
refresh_time_window();
set_default_size(w,h);
property_window_position().set_value(Gtk::WIN_POS_NONE);
-
-
-
std::list<Gtk::TargetEntry> listTargets;
listTargets.push_back( Gtk::TargetEntry("STRING") );
listTargets.push_back( Gtk::TargetEntry("text/plain") );
drag_dest_set(listTargets);
signal_drag_data_received().connect( sigc::mem_fun(*this, &studio::CanvasView::on_drop_drag_data_received) );
-
/*
Time length(get_canvas()->rend_desc().get_time_end()-get_canvas()->rend_desc().get_time_start());
if(length<10.0)
time_window_adjustment().set_value(get_canvas()->rend_desc().get_time_start());
time_window_adjustment().value_changed();
-
GRAB_HINT_DATA("canvas_view");
/*
{
synfig::info("CanvasView::~CanvasView(): Deleted");
}
-
-
std::list<int>&
CanvasView::get_pixel_sizes()
{
timeslider->set_bounds_adjustment(&time_window_adjustment());
//layout_table->attach(*timeslider, 0, 1, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL);
-
tooltips.set_tip(*time_window_scroll,_("Moves the time window"));
tooltips.set_tip(*timeslider,_("Changes the current time"));
time_window_scroll->show();
return work_area.get();
}
-
Gtk::Widget*
CanvasView::create_status_bar()
{
// statusbartable->attach(*lowerbutton, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
// statusbartable->attach(*raisebutton, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
-
current_time_widget=manage(new Widget_Time);
current_time_widget->set_value(get_time());
current_time_widget->set_fps(get_canvas()->rend_desc().get_frame_rate());
refreshbutton->signal_clicked().connect(SLOT_EVENT(EVENT_REFRESH));
stopbutton->signal_clicked().connect(SLOT_EVENT(EVENT_STOP));
-
statusbartable->show_all();
return statusbartable;
}
}
-
#define DUCK_MASK(lower,upper,string) \
duck_mask_##lower=Gtk::ToggleAction::create("mask-" #lower "-ducks", string); \
duck_mask_##lower->set_active((bool)(work_area->get_type_mask()&Duck::TYPE_##upper)); \
}
*/
-
-
#if 0
//
// //Test some key stuff
target_depth=canvas->get_depth(*layer_list.begin());
}
-
Layer::Handle layer(canvas_interface()->add_layer_to(x,canvas,target_depth));
if(layer)
{
get_selection_manager()->set_selected_layer(layer);
}
-
void
CanvasView::refresh_rend_desc()
{
current_time_widget->set_fps(get_canvas()->rend_desc().get_frame_rate());
-
//????
//synfig::info("Canvasview: Refreshing render desc info");
if(!get_time().is_equal(time_adjustment().get_value()))
work_area->queue_render_preview();
}
-
bool
CanvasView::close_view()
{
set_title(title);
}
-
void
CanvasView::on_hide()
{
canvas_interface()->get_instance()->perform_action(action);
}
-
void
CanvasView::popup_param_menu(synfigapp::ValueDesc value_desc, float location)
{
{
case 3:
{
-
Gtk::MenuItem* menu = dynamic_cast<Gtk::MenuItem*>(App::ui_manager()->get_widget("/menu-main/menu-layer"));
if(menu && menu->get_submenu())
{
menu->get_submenu()->popup(button,gtk_get_current_event_time());
}
-
#if 0
bool multiple_selected=true;
}
}
-
-
bool
CanvasView::on_children_user_click(int button, Gtk::TreeRow row, ChildrenTree::ColumnID column_id)
{
return false;
}
-
void
CanvasView::refresh_time_window()
{
if(get_time() != time_adjustment().get_value())
{
-
//Recenters the window, causing it to jump (possibly undesirably... but whatever)
if(time < time_window_adjustment().get_value() ||
time > time_window_adjustment().get_value()+time_window_adjustment().get_page_size())
update_title();
}
-
void
CanvasView::on_mode_changed(synfigapp::CanvasInterface::Mode mode)
{
children_tree->set_sensitive(sensitive);
}
-
static void
set_waypoint_model(std::set<synfig::Waypoint, std::less<UniqueID> > waypoints,
Waypoint::Model model,
void
CanvasView::on_waypoint_clicked_canvasview(synfigapp::ValueDesc value_desc,
std::set<synfig::Waypoint, std::less<UniqueID> > waypoint_set,
- int button,
- synfig::Waypoint::Side side)
+ int button)
{
int size = waypoint_set.size();
Waypoint waypoint(*(waypoint_set.begin()));
canvas_interface()->get_instance()->perform_action(action);
}
-
void
CanvasView::toggle_duck_mask(Duckmatic::Type type)
{
work_area->queue_draw();
}
-
void
CanvasView::image_import()
{
return true;
}
-
-
Glib::RefPtr<Glib::ObjectBase>
CanvasView::get_ref_obj(const synfig::String& x)
{
std::map<synfig::String,Glib::RefPtr<Glib::ObjectBase> > ref_obj_book_;
std::map<synfig::String,Gtk::Widget*> ext_widget_book_;
-
//! The time adjustment's scope is defined by the time_window adjustment
Gtk::Adjustment time_adjustment_;
//Gtk::Adjustment time_window_adjustment_;
studio::Adjust_Window time_window_adjustment_;
-
LayerTree *layer_tree;
ChildrenTree *children_tree;
std::list<sigc::connection> duck_changed_connections;
-
-
Gtk::Button *animatebutton;
Gtk::Button *keyframebutton;
*/
Gtk::Menu parammenu;
-
Glib::RefPtr<Gtk::ToggleAction> duck_mask_position;
Glib::RefPtr<Gtk::ToggleAction> duck_mask_vertex;
Glib::RefPtr<Gtk::ToggleAction> duck_mask_tangent;
Glib::RefPtr<Gtk::ActionGroup> action_group;
-
etl::handle<synfigapp::UIInterface> ui_interface_;
etl::handle<synfigapp::SelectionManager> selection_manager_;
bool cancel;
-
/*
-- ** -- D I A L O G S -------------------------------------------------------
*/
Gtk::Widget *create_time_bar();
-
-
void popup_param_menu_bezier(float location, synfigapp::ValueDesc value_desc)
{ popup_param_menu(value_desc,location); }
void popup_param_menu(synfigapp::ValueDesc value_desc, float location=0);
-
void workarea_layer_selected(synfig::Layer::Handle layer);
void selected_layer_color_set(synfig::Color color);
-
-
void register_layer_type(synfig::Layer::Book::value_type &lyr,std::map<synfig::String,Gtk::Menu*>*);
//! Rebuilds the "new layer" menu
void image_import();
- void on_waypoint_clicked_canvasview(synfigapp::ValueDesc,std::set<synfig::Waypoint,std::less<synfig::UniqueID> >, int button, synfig::Waypoint::Side side);
+ void on_waypoint_clicked_canvasview(synfigapp::ValueDesc,std::set<synfig::Waypoint,std::less<synfig::UniqueID> >, int button);
void preview_option() {on_preview_option();}
attach(*hbox, 0, 1, 1, 2, Gtk::FILL|Gtk::SHRINK, Gtk::SHRINK, 0, 0);
-
-
tree_view.set_enable_search(true);
tree_view.set_search_column(model.label);
-
/*
Gtk::Image *icon;
//Gtk::IconSize iconsize(Gtk::IconSize::from_name("synfig-small_icon"));
button_delete->set_sensitive(false);
*/
-
-
get_selection()->signal_changed().connect(sigc::mem_fun(*this, &studio::ChildrenTree::on_selection_changed));
-
tree_view.set_reorderable(true);
hbox->show();
//get_selection()->set_mode(Gtk::SELECTION_MULTIPLE);
}
-
ChildrenTree::~ChildrenTree()
{
}
}
}
-
void
ChildrenTree::on_edited_value(const Glib::ustring&path_string,synfig::ValueBase value)
{
//! \todo writeme
// std::set<synfig::Waypoint, std::less<UniqueID> > waypoint_set;
- // signal_waypoint_clicked_childrentree()(waypoint_set,button,side);
+ // signal_waypoint_clicked_childrentree()(waypoint_set,button);
}
bool
sigc::signal<bool, int, Gtk::TreeRow, ColumnID> signal_user_click_;
- sigc::signal<void,synfigapp::ValueDesc,std::set<synfig::Waypoint,std::less<synfig::UniqueID> >,int,synfig::Waypoint::Side> signal_waypoint_clicked_childrentree_;
+ sigc::signal<void,synfigapp::ValueDesc,std::set<synfig::Waypoint,std::less<synfig::UniqueID> >,int> signal_waypoint_clicked_childrentree_;
Gtk::Button *button_raise;
Gtk::Button *button_lower;
sigc::signal<bool,int, Gtk::TreeRow, ColumnID>& signal_user_click() { return signal_user_click_; }
- sigc::signal<void,synfigapp::ValueDesc,std::set<synfig::Waypoint,std::less<synfig::UniqueID> >,int,synfig::Waypoint::Side>& signal_waypoint_clicked_childrentree() { return signal_waypoint_clicked_childrentree_; }
+ sigc::signal<void,synfigapp::ValueDesc,std::set<synfig::Waypoint,std::less<synfig::UniqueID> >,int>& signal_waypoint_clicked_childrentree() { return signal_waypoint_clicked_childrentree_; }
etl::handle<synfigapp::SelectionManager> get_selection_manager() { return children_tree_store_->canvas_interface()->get_selection_manager(); }
Gtk::TreeView *mimic_tree_view;
public:
- sigc::signal<void,synfigapp::ValueDesc,std::set<synfig::Waypoint, std::less<UniqueID> >,int,synfig::Waypoint::Side> signal_waypoint_clicked_timetrackview;
+ sigc::signal<void,synfigapp::ValueDesc,std::set<synfig::Waypoint, std::less<UniqueID> >,int> signal_waypoint_clicked_timetrackview;
LayerParamTreeStore::Model model;
column->set_resizable();
column->set_min_width(200);
-
append_column(*column);
}
set_rules_hint();
void mimic_resync()
{
-
if(mimic_tree_view)
{
Gtk::Adjustment &adjustment(*mimic_tree_view->get_vadjustment());
}
if (!waypoint_set.empty())
- signal_waypoint_clicked_timetrackview(value_desc,waypoint_set,button,side);
+ signal_waypoint_clicked_timetrackview(value_desc,waypoint_set,button);
}
};
tree_view->signal_waypoint_clicked_timetrackview.connect(sigc::mem_fun(*canvas_view, &studio::CanvasView::on_waypoint_clicked_canvasview));
-
canvas_view->time_adjustment().signal_value_changed().connect(sigc::mem_fun(*tree_view,&Gtk::TreeView::queue_draw));
canvas_view->time_adjustment().signal_changed().connect(sigc::mem_fun(*tree_view,&Gtk::TreeView::queue_draw));
table_=0;
}
-
if(canvas_view)
{
TimeTrackView* tree_view(dynamic_cast<TimeTrackView*>(canvas_view->get_ext_widget(get_name())));
studio::App::instance_list.front()->canvas_view_list().front()->present();
}
-
void
Instance::insert_canvas(Gtk::TreeRow row, synfig::Canvas::Handle canvas)
{
*/
}
-
/*
void
Instance::insert_value_node(Gtk::TreeRow row,Canvas::Handle canvas,etl::handle<synfig::ValueNode> value_node)
return true;
}
-
void
Instance::add_actions_to_group(const Glib::RefPtr<Gtk::ActionGroup>& action_group, synfig::String& ui_info, const synfigapp::Action::ParamList ¶m_list, synfigapp::Action::Category category)const
{
param_list2.add("origin",location);
}
-
// Populate the convert menu by looping through
// the ValueNode book and find the ones that are
// relevant.
sigc::bind(
sigc::bind(
sigc::bind(
- sigc::bind(
- sigc::mem_fun(*find_canvas_view(canvas),&studio::CanvasView::on_waypoint_clicked_canvasview),
- synfig::Waypoint::SIDE_UNSPECIFIED
- ),
+ sigc::mem_fun(*find_canvas_view(canvas),&studio::CanvasView::on_waypoint_clicked_canvasview),
-1
),
waypoint_set
dialog.get_vbox()->pack_start(widget_waypoint_model);
-
dialog.add_button(Gtk::StockID("gtk-apply"),1);
dialog.add_button(Gtk::StockID("gtk-cancel"),0);
dialog.show();
action->set_param("canvas",canvas_view->get_canvas());
action->set_param("canvas_interface",canvas_interface);
-
if(!canvas_interface->get_instance()->perform_action(action))
{
canvas_view->get_ui_interface()->error(_("Unable to convert to animated waypoint"));
value_node=ValueNode_Animated::Handle::cast_dynamic(value_desc.get_value_node());
}
-
if(value_node)
{
-
synfigapp::Action::Handle action(synfigapp::Action::create("waypoint_set_smart"));
if(!action)
return;
}
-
action->set_param("canvas",canvas_view->get_canvas());
action->set_param("canvas_interface",canvas_interface);
action->set_param("value_node",ValueNode::Handle(value_node));
// synfigapp::ValueDesc value_desc;
// std::set<synfig::Waypoint, std::less<UniqueID> > waypoint_set;
- // signal_waypoint_clicked_layertree()(value_desc,waypoint_set,button,side);
+ // signal_waypoint_clicked_layertree()(value_desc,waypoint_set,button);
}
bool
Gtk::Tooltips tooltips_;
Gtk::TreePath last_tooltip_path;
-
-
Gtk::TreeView* layer_tree_view_;
Gtk::TreeView* param_tree_view_;
-
-
Gtk::HBox *hbox;
Gtk::Adjustment layer_amount_adjustment_;
sigc::signal<bool, int, Gtk::TreeRow, ColumnID> signal_param_user_click_;
- sigc::signal<void,synfigapp::ValueDesc,std::set<synfig::Waypoint,std::less<synfig::UniqueID> >,int,synfig::Waypoint::Side> signal_waypoint_clicked_layertree_;
+ sigc::signal<void,synfigapp::ValueDesc,std::set<synfig::Waypoint,std::less<synfig::UniqueID> >,int> signal_waypoint_clicked_layertree_;
bool disable_amount_changed_signal;
sigc::signal<bool,int, Gtk::TreeRow, ColumnID>& signal_param_user_click() { return signal_param_user_click_; }
- sigc::signal<void,synfigapp::ValueDesc,std::set<synfig::Waypoint,std::less<synfig::UniqueID> >,int,synfig::Waypoint::Side>& signal_waypoint_clicked_layertree() { return signal_waypoint_clicked_layertree_; }
+ sigc::signal<void,synfigapp::ValueDesc,std::set<synfig::Waypoint,std::less<synfig::UniqueID> >,int>& signal_waypoint_clicked_layertree() { return signal_waypoint_clicked_layertree_; }
etl::handle<synfigapp::SelectionManager> get_selection_manager() { return layer_tree_store_->canvas_interface()->get_selection_manager(); }
-
-
void select_layer(synfig::Layer::Handle layer);
void select_layers(const LayerList& layer_list);
void select_all_children_layers(synfig::Layer::Handle layer);