Gtk::CheckButton checkbutton_layer_region;
Gtk::CheckButton checkbutton_layer_bline;
Gtk::CheckButton checkbutton_layer_curve_gradient;
+ Gtk::CheckButton checkbutton_layer_plant;
Gtk::CheckButton checkbutton_layer_link_offsets;
Gtk::CheckButton checkbutton_auto_export;
Gtk::Button button_make;
return
get_layer_region_flag()+
get_layer_bline_flag()+
- get_layer_curve_gradient_flag();
+ get_layer_curve_gradient_flag() +
+ get_layer_plant_flag();
}
void sanity_check()
bool get_layer_curve_gradient_flag()const { return checkbutton_layer_curve_gradient.get_active(); }
void set_layer_curve_gradient_flag(bool x) { return checkbutton_layer_curve_gradient.set_active(x); }
+ bool get_layer_plant_flag()const { return checkbutton_layer_plant.get_active(); }
+ void set_layer_plant_flag(bool x) { return checkbutton_layer_plant.set_active(x); }
+
bool get_layer_link_offsets_flag()const { return checkbutton_layer_link_offsets.get_active(); }
void set_layer_link_offsets_flag(bool x) { return checkbutton_layer_link_offsets.set_active(x); }
else
set_layer_curve_gradient_flag(false);
+ if(settings.get_value("bline.layer_plant",value) && value=="1")
+ set_layer_plant_flag(true);
+ else
+ set_layer_plant_flag(false);
+
if(settings.get_value("bline.layer_link_offsets",value) && value=="0")
set_layer_link_offsets_flag(false);
else
settings.set_value("bline.layer_bline",get_layer_bline_flag()?"1":"0");
settings.set_value("bline.layer_region",get_layer_region_flag()?"1":"0");
settings.set_value("bline.layer_curve_gradient",get_layer_curve_gradient_flag()?"1":"0");
+ settings.set_value("bline.layer_plant",get_layer_plant_flag()?"1":"0");
settings.set_value("bline.layer_link_offsets",get_layer_link_offsets_flag()?"1":"0");
settings.set_value("bline.auto_export",get_auto_export_flag()?"1":"0");
settings.set_value("bline.id",get_id().c_str());
checkbutton_layer_region(_("Fill")),
checkbutton_layer_bline(_("Outline")),
checkbutton_layer_curve_gradient(_("Gradient")),
+ checkbutton_layer_plant(_("Plant")),
checkbutton_layer_link_offsets(_("Link Offsets")),
checkbutton_auto_export(_("Auto Export")),
button_make(_("Make")),
options_table.attach(checkbutton_layer_region, 0, 2, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.attach(checkbutton_layer_bline, 0, 2, 3, 4, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.attach(checkbutton_layer_curve_gradient, 0, 2, 4, 5, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
- options_table.attach(checkbutton_layer_link_offsets, 0, 2, 5, 6, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
- options_table.attach(checkbutton_auto_export, 0, 2, 6, 7, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ options_table.attach(checkbutton_layer_plant, 0, 2, 5, 6, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ options_table.attach(checkbutton_layer_link_offsets, 0, 2, 6, 7, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ options_table.attach(checkbutton_auto_export, 0, 2, 7, 8, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.attach(*manage(new Gtk::Label(_("Feather"))), 0, 1, 10, 11, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
options_table.attach(spin_feather, 1, 2, 10, 11, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
//options_table.attach(button_make, 0, 2, 5, 6, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
synfigapp::SelectionManager::LayerList layer_selection;
- // If we were asked to create a region layer, go ahead and do so
+ ///////////////////////////////////////////////////////////////////////////
+ // R E G I O N
+ ///////////////////////////////////////////////////////////////////////////
+
if(get_layer_region_flag())
{
synfigapp::PushMode push_mode(get_canvas_interface(),synfigapp::MODE_NORMAL);
}
}
- // If we were asked to create a BLine layer, go ahead and do so
+ ///////////////////////////////////////////////////////////////////////////
+ // O U T L I N E
+ ///////////////////////////////////////////////////////////////////////////
+
if(get_layer_bline_flag())
{
synfigapp::PushMode push_mode(get_canvas_interface(),synfigapp::MODE_NORMAL);
return false;
}
}
-
- /*if(get_layer_region_flag() && !get_auto_export_flag())
- {
- get_canvas_interface()->auto_export(synfigapp::ValueDesc(layer,"bline"));
- }*/
}
+ ///////////////////////////////////////////////////////////////////////////
+ // C U R V E G R A D I E N T
+ ///////////////////////////////////////////////////////////////////////////
-
- // If we were asked to create a CurveGradient layer, go ahead and do so
if(get_layer_curve_gradient_flag())
{
synfigapp::PushMode push_mode(get_canvas_interface(),synfigapp::MODE_NORMAL);
return false;
}
}
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // P L A N T
+ ///////////////////////////////////////////////////////////////////////////
+
+ if(get_layer_plant_flag())
+ {
+ synfigapp::PushMode push_mode(get_canvas_interface(),synfigapp::MODE_NORMAL);
+
+ Layer::Handle layer(get_canvas_interface()->add_layer_to("plant",canvas,depth));
+ assert(layer);
+ layer_selection.push_back(layer);
+ layer->set_description(get_id()+_(" Plant"));
+ get_canvas_interface()->signal_layer_new_description()(layer,layer->get_description());
- /*if(get_layer_region_flag() && !get_auto_export_flag())
{
- get_canvas_interface()->auto_export(synfigapp::ValueDesc(layer,"bline"));
- }*/
+ synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
+ assert(action);
+
+ action->set_param("canvas",get_canvas());
+ action->set_param("canvas_interface",get_canvas_interface());
+ action->set_param("layer",layer);
+ if(!action->set_param("param",String("bline")))
+ synfig::error("LayerParamConnect didn't like \"param\"");
+ if(!action->set_param("value_node",ValueNode::Handle(value_node_bline)))
+ synfig::error("LayerParamConnect didn't like \"value_node\"");
+
+ if(!get_canvas_interface()->get_instance()->perform_action(action))
+ {
+ //get_canvas_view()->get_ui_interface()->error(_("Unable to create BLine layer"));
+ group.cancel();
+ throw String(_("Unable to create Plant layer"));
+ return false;
+ }
+ }
+
+ // plants don't have offsets?
+ if (false && get_layer_link_offsets_flag())
+ {
+ synfigapp::Action::Handle action(synfigapp::Action::create("layer_param_connect"));
+ assert(action);
+
+ action->set_param("canvas",get_canvas());
+ action->set_param("canvas_interface",get_canvas_interface());
+ action->set_param("layer",layer);
+ if(!action->set_param("param",String("offset")))
+ synfig::error("LayerParamConnect didn't like \"param\"");
+ if(!action->set_param("value_node",ValueNode::Handle(value_node_offset)))
+ synfig::error("LayerParamConnect didn't like \"value_node\"");
+
+ if(!get_canvas_interface()->get_instance()->perform_action(action))
+ {
+ //get_canvas_view()->get_ui_interface()->error(_("Unable to create BLine layer"));
+ group.cancel();
+ throw String(_("Unable to create Plant layer"));
+ return false;
+ }
+ }
}
egress_on_selection_change=false;