added API to set the selected point.
2007-11-02 Michael Natterer <mitch@gimp.org> * app/widgets/gimphistogramview.[ch]: added API to set the selected point. * app/tools/gimpcurvestool.c: use it. svn path=/trunk/; revision=24046
This commit is contained in:

committed by
Michael Natterer

parent
e5927feba1
commit
6c64c64b07
@ -1,3 +1,10 @@
|
|||||||
|
2007-11-02 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
|
* app/widgets/gimphistogramview.[ch]: added API to set the
|
||||||
|
selected point.
|
||||||
|
|
||||||
|
* app/tools/gimpcurvestool.c: use it.
|
||||||
|
|
||||||
2007-11-02 Michael Natterer <mitch@gimp.org>
|
2007-11-02 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* app/core/gimpcurve.[ch]: added API to modify free-form curves
|
* app/core/gimpcurve.[ch]: added API to modify free-form curves
|
||||||
|
@ -297,7 +297,8 @@ gimp_curves_tool_button_release (GimpTool *tool,
|
|||||||
gimp_curve_get_closest_point (curve,
|
gimp_curve_get_closest_point (curve,
|
||||||
c_tool->col_value[c_tool->channel]);
|
c_tool->col_value[c_tool->channel]);
|
||||||
|
|
||||||
GIMP_HISTOGRAM_VIEW (c_tool->graph)->selected = c_tool->selected;
|
gimp_histogram_view_set_selected (GIMP_HISTOGRAM_VIEW (c_tool->graph),
|
||||||
|
c_tool->selected);
|
||||||
|
|
||||||
gimp_curve_set_point (curve,
|
gimp_curve_set_point (curve,
|
||||||
c_tool->selected,
|
c_tool->selected,
|
||||||
@ -316,7 +317,8 @@ gimp_curves_tool_button_release (GimpTool *tool,
|
|||||||
gimp_curve_get_closest_point (curve,
|
gimp_curve_get_closest_point (curve,
|
||||||
c_tool->col_value[i]);
|
c_tool->col_value[i]);
|
||||||
|
|
||||||
GIMP_HISTOGRAM_VIEW (c_tool->graph)->selected = c_tool->selected;
|
gimp_histogram_view_set_selected (GIMP_HISTOGRAM_VIEW (c_tool->graph),
|
||||||
|
c_tool->selected);
|
||||||
|
|
||||||
gimp_curve_set_point (curve,
|
gimp_curve_set_point (curve,
|
||||||
c_tool->selected,
|
c_tool->selected,
|
||||||
@ -426,8 +428,9 @@ curves_key_press (GimpCurvesTool *tool,
|
|||||||
if (curve->points[i][0] != -1)
|
if (curve->points[i][0] != -1)
|
||||||
{
|
{
|
||||||
tool->selected = i;
|
tool->selected = i;
|
||||||
GIMP_HISTOGRAM_VIEW (tool->graph)->selected = i;
|
|
||||||
gtk_widget_queue_draw (tool->graph);
|
gimp_histogram_view_set_selected (GIMP_HISTOGRAM_VIEW (tool->graph),
|
||||||
|
i);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -440,8 +443,9 @@ curves_key_press (GimpCurvesTool *tool,
|
|||||||
if (curve->points[i][0] != -1)
|
if (curve->points[i][0] != -1)
|
||||||
{
|
{
|
||||||
tool->selected = i;
|
tool->selected = i;
|
||||||
GIMP_HISTOGRAM_VIEW (tool->graph)->selected = i;
|
|
||||||
gtk_widget_queue_draw (tool->graph);
|
gimp_histogram_view_set_selected (GIMP_HISTOGRAM_VIEW (tool->graph),
|
||||||
|
i);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -1009,7 +1013,9 @@ curves_graph_events (GtkWidget *widget,
|
|||||||
}
|
}
|
||||||
|
|
||||||
tool->selected = closest_point;
|
tool->selected = closest_point;
|
||||||
GIMP_HISTOGRAM_VIEW (tool->graph)->selected = closest_point;
|
|
||||||
|
gimp_histogram_view_set_selected (GIMP_HISTOGRAM_VIEW (tool->graph),
|
||||||
|
closest_point);
|
||||||
|
|
||||||
gimp_curve_set_point (curve, tool->selected, x, 255 - y);
|
gimp_curve_set_point (curve, tool->selected, x, 255 - y);
|
||||||
|
|
||||||
@ -1019,8 +1025,10 @@ curves_graph_events (GtkWidget *widget,
|
|||||||
gimp_curve_set_curve (curve, x, 255 - y);
|
gimp_curve_set_curve (curve, x, 255 - y);
|
||||||
|
|
||||||
tool->selected = x;
|
tool->selected = x;
|
||||||
GIMP_HISTOGRAM_VIEW (tool->graph)->selected = x;
|
|
||||||
tool->last = y;
|
tool->last = y;
|
||||||
|
|
||||||
|
gimp_histogram_view_set_selected (GIMP_HISTOGRAM_VIEW (tool->graph),
|
||||||
|
x);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1072,7 +1080,9 @@ curves_graph_events (GtkWidget *widget,
|
|||||||
if (curve->points[closest_point][0] == -1)
|
if (curve->points[closest_point][0] == -1)
|
||||||
{
|
{
|
||||||
tool->selected = closest_point;
|
tool->selected = closest_point;
|
||||||
GIMP_HISTOGRAM_VIEW (tool->graph)->selected = closest_point;
|
|
||||||
|
gimp_histogram_view_set_selected (GIMP_HISTOGRAM_VIEW (tool->graph),
|
||||||
|
closest_point);
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_curve_set_point (curve, tool->selected, x, 255 - y);
|
gimp_curve_set_point (curve, tool->selected, x, 255 - y);
|
||||||
@ -1110,8 +1120,10 @@ curves_graph_events (GtkWidget *widget,
|
|||||||
}
|
}
|
||||||
|
|
||||||
tool->selected = x;
|
tool->selected = x;
|
||||||
GIMP_HISTOGRAM_VIEW (tool->graph)->selected = x;
|
|
||||||
tool->last = y;
|
tool->last = y;
|
||||||
|
|
||||||
|
gimp_histogram_view_set_selected (GIMP_HISTOGRAM_VIEW (tool->graph),
|
||||||
|
x);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mevent->state & GDK_BUTTON1_MASK)
|
if (mevent->state & GDK_BUTTON1_MASK)
|
||||||
|
@ -815,6 +815,17 @@ gimp_histogram_view_get_curve (GimpHistogramView *view)
|
|||||||
return view->curve;
|
return view->curve;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gimp_histogram_view_set_selected (GimpHistogramView *view,
|
||||||
|
gint selected)
|
||||||
|
{
|
||||||
|
g_return_if_fail (GIMP_IS_HISTOGRAM_VIEW (view));
|
||||||
|
|
||||||
|
view->selected = selected;
|
||||||
|
|
||||||
|
gtk_widget_queue_draw (GTK_WIDGET (view));
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_histogram_view_set_xpos (GimpHistogramView *view,
|
gimp_histogram_view_set_xpos (GimpHistogramView *view,
|
||||||
gint x)
|
gint x)
|
||||||
|
@ -96,6 +96,8 @@ void gimp_histogram_view_set_curve (GimpHistogramView *view,
|
|||||||
GimpCurve *curve);
|
GimpCurve *curve);
|
||||||
GimpCurve * gimp_histogram_view_get_curve (GimpHistogramView *view);
|
GimpCurve * gimp_histogram_view_get_curve (GimpHistogramView *view);
|
||||||
|
|
||||||
|
void gimp_histogram_view_set_selected (GimpHistogramView *view,
|
||||||
|
gint selected);
|
||||||
void gimp_histogram_view_set_xpos (GimpHistogramView *view,
|
void gimp_histogram_view_set_xpos (GimpHistogramView *view,
|
||||||
gint x);
|
gint x);
|
||||||
void gimp_histogram_view_set_cusor (GimpHistogramView *view,
|
void gimp_histogram_view_set_cusor (GimpHistogramView *view,
|
||||||
|
Reference in New Issue
Block a user