app: Add API to remove all background curves from the curve view

Also, use this change in cuves tool.
This commit is contained in:
Alexia Death 2010-02-27 19:03:40 +02:00
parent 1e26bb1348
commit 45c835aaa2
3 changed files with 24 additions and 6 deletions

View file

@ -785,12 +785,7 @@ gimp_curves_tool_config_notify (GObject *object,
gimp_color_bar_set_channel (GIMP_COLOR_BAR (tool->yrange),
config->channel);
gimp_curve_view_remove_background (GIMP_CURVE_VIEW (tool->graph),
config->curve[GIMP_HISTOGRAM_RED]);
gimp_curve_view_remove_background (GIMP_CURVE_VIEW (tool->graph),
config->curve[GIMP_HISTOGRAM_GREEN]);
gimp_curve_view_remove_background (GIMP_CURVE_VIEW (tool->graph),
config->curve[GIMP_HISTOGRAM_BLUE]);
gimp_curve_view_remove_all_backgrounds (GIMP_CURVE_VIEW (tool->graph));
gimp_rgb_set (&red, 1.0, 0.0, 0.0);
gimp_rgb_set (&green, 0.0, 1.0, 0.0);

View file

@ -1188,6 +1188,27 @@ gimp_curve_view_remove_background (GimpCurveView *view,
}
}
void
gimp_curve_view_remove_all_backgrounds (GimpCurveView *view)
{
GList *list;
g_return_if_fail (GIMP_IS_CURVE_VIEW (view));
for (list = view->bg_curves; list; list = g_list_next (list))
{
BGCurve *bg = list->data;
g_object_unref (bg->curve);
view->bg_curves = g_list_remove (view->bg_curves, bg);
g_slice_free (BGCurve, bg);
}
gtk_widget_queue_draw (GTK_WIDGET (view));
}
void
gimp_curve_view_set_selected (GimpCurveView *view,
gint selected)

View file

@ -93,6 +93,8 @@ void gimp_curve_view_add_background (GimpCurveView *view,
void gimp_curve_view_remove_background (GimpCurveView *view,
GimpCurve *curve);
void gimp_curve_view_remove_all_backgrounds (GimpCurveView *view);
void gimp_curve_view_set_selected (GimpCurveView *view,
gint selected);
void gimp_curve_view_set_range_x (GimpCurveView *view,