Apply patch #17: Implement a Fill/Outline system in place of Foreground/Background...
authorgenete <genete@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 22 Apr 2009 14:28:06 +0000 (14:28 +0000)
committerCarlos Lopez <carlos@pcnuevo.(none)>
Fri, 12 Jun 2009 14:27:51 +0000 (16:27 +0200)
nikitakit

git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2361 1f10aa63-cdf2-0310-b900-c93c546f37ac

23 files changed:
synfig-studio/trunk/src/gtkmm/dialog_color.cpp
synfig-studio/trunk/src/gtkmm/dialog_color.h
synfig-studio/trunk/src/gtkmm/mod_palette/dock_paledit.cpp
synfig-studio/trunk/src/gtkmm/state_bline.cpp
synfig-studio/trunk/src/gtkmm/state_circle.cpp
synfig-studio/trunk/src/gtkmm/state_draw.cpp
synfig-studio/trunk/src/gtkmm/state_eyedrop.cpp
synfig-studio/trunk/src/gtkmm/state_fill.cpp
synfig-studio/trunk/src/gtkmm/state_polygon.cpp
synfig-studio/trunk/src/gtkmm/state_rectangle.cpp
synfig-studio/trunk/src/gtkmm/state_sketch.cpp
synfig-studio/trunk/src/gtkmm/state_star.cpp
synfig-studio/trunk/src/gtkmm/state_stroke.cpp
synfig-studio/trunk/src/gtkmm/widget_defaults.cpp
synfig-studio/trunk/src/gtkmm/widget_defaults.h
synfig-studio/trunk/src/synfigapp/action.cpp
synfig-studio/trunk/src/synfigapp/actions/colorset.cpp
synfig-studio/trunk/src/synfigapp/actions/colorset.h
synfig-studio/trunk/src/synfigapp/canvasinterface.cpp
synfig-studio/trunk/src/synfigapp/inputdevice.cpp
synfig-studio/trunk/src/synfigapp/inputdevice.h
synfig-studio/trunk/src/synfigapp/main.cpp
synfig-studio/trunk/src/synfigapp/main.h

index bc7d5e1..aa70fd8 100644 (file)
@@ -63,10 +63,10 @@ Dialog_Color::Dialog_Color():
        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());
@@ -123,18 +123,18 @@ Dialog_Color::on_color_changed()
 }
 
 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;
 }
 
index 9825a53..ee350cf 100644 (file)
@@ -63,8 +63,8 @@ class Dialog_Color : public Gtk::Dialog
        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:
index fcafe64..88c8892 100644 (file)
@@ -126,7 +126,7 @@ Dock_PalEdit::Dock_PalEdit():
                "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,
@@ -151,7 +151,7 @@ Dock_PalEdit::Dock_PalEdit():
        /*
        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,
@@ -183,7 +183,7 @@ Dock_PalEdit::set_palette(const synfig::Palette& x)
 void
 Dock_PalEdit::on_add_pressed()
 {
-       add_color(synfigapp::Main::get_foreground_color());
+       add_color(synfigapp::Main::get_outline_color());
 }
 
 void
@@ -296,7 +296,7 @@ Dock_PalEdit::edit_color(int i)
 void
 Dock_PalEdit::select_color(int i)
 {
-       synfigapp::Main::set_foreground_color(get_color(i));
+       synfigapp::Main::set_outline_color(get_color(i));
 }
 
 void
index 74ccdc1..7a27d84 100644 (file)
@@ -762,9 +762,6 @@ StateBLine_Context::run_()
                                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.
                        {
index 8d893e4..fe82e21 100644 (file)
@@ -653,12 +653,6 @@ StateCircle_Context::make_circle(const Point& _p1, const Point& _p2)
                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)
@@ -867,9 +861,6 @@ StateCircle_Context::make_circle(const Point& _p1, const Point& _p2)
                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.
                {
index 9c55193..4d053bc 100644 (file)
@@ -625,7 +625,7 @@ StateDraw_Context::event_stroke(const Smach::event& x)
 
        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)
        {
@@ -677,7 +677,7 @@ StateDraw_Context::process_stroke(StrokeData stroke_data, WidthData width_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());
        //stroke_list.push_back(event.stroke_data);
        //refresh_ducks();
 
@@ -1798,7 +1798,7 @@ StateDraw_Context::new_region(std::list<synfig::BLinePoint> bline, synfig::Real
                        group.cancel();
                        return Smach::RESULT_ERROR;
                }
-               layer->set_param("color",synfigapp::Main::get_background_color());
+
                if(get_feather())
                {
                        layer->set_param("feather",get_feather());
@@ -1996,7 +1996,6 @@ StateDraw_Context::fill_last_stroke_and_unselect_other_layers()
        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"));
index 74eb7d8..6fb940d 100644 (file)
@@ -135,7 +135,7 @@ StateEyedrop_Context::event_workarea_mouse_button_down_handler(const Smach::even
        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;
        }
index e337156..60c929a 100644 (file)
@@ -150,7 +150,7 @@ StateFill_Context::event_workarea_layer_clicked_handler(const Smach::event& x)
        //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;
@@ -165,8 +165,8 @@ StateFill_Context::event_workarea_layer_clicked_handler(const Smach::event& x)
        //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))
        {
index b3a6c91..c016f1d 100644 (file)
@@ -551,13 +551,6 @@ StatePolygon_Context::run()
                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))
                {
@@ -759,9 +752,6 @@ StatePolygon_Context::run()
                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.
                {
index ee8496f..aa21c23 100644 (file)
@@ -541,12 +541,6 @@ StateRectangle_Context::make_rectangle(const Point& _p1, const Point& _p2)
 
                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");
-               }
        }
 
        ///////////////////////////////////////////////////////////////////////////
@@ -702,9 +696,6 @@ StateRectangle_Context::make_rectangle(const Point& _p1, const Point& _p2)
                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.
                {
index 308e3fe..0cac528 100644 (file)
@@ -499,7 +499,7 @@ StateSketch_Context::event_stroke(const Smach::event& x)
 
        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;
 }
index 6b16fd4..e5b3ace 100644 (file)
@@ -698,12 +698,6 @@ StateStar_Context::make_star(const Point& _p1, const Point& _p2)
                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)
@@ -897,9 +891,6 @@ StateStar_Context::make_star(const Point& _p1, const Point& _p2)
                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.
                {
index 158881d..a0f7eca 100644 (file)
@@ -129,7 +129,7 @@ StateStroke_Context::StateStroke_Context(CanvasView* canvas_view):
        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()
index 5158af0..e672b8f 100644 (file)
@@ -75,8 +75,8 @@ public:
                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)));
        }
@@ -100,11 +100,11 @@ public:
                        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,
@@ -115,7 +115,7 @@ public:
 */
 
                // 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(
@@ -206,21 +206,21 @@ Widget_Defaults::Widget_Defaults()
        {
                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;
 
@@ -237,7 +237,7 @@ Widget_Defaults::Widget_Defaults()
                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()));
@@ -316,14 +316,14 @@ Widget_Defaults::Widget_Defaults()
        // 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();
@@ -334,8 +334,8 @@ Widget_Defaults::Widget_Defaults()
        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));
 
@@ -348,9 +348,9 @@ Widget_Defaults::Widget_Defaults()
 
        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));
        }
 */
 }
@@ -360,15 +360,15 @@ Widget_Defaults::~Widget_Defaults()
 }
 
 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
@@ -426,22 +426,22 @@ Widget_Defaults::on_bline_width_changed()
 }
 
 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();
 }
 
@@ -454,8 +454,8 @@ Widget_Defaults::on_swap_color_clicked()
 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
@@ -478,8 +478,8 @@ Widget_Defaults::redraw(GdkEventExpose*bleh)
        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());
 
 
@@ -530,19 +530,19 @@ Widget_Defaults::on_event(GdkEvent *event)
                        {
                                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;
                                }
index a20efbc..705e2da 100644 (file)
@@ -51,23 +51,23 @@ class Widget_Enum;
 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();
index d3b4393..7a98252 100644 (file)
@@ -226,8 +226,8 @@ Action::Main::Main()
        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);
index 55bae1d..93e7c76 100644 (file)
@@ -50,23 +50,23 @@ using namespace Action;
 
 /* === 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 ======================================================= */
 
@@ -74,8 +74,8 @@ ACTION_SET_CVS_ID(Action::ColorSetFromBG, "$Id$");
 
 /* === 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)
 {
 }
 
@@ -126,11 +126,11 @@ Action::ColorSet::set_param(const synfig::String& name, const Action::Param &par
 
                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;
        }
index 6462ffa..954b62d 100644 (file)
@@ -49,11 +49,11 @@ private:
        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);
@@ -64,21 +64,21 @@ public:
        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
 
index f8f935e..bd7766f 100644 (file)
@@ -214,12 +214,12 @@ CanvasInterface::add_layer_to(synfig::String name, synfig::Canvas::Handle canvas
        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());
index 110f0cd..02ad5ed 100644 (file)
@@ -82,16 +82,16 @@ public:
                        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;
@@ -165,20 +165,20 @@ public:
                        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")
@@ -260,8 +260,8 @@ public:
        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");
@@ -281,8 +281,8 @@ InputDevice::InputDevice(const synfig::String id_, Type type_):
        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),
index e8c41a1..5ed5b42 100644 (file)
@@ -53,7 +53,7 @@ class Settings;
 **  \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
@@ -98,8 +98,8 @@ private:
        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_;
@@ -115,8 +115,8 @@ public:
 
        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_; }
@@ -126,8 +126,8 @@ public:
        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; }
index fb3da8f..1e396e4 100644 (file)
@@ -57,8 +57,8 @@ using namespace synfigapp;
 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_;
 
@@ -70,8 +70,8 @@ static Real opacity_;
 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_;
@@ -107,15 +107,15 @@ synfigapp::Main::Main(const synfig::String &basepath, synfig::ProgressCallback *
 
        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);
@@ -137,8 +137,8 @@ synfigapp::Main::~Main()
        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();
@@ -153,15 +153,15 @@ synfigapp::Main::settings()
 }
 
 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>&
@@ -195,15 +195,15 @@ synfigapp::Main::signal_interpolation_changed()
 }
 
 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&
@@ -225,31 +225,31 @@ synfigapp::Main::get_blend_method()
 }
 
 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()();
        }
 }
@@ -266,29 +266,29 @@ void
 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()();
        }
 }
@@ -389,8 +389,8 @@ synfigapp::Main::select_input_device(InputDevice::Handle input_device)
        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());
 
index d8811d1..cc33ef8 100644 (file)
@@ -66,8 +66,8 @@ public:
 
        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();
@@ -75,8 +75,8 @@ public:
 
        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();
@@ -100,8 +100,8 @@ public:
        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();