set_type_hint(Gdk::WINDOW_TYPE_HINT_UTILITY);
create_color_edit_widget();
- create_set_color_button("synfig-set_fg_color", _("Set as Foreground"), 0,
- sigc::mem_fun(*this, &Dialog_Color::on_set_fg_pressed));
- create_set_color_button("synfig-set_bg_color", _("Set as Background"), 1,
- sigc::mem_fun(*this, &Dialog_Color::on_set_bg_pressed));
+ create_set_color_button("synfig-set_fg_color", _("Set as Outline"), 0,
+ sigc::mem_fun(*this, &Dialog_Color::on_set_oc_pressed));
+ create_set_color_button("synfig-set_bg_color", _("Set as Fill"), 1,
+ sigc::mem_fun(*this, &Dialog_Color::on_set_fc_pressed));
create_close_button();
add_accel_group(App::ui_manager()->get_accel_group());
}
void
-Dialog_Color::on_set_fg_pressed()
+Dialog_Color::on_set_oc_pressed()
{
busy_ = true;
- synfigapp::Main::set_foreground_color(get_color());
+ synfigapp::Main::set_outline_color(get_color());
busy_ = false;
}
void
-Dialog_Color::on_set_bg_pressed()
+Dialog_Color::on_set_fc_pressed()
{
busy_ = true;
- synfigapp::Main::set_background_color(get_color());
+ synfigapp::Main::set_fill_color(get_color());
busy_ = false;
}
void create_close_button();
void on_color_changed();
- void on_set_fg_pressed();
- void on_set_bg_pressed();
+ void on_set_oc_pressed();
+ void on_set_fc_pressed();
bool on_close_pressed();
public:
"palette-add-color",
Gtk::StockID("gtk-add"),
_("Add Color"),
- _("Add current foreground color\nto the palette")
+ _("Add current outline color\nto the palette")
),
sigc::mem_fun(
*this,
/*
add_button(
Gtk::StockID("gtk-add"),
- _("Add current foreground color\nto the palette")
+ _("Add current outline color\nto the palette")
)->signal_clicked().connect(
sigc::mem_fun(
*this,
void
Dock_PalEdit::on_add_pressed()
{
- add_color(synfigapp::Main::get_foreground_color());
+ add_color(synfigapp::Main::get_outline_color());
}
void
void
Dock_PalEdit::select_color(int i)
{
- synfigapp::Main::set_foreground_color(get_color(i));
+ synfigapp::Main::set_outline_color(get_color(i));
}
void
get_canvas_interface()->signal_layer_param_changed()(layer,"feather");
}
- if(get_layer_outline_flag())
- layer->set_param("color",synfigapp::Main::get_background_color());
-
// I don't know if it's safe to reuse the same LayerParamConnect action, so I'm
// using 2 separate ones.
{
layer->set_description(get_id());
get_canvas_interface()->signal_layer_new_description()(layer,layer->get_description());
- if(get_layer_outline_flag())
- {
- layer->set_param("color",synfigapp::Main::get_background_color());
- get_canvas_interface()->signal_layer_param_changed()(layer,"color");
- }
-
// only link the circle's origin parameter if the option is selected, we're putting bline
// origins at their centers, and we're creating more than one layer
if (get_layer_link_origins_flag() && get_layer_origins_at_center_flag() && layers_to_create > 1)
layer->set_param("invert",get_invert());
get_canvas_interface()->signal_layer_param_changed()(layer,"invert");
- if(get_layer_outline_flag())
- layer->set_param("color",synfigapp::Main::get_background_color());
-
// I don't know if it's safe to reuse the same LayerParamConnect action, so I'm
// using 2 separate ones.
{
assert(event.stroke_data);
- get_work_area()->add_stroke(event.stroke_data,synfigapp::Main::get_foreground_color());
+ get_work_area()->add_stroke(event.stroke_data,synfigapp::Main::get_outline_color());
if(nested==0)
{
}
}
- //get_work_area()->add_stroke(event.stroke_data,synfigapp::Main::get_foreground_color());
+ //get_work_area()->add_stroke(event.stroke_data,synfigapp::Main::get_outline_color());
//stroke_list.push_back(event.stroke_data);
//refresh_ducks();
group.cancel();
return Smach::RESULT_ERROR;
}
- layer->set_param("color",synfigapp::Main::get_background_color());
+
if(get_feather())
{
layer->set_param("feather",get_feather());
get_canvas_interface()->get_selection_manager()->clear_selected_layers();
layer=get_canvas_interface()->add_layer_to("region", canvas, depth);
if (!layer) return Smach::RESULT_ERROR;
- layer->set_param("color",synfigapp::Main::get_background_color());
layer->set_description(last_stroke_id + _(" Region"));
synfigapp::Action::Handle action(synfigapp::Action::create("LayerParamConnect"));
if(event.button==BUTTON_LEFT)
{
Color color(canvas_view->get_canvas()->get_context().get_color(event.pos));
- synfigapp::Main::set_foreground_color(color);
+ synfigapp::Main::set_outline_color(color);
studio::App::dialog_color->set_color(color);
return Smach::RESULT_ACCEPT;
}
//synfigapp::Action::Handle action(synfigapp::Action::create("ValueDescSet"));
synfigapp::ValueDesc value_desc(event.layer,"color");
- if(!get_canvas_interface()->change_value(value_desc,ValueBase(synfigapp::Main::get_foreground_color())))
+ if(!get_canvas_interface()->change_value(value_desc,ValueBase(synfigapp::Main::get_fill_color())))
{
get_canvas_view()->get_ui_interface()->warning(_("Unable to set layer color"));
return Smach::RESULT_ERROR;
//action->set_param("layer",event.layer);
//if(!action->set_param("param",String("color")))
// synfig::error("LayerParamConnect didn't like \"param\"");
- if(!action->set_param("new_value",ValueBase(synfigapp::Main::get_foreground_color())))
- synfig::error("LayerParamConnect didn't like \"foreground_color\"");
+ if(!action->set_param("new_value",ValueBase(synfigapp::Main::get_fill_color())))
+ synfig::error("LayerParamConnect didn't like \"fill_color\"");
if(!get_canvas_interface()->get_instance()->perform_action(action))
{
layer->set_description(get_id());
get_canvas_interface()->signal_layer_new_description()(layer,layer->get_description());
-
- if(get_layer_outline_flag())
- {
- layer->set_param("color",synfigapp::Main::get_background_color());
- get_canvas_interface()->signal_layer_param_changed()(layer,"color");
- }
-
layer->disconnect_dynamic_param("vector_list");
if(!layer->set_param("vector_list",polygon_point_list))
{
layer->set_param("invert",get_invert());
get_canvas_interface()->signal_layer_param_changed()(layer,"invert");
- if(get_layer_outline_flag())
- layer->set_param("color",synfigapp::Main::get_background_color());
-
// I don't know if it's safe to reuse the same LayerParamConnect action, so I'm
// using 2 separate ones.
{
layer->set_description(get_id());
get_canvas_interface()->signal_layer_new_description()(layer,layer->get_description());
-
- if(get_layer_outline_flag())
- {
- layer->set_param("color",synfigapp::Main::get_background_color());
- get_canvas_interface()->signal_layer_param_changed()(layer,"color");
- }
}
///////////////////////////////////////////////////////////////////////////
layer->set_param("invert",get_invert());
get_canvas_interface()->signal_layer_param_changed()(layer,"invert");
- if(get_layer_outline_flag())
- layer->set_param("color",synfigapp::Main::get_background_color());
-
// I don't know if it's safe to reuse the same LayerParamConnect action, so I'm
// using 2 separate ones.
{
assert(event.stroke_data);
- get_work_area()->add_persistent_stroke(event.stroke_data,synfigapp::Main::get_foreground_color());
+ get_work_area()->add_persistent_stroke(event.stroke_data,synfigapp::Main::get_outline_color());
return Smach::RESULT_ACCEPT;
}
layer->set_description(get_id());
get_canvas_interface()->signal_layer_new_description()(layer,layer->get_description());
- if(get_layer_outline_flag())
- {
- layer->set_param("color",synfigapp::Main::get_background_color());
- get_canvas_interface()->signal_layer_param_changed()(layer,"color");
- }
-
// only link the star's origin parameter if the option is selected, we're putting bline
// origins at their centers, and we're creating more than one layer
if (get_layer_link_origins_flag() && get_layer_origins_at_center_flag() && layers_to_create > 1)
layer->set_param("invert",get_invert());
get_canvas_interface()->signal_layer_param_changed()(layer,"invert");
- if(get_layer_outline_flag())
- layer->set_param("color",synfigapp::Main::get_background_color());
-
// I don't know if it's safe to reuse the same LayerParamConnect action, so I'm
// using 2 separate ones.
{
width_data.spawn();
stroke_data.spawn();
- get_work_area()->add_stroke(stroke_data, synfigapp::Main::get_foreground_color());
+ get_work_area()->add_stroke(stroke_data, synfigapp::Main::get_outline_color());
}
StateStroke_Context::~StateStroke_Context()
add_events(Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK);
add_events(Gdk::BUTTON1_MOTION_MASK);
- synfigapp::Main::signal_foreground_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Brush::queue_draw));
- synfigapp::Main::signal_background_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Brush::queue_draw));
+ synfigapp::Main::signal_outline_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Brush::queue_draw));
+ synfigapp::Main::signal_fill_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Brush::queue_draw));
synfigapp::Main::signal_bline_width_changed().connect(sigc::mem_fun(*this,&studio::Widget_Brush::queue_draw));
studio::App::signal_instance_selected().connect(sigc::hide(sigc::mem_fun(*this,&studio::Widget_Brush::queue_draw)));
}
RendDesc rend_desc;
pixelsize=synfigapp::Main::get_bline_width().get(Distance::SYSTEM_PIXELS,rend_desc);
}
- // Fill in the background color
- render_color_to_window(get_window(),Gdk::Rectangle(0,0,w,h),synfigapp::Main::get_background_color());
+ // Fill in the fill color
+ render_color_to_window(get_window(),Gdk::Rectangle(0,0,w,h),synfigapp::Main::get_fill_color());
/*
- gc->set_rgb_fg_color(colorconv_synfig2gdk(synfigapp::Main::get_background_color()));
+ gc->set_rgb_fg_color(colorconv_synfig2gdk(synfigapp::Main::get_fill_color()));
gc->set_line_attributes(1,Gdk::LINE_SOLID,Gdk::CAP_BUTT,Gdk::JOIN_MITER);
get_window()->draw_rectangle(
gc,
*/
// Draw in the circle
- gc->set_rgb_fg_color(colorconv_synfig2gdk(synfigapp::Main::get_foreground_color()));
+ gc->set_rgb_fg_color(colorconv_synfig2gdk(synfigapp::Main::get_outline_color()));
gc->set_function(Gdk::COPY);
gc->set_line_attributes(1,Gdk::LINE_SOLID,Gdk::CAP_BUTT,Gdk::JOIN_MITER);
get_window()->draw_arc(
{
Gtk::Table* subtable(manage(new Gtk::Table()));
- // Foreground Color
- widget_fg_color=manage(new Widget_Color());
- widget_fg_color->show();
- widget_fg_color->set_size_request(16,16);
- widget_fg_color->signal_clicked().connect(sigc::mem_fun(*this,&Widget_Defaults::on_fg_color_clicked));
- subtable->attach(*widget_fg_color, 0, 4, 0, 4, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
- tooltips_.set_tip(*widget_fg_color,_("Foreground Color"));
-
- // Background Color
- widget_bg_color=manage(new Widget_Color());
- widget_bg_color->show();
- widget_bg_color->set_size_request(16,16);
- widget_bg_color->signal_clicked().connect(sigc::mem_fun(*this,&Widget_Defaults::on_bg_color_clicked));
- subtable->attach(*widget_bg_color, 3, 7, 3, 7, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
- tooltips_.set_tip(*widget_bg_color,_("Background Color"));
+ // Outline Color
+ widget_otln_color=manage(new Widget_Color());
+ widget_otln_color->show();
+ widget_otln_color->set_size_request(16,16);
+ widget_otln_color->signal_clicked().connect(sigc::mem_fun(*this,&Widget_Defaults::on_otln_color_clicked));
+ subtable->attach(*widget_otln_color, 0, 4, 0, 4, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ tooltips_.set_tip(*widget_otln_color,_("Outline Color"));
+
+ // Fill Color
+ widget_fill_color=manage(new Widget_Color());
+ widget_fill_color->show();
+ widget_fill_color->set_size_request(16,16);
+ widget_fill_color->signal_clicked().connect(sigc::mem_fun(*this,&Widget_Defaults::on_fill_color_clicked));
+ subtable->attach(*widget_fill_color, 3, 7, 3, 7, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ tooltips_.set_tip(*widget_fill_color,_("Fill Color"));
Gtk::Image* icon;
dynamic_cast<Gtk::Misc*>(button_swap->get_child())->set_padding(0,0);
button_swap->signal_clicked().connect(sigc::mem_fun(*this,&Widget_Defaults::on_swap_color_clicked));
subtable->attach(*button_swap, 4, 7, 0, 3, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
- tooltips_.set_tip(*button_swap,_("Swap Background and\nForeground Colors"));
+ tooltips_.set_tip(*button_swap,_("Swap Fill and\nOutline Colors"));
// Reset button
Gtk::Button* button_reset(manage(new Gtk::Button()));
// Signals
synfigapp::Main::signal_opacity_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::opacity_refresh));
synfigapp::Main::signal_bline_width_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::bline_width_refresh));
- synfigapp::Main::signal_foreground_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::fg_color_refresh));
- synfigapp::Main::signal_background_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::bg_color_refresh));
+ synfigapp::Main::signal_outline_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::otln_color_refresh));
+ synfigapp::Main::signal_fill_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::fill_color_refresh));
synfigapp::Main::signal_gradient_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::gradient_refresh));
synfigapp::Main::signal_blend_method_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::blend_method_refresh));
synfigapp::Main::signal_interpolation_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::interpolation_refresh));
- fg_color_refresh();
- bg_color_refresh();
+ otln_color_refresh();
+ fill_color_refresh();
gradient_refresh();
blend_method_refresh();
opacity_refresh();
add_events(Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK);
add_events(Gdk::BUTTON1_MOTION_MASK);
- synfigapp::Main::signal_foreground_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::queue_draw));
- synfigapp::Main::signal_background_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::queue_draw));
+ synfigapp::Main::signal_outline_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::queue_draw));
+ synfigapp::Main::signal_fill_color_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::queue_draw));
synfigapp::Main::signal_gradient_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::queue_draw));
synfigapp::Main::signal_bline_width_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::queue_draw));
if(App::dialog_color)
{
- App::dialog_color->set_color(synfigapp::Main::get_foreground_color());
+ App::dialog_color->set_color(synfigapp::Main::get_outline_color());
App::dialog_color->reset();
- App::dialog_color->signal_edited().connect(sigc::mem_fun(synfigapp::Main::set_foreground_color));
+ App::dialog_color->signal_edited().connect(sigc::mem_fun(synfigapp::Main::set_outline_color));
}
*/
}
}
void
-Widget_Defaults::fg_color_refresh()
+Widget_Defaults::otln_color_refresh()
{
- widget_fg_color->set_value(synfigapp::Main::get_foreground_color());
+ widget_otln_color->set_value(synfigapp::Main::get_outline_color());
}
void
-Widget_Defaults::bg_color_refresh()
+Widget_Defaults::fill_color_refresh()
{
- widget_bg_color->set_value(synfigapp::Main::get_background_color());
+ widget_fill_color->set_value(synfigapp::Main::get_fill_color());
}
void
}
void
-Widget_Defaults::on_fg_color_clicked()
+Widget_Defaults::on_otln_color_clicked()
{
- // Left click on foreground
- App::dialog_color->set_color(synfigapp::Main::get_foreground_color());
+ // Left click on outline color
+ App::dialog_color->set_color(synfigapp::Main::get_outline_color());
App::dialog_color->reset();
- App::dialog_color->signal_edited().connect(sigc::ptr_fun(synfigapp::Main::set_foreground_color));
+ App::dialog_color->signal_edited().connect(sigc::ptr_fun(synfigapp::Main::set_outline_color));
App::dialog_color->present();
}
void
-Widget_Defaults::on_bg_color_clicked()
+Widget_Defaults::on_fill_color_clicked()
{
- // Left click on background
- App::dialog_color->set_color(synfigapp::Main::get_background_color());
+ // Left click on fill color
+ App::dialog_color->set_color(synfigapp::Main::get_fill_color());
App::dialog_color->reset();
- App::dialog_color->signal_edited().connect(sigc::ptr_fun(synfigapp::Main::set_background_color));
+ App::dialog_color->signal_edited().connect(sigc::ptr_fun(synfigapp::Main::set_fill_color));
App::dialog_color->present();
}
void
Widget_Defaults::on_reset_color_clicked()
{
- synfigapp::Main::set_background_color(Color::white());
- synfigapp::Main::set_foreground_color(Color::black());
+ synfigapp::Main::set_fill_color(Color::white());
+ synfigapp::Main::set_outline_color(Color::black());
}
void
const int w(get_width());
const int size=std::min(h-GRADIENT_HEIGHT,w);
- render_color_to_window(get_window(),Gdk::Rectangle(size/4,size/4,size/4*3-1,size/4*3-1),synfigapp::Main::get_background_color());
- render_color_to_window(get_window(),Gdk::Rectangle(0,0,size/4*3-1,size/4*3-1),synfigapp::Main::get_foreground_color());
+ render_color_to_window(get_window(),Gdk::Rectangle(size/4,size/4,size/4*3-1,size/4*3-1),synfigapp::Main::get_fill_color());
+ render_color_to_window(get_window(),Gdk::Rectangle(0,0,size/4*3-1,size/4*3-1),synfigapp::Main::get_outline_color());
render_gradient_to_window(get_window(),Gdk::Rectangle(0,h-GRADIENT_HEIGHT,w,GRADIENT_HEIGHT-1),synfigapp::Main::get_gradient());
{
if(x<size*3/4 && y<size*3/4)
{
- // Left click on foreground
- App::dialog_color->set_color(synfigapp::Main::get_foreground_color());
+ // Left click on outline coloe
+ App::dialog_color->set_color(synfigapp::Main::get_outline_color());
App::dialog_color->reset();
- App::dialog_color->signal_edited().connect(sigc::mem_fun(synfigapp::Main::set_foreground_color));
+ App::dialog_color->signal_edited().connect(sigc::mem_fun(synfigapp::Main::set_outline_color));
App::dialog_color->present();
return true;
}
if(x>size*3/4 && y>size/4)
{
- // Left click on background
- App::dialog_color->set_color(synfigapp::Main::get_background_color());
+ // Left click on fill color
+ App::dialog_color->set_color(synfigapp::Main::get_fill_color());
App::dialog_color->reset();
- App::dialog_color->signal_edited().connect(sigc::mem_fun(synfigapp::Main::set_background_color));
+ App::dialog_color->signal_edited().connect(sigc::mem_fun(synfigapp::Main::set_fill_color));
App::dialog_color->present();
return true;
}
class Widget_Defaults : public Gtk::Table
{
Widget_Brush *widget_brush;
- Widget_Color *widget_fg_color;
- Widget_Color *widget_bg_color;
+ Widget_Color *widget_otln_color;
+ Widget_Color *widget_fill_color;
Widget_Distance *widget_bline_width;
Widget_Gradient *widget_gradient;
Widget_Enum *widget_blend_method;
Widget_Enum *widget_interpolation;
Gtk::HScale *widget_opacity;
- void fg_color_refresh();
- void bg_color_refresh();
+ void otln_color_refresh();
+ void fill_color_refresh();
void gradient_refresh();
void bline_width_refresh();
void interpolation_refresh();
void on_bline_width_changed();
- void on_fg_color_clicked();
- void on_bg_color_clicked();
+ void on_otln_color_clicked();
+ void on_fill_color_clicked();
void on_swap_color_clicked();
void on_reset_color_clicked();
void on_gradient_clicked();
ADD_ACTION(Action::BLinePointTangentSplit);
ADD_ACTION(Action::GradientSet);
- ADD_ACTION(Action::ColorSetFromFG);
- ADD_ACTION(Action::ColorSetFromBG);
+ ADD_ACTION(Action::ColorSetFromOC);
+ ADD_ACTION(Action::ColorSetFromFC);
ADD_ACTION(Action::TimepointsMove);
ADD_ACTION(Action::TimepointsCopy);
/* === M A C R O S ========================================================= */
-ACTION_INIT(Action::ColorSetFromFG);
-ACTION_SET_NAME(Action::ColorSetFromFG, "ColorSetFromFG");
-ACTION_SET_LOCAL_NAME(Action::ColorSetFromFG, N_("Apply Foreground Color"));
-ACTION_SET_TASK(Action::ColorSetFromFG, "set");
-ACTION_SET_CATEGORY(Action::ColorSetFromFG, Action::CATEGORY_VALUEDESC);
-ACTION_SET_PRIORITY(Action::ColorSetFromFG, 0);
-ACTION_SET_VERSION(Action::ColorSetFromFG, "0.0");
-ACTION_SET_CVS_ID(Action::ColorSetFromFG, "$Id$");
-
-ACTION_INIT(Action::ColorSetFromBG);
-ACTION_SET_NAME(Action::ColorSetFromBG, "ColorSetFromBG");
-ACTION_SET_LOCAL_NAME(Action::ColorSetFromBG, N_("Apply Background Color"));
-ACTION_SET_TASK(Action::ColorSetFromBG, "set");
-ACTION_SET_CATEGORY(Action::ColorSetFromBG, Action::CATEGORY_VALUEDESC);
-ACTION_SET_PRIORITY(Action::ColorSetFromBG, 0);
-ACTION_SET_VERSION(Action::ColorSetFromBG, "0.0");
-ACTION_SET_CVS_ID(Action::ColorSetFromBG, "$Id$");
+ACTION_INIT(Action::ColorSetFromOC);
+ACTION_SET_NAME(Action::ColorSetFromOC, "ColorSetFromOC");
+ACTION_SET_LOCAL_NAME(Action::ColorSetFromOC, N_("Apply Outline Color"));
+ACTION_SET_TASK(Action::ColorSetFromOC, "set");
+ACTION_SET_CATEGORY(Action::ColorSetFromOC, Action::CATEGORY_VALUEDESC);
+ACTION_SET_PRIORITY(Action::ColorSetFromOC, 0);
+ACTION_SET_VERSION(Action::ColorSetFromOC, "0.0");
+ACTION_SET_CVS_ID(Action::ColorSetFromOC, "$Id$");
+
+ACTION_INIT(Action::ColorSetFromFC);
+ACTION_SET_NAME(Action::ColorSetFromFC, "ColorSetFromFC");
+ACTION_SET_LOCAL_NAME(Action::ColorSetFromFC, N_("Apply Fill Color"));
+ACTION_SET_TASK(Action::ColorSetFromFC, "set");
+ACTION_SET_CATEGORY(Action::ColorSetFromFC, Action::CATEGORY_VALUEDESC);
+ACTION_SET_PRIORITY(Action::ColorSetFromFC, 0);
+ACTION_SET_VERSION(Action::ColorSetFromFC, "0.0");
+ACTION_SET_CVS_ID(Action::ColorSetFromFC, "$Id$");
/* === G L O B A L S ======================================================= */
/* === M E T H O D S ======================================================= */
-Action::ColorSet::ColorSet(bool use_fg_color):
- time(0), use_fg_color(use_fg_color)
+Action::ColorSet::ColorSet(bool use_outline_color):
+ time(0), use_outline_color(use_outline_color)
{
}
value_desc_list.push_back(value_desc);
- // Grab the current fore- or background color
- if (use_fg_color)
- color = synfigapp::Main::get_foreground_color();
+ // Grab the current outline or fill color
+ if (use_outline_color)
+ color = synfigapp::Main::get_outline_color();
else
- color = synfigapp::Main::get_background_color();
+ color = synfigapp::Main::get_fill_color();
return true;
}
std::list<ValueDesc> value_desc_list;
synfig::Color color;
synfig::Time time;
- bool use_fg_color;
+ bool use_outline_color;
public:
- ColorSet(bool use_fg_color);
+ ColorSet(bool use_outline_color);
static ParamVocab get_param_vocab();
static bool is_candidate(const ParamList &x);
virtual void prepare();
};
-class ColorSetFromFG : public ColorSet
+class ColorSetFromOC : public ColorSet
{
public:
- ColorSetFromFG() : ColorSet(true) {}
+ ColorSetFromOC() : ColorSet(true) {}
ACTION_MODULE_EXT
};
-class ColorSetFromBG : public ColorSet
+class ColorSetFromFC : public ColorSet
{
public:
- ColorSetFromBG() : ColorSet(false) {}
+ ColorSetFromFC() : ColorSet(false) {}
ACTION_MODULE_EXT
layer->set_canvas(canvas);
// Apply some defaults
- if(layer->set_param("fg",synfigapp::Main::get_foreground_color()))
- layer->set_param("bg",synfigapp::Main::get_background_color());
- else if (name == "SolidColor")
- layer->set_param("color",synfigapp::Main::get_background_color());
+ if(layer->set_param("fg",synfigapp::Main::get_outline_color()))
+ layer->set_param("bg",synfigapp::Main::get_fill_color());
+ else if (name == "outline")
+ layer->set_param("color",synfigapp::Main::get_outline_color());
else
- layer->set_param("color",synfigapp::Main::get_foreground_color());
+ layer->set_param("color",synfigapp::Main::get_fill_color());
layer->set_param("width",synfigapp::Main::get_bline_width().units(get_canvas()->rend_desc()));
layer->set_param("gradient",synfigapp::Main::get_gradient());
value=strprintf("%i",(int)input_device->get_blend_method());
return true;
}
- if(key=="color")
+ if(key=="outline_color")
{
- Color c(input_device->get_foreground_color());
+ Color c(input_device->get_outline_color());
value=strprintf("%f %f %f %f",(float)c.get_r(),(float)c.get_g(),(float)c.get_b(),(float)c.get_a());
return true;
}
- if(key=="bgcolor")
+ if(key=="fill_color")
{
- Color c(input_device->get_background_color());
+ Color c(input_device->get_fill_color());
value=strprintf("%f %f %f %f",(float)c.get_r(),(float)c.get_g(),(float)c.get_b(),(float)c.get_a());
return true;
input_device->set_blend_method(Color::BlendMethod(atoi(value.c_str())));
return true;
}
- if(key=="color")
+ if(key=="outline_color")
{
float r=0,g=0,b=0,a=1;
if(!strscanf(value,"%f %f %f %f",&r,&g,&b,&a))
return false;
- input_device->set_foreground_color(synfig::Color(r,g,b,a));
+ input_device->set_outline_color(synfig::Color(r,g,b,a));
return true;
}
- if(key=="bgcolor")
+ if(key=="fill_color")
{
float r=0,g=0,b=0,a=1;
if(!strscanf(value,"%f %f %f %f",&r,&g,&b,&a))
return false;
- input_device->set_background_color(synfig::Color(r,g,b,a));
+ input_device->set_fill_color(synfig::Color(r,g,b,a));
return true;
}
if(key=="mode")
virtual KeyList get_key_list()const
{
KeyList ret(Settings::get_key_list());
- ret.push_back("color");
- ret.push_back("bgcolor");
+ ret.push_back("outline_color");
+ ret.push_back("fill_color");
ret.push_back("state");
ret.push_back("bline_width");
ret.push_back("blend_method");
id_(id_),
type_(type_),
state_((type_==TYPE_PEN)?"draw":"normal"),
- foreground_color_(Color::black()),
- background_color_(Color::white()),
+ outline_color_(Color::black()),
+ fill_color_(Color::white()),
bline_width_(Distance(1,Distance::SYSTEM_POINTS)),
opacity_(1.0f),
blend_method_(Color::BLEND_COMPOSITE),
** \see synfigapp::Settings
**
** The represenation includes both the GDK state (e.g., mode) and synfigstudio
-** state (e.g., foreground color). An object of this class can be saved and
+** state (e.g., outline color). An object of this class can be saved and
** restored using its Settings object, provided by the settings method.
*/
class InputDevice : public etl::shared_object
synfig::String id_;
Type type_;
synfig::String state_;
- synfig::Color foreground_color_;
- synfig::Color background_color_;
+ synfig::Color outline_color_;
+ synfig::Color fill_color_;
synfig::Distance bline_width_;
synfig::Real opacity_;
synfig::Color::BlendMethod blend_method_;
const synfig::String& get_id()const { return id_; }
const synfig::String& get_state()const { return state_; }
- const synfig::Color& get_foreground_color()const { return foreground_color_; }
- const synfig::Color& get_background_color()const { return background_color_; }
+ const synfig::Color& get_outline_color()const { return outline_color_; }
+ const synfig::Color& get_fill_color()const { return fill_color_; }
const synfig::Distance& get_bline_width()const { return bline_width_; }
const synfig::Real& get_opacity()const { return opacity_; }
const synfig::Color::BlendMethod& get_blend_method()const { return blend_method_; }
const std::vector<DeviceKey> & get_keys()const { return keys_; }
void set_state(const synfig::String& x) { state_=x; }
- void set_foreground_color(const synfig::Color& x) { foreground_color_=x; }
- void set_background_color(const synfig::Color& x) { background_color_=x; }
+ void set_outline_color(const synfig::Color& x) { outline_color_=x; }
+ void set_fill_color(const synfig::Color& x) { fill_color_=x; }
void set_bline_width(const synfig::Distance& x) { bline_width_=x; }
void set_blend_method(const synfig::Color::BlendMethod& x) { blend_method_=x; }
void set_opacity(const synfig::Real& x) { opacity_=x; }
static etl::reference_counter synfigapp_ref_count_(0);
static synfigapp::Action::Main* action_main;
-static Color foreground_;
-static Color background_;
+static Color outline_;
+static Color fill_;
static Gradient gradient_;
static bool gradient_default_colors_;
static synfigapp::InputDevice::Handle selected_input_device_;
static list<synfigapp::InputDevice::Handle> input_devices_;
-trivial<sigc::signal<void> > signal_foreground_color_changed_;
-trivial<sigc::signal<void> > signal_background_color_changed_;
+trivial<sigc::signal<void> > signal_outline_color_changed_;
+trivial<sigc::signal<void> > signal_fill_color_changed_;
trivial<sigc::signal<void> > signal_gradient_changed_;
trivial<sigc::signal<void> > signal_bline_width_changed_;
trivial<sigc::signal<void> > signal_blend_method_changed_;
settings_.construct();
- signal_foreground_color_changed_.construct();
- signal_background_color_changed_.construct();
+ signal_outline_color_changed_.construct();
+ signal_fill_color_changed_.construct();
signal_gradient_changed_.construct();
signal_opacity_changed_.construct();
signal_blend_method_changed_.construct();
signal_interpolation_changed_.construct();
- set_foreground_color(Color::black());
- set_background_color(Color::white());
+ set_outline_color(Color::black());
+ set_fill_color(Color::white());
set_gradient_default_colors();
set_bline_width(Distance(1,Distance::SYSTEM_POINTS));
set_opacity(1.0);
input_devices_.clear();
settings_.destruct();
- signal_foreground_color_changed_.destruct();
- signal_background_color_changed_.destruct();
+ signal_outline_color_changed_.destruct();
+ signal_fill_color_changed_.destruct();
signal_gradient_changed_.destruct();
signal_opacity_changed_.destruct();
}
sigc::signal<void>&
-synfigapp::Main::signal_foreground_color_changed()
+synfigapp::Main::signal_outline_color_changed()
{
- return signal_foreground_color_changed_;
+ return signal_outline_color_changed_;
}
sigc::signal<void>&
-synfigapp::Main::signal_background_color_changed()
+synfigapp::Main::signal_fill_color_changed()
{
- return signal_background_color_changed_;
+ return signal_fill_color_changed_;
}
sigc::signal<void>&
}
const synfig::Color&
-synfigapp::Main::get_foreground_color()
+synfigapp::Main::get_outline_color()
{
- return foreground_;
+ return outline_;
}
const synfig::Color&
-synfigapp::Main::get_background_color()
+synfigapp::Main::get_fill_color()
{
- return background_;
+ return fill_;
}
const synfig::Gradient&
}
void
-synfigapp::Main::set_foreground_color(synfig::Color color)
+synfigapp::Main::set_outline_color(synfig::Color color)
{
- foreground_=color;
- signal_foreground_color_changed()();
+ outline_=color;
+ signal_outline_color_changed()();
if(selected_input_device_)
- selected_input_device_->set_foreground_color(foreground_);
+ selected_input_device_->set_outline_color(outline_);
if(gradient_default_colors_)
{
- gradient_=Gradient(foreground_,background_);
+ gradient_=Gradient(fill_,outline_);
signal_gradient_changed()();
}
}
void
-synfigapp::Main::set_background_color(synfig::Color color)
+synfigapp::Main::set_fill_color(synfig::Color color)
{
- background_=color;
- signal_background_color_changed()();
+ fill_=color;
+ signal_fill_color_changed()();
if(selected_input_device_)
- selected_input_device_->set_background_color(background_);
+ selected_input_device_->set_fill_color(fill_);
if(gradient_default_colors_)
{
- gradient_=Gradient(foreground_,background_);
+ gradient_=Gradient(fill_,outline_);
signal_gradient_changed()();
}
}
synfigapp::Main::set_gradient_default_colors()
{
gradient_default_colors_=true;
- gradient_=Gradient(foreground_,background_);
+ gradient_=Gradient(fill_,outline_);
signal_gradient_changed()();
}
void
synfigapp::Main::color_swap()
{
- const Color tmp(foreground_);
- foreground_=background_;
- background_=tmp;
+ const Color tmp(outline_);
+ outline_=fill_;
+ fill_=tmp;
if(selected_input_device_)
{
- selected_input_device_->set_foreground_color(foreground_);
- selected_input_device_->set_background_color(background_);
+ selected_input_device_->set_outline_color(outline_);
+ selected_input_device_->set_fill_color(fill_);
}
- signal_foreground_color_changed()();
- signal_background_color_changed()();
+ signal_outline_color_changed()();
+ signal_fill_color_changed()();
if(gradient_default_colors_)
{
- gradient_=Gradient(foreground_,background_);
+ gradient_=Gradient(fill_,outline_);
signal_gradient_changed()();
}
}
selected_input_device_=input_device;
set_bline_width(input_device->get_bline_width());
- set_foreground_color(input_device->get_foreground_color());
- set_background_color(input_device->get_background_color());
+ set_outline_color(input_device->get_outline_color());
+ set_fill_color(input_device->get_fill_color());
set_opacity(input_device->get_opacity());
set_blend_method(input_device->get_blend_method());
const etl::reference_counter& ref_count()const { return ref_count_; }
- static const synfig::Color& get_foreground_color();
- static const synfig::Color& get_background_color();
+ static const synfig::Color& get_outline_color();
+ static const synfig::Color& get_fill_color();
static const synfig::Gradient& get_gradient();
static const synfig::Distance& get_bline_width();
static synfig::Waypoint::Interpolation get_interpolation();
static void set_interpolation(synfig::Waypoint::Interpolation x);
static void set_bline_width(synfig::Distance x);
- static void set_foreground_color(synfig::Color color);
- static void set_background_color(synfig::Color color);
+ static void set_outline_color(synfig::Color color);
+ static void set_fill_color(synfig::Color color);
static void set_gradient(synfig::Gradient gradient);
static void set_gradient_default_colors();
static void color_swap();
static Settings& settings();
// Signal interfaces
- static sigc::signal<void>& signal_foreground_color_changed();
- static sigc::signal<void>& signal_background_color_changed();
+ static sigc::signal<void>& signal_outline_color_changed();
+ static sigc::signal<void>& signal_fill_color_changed();
static sigc::signal<void>& signal_gradient_changed();
static sigc::signal<void>& signal_bline_width_changed();