Since GimpVectorTool is no GimpSelectionTool, it does not make sense to

2003-11-15  Simon Budig  <simon@gimp.org>

	* app/tools/gimpvectoroptions.[ch]: Since GimpVectorTool is no
	GimpSelectionTool, it does not make sense to have
	GimpSelectionOptions for it.

	* app/tools/gimpvectoroptions.c
	* app/tools/gimpvectortool.c: Connect the Buttons to the
	Help system and make the to-selection Button modifier
	aware.
This commit is contained in:
Simon Budig
2003-11-14 23:10:24 +00:00
committed by Simon Budig
parent cc718bfa6b
commit 832b51b5a8
4 changed files with 73 additions and 14 deletions

View File

@ -136,6 +136,9 @@ static void gimp_vector_tool_undo_push (GimpVectorTool *vector_tool,
const gchar *desc);
static void gimp_vector_tool_to_selection (GimpVectorTool *vector_tool);
static void gimp_vector_tool_to_selection_extended
(GimpVectorTool *vector_tool,
gint state);
static void gimp_vector_tool_stroke_vectors (GimpVectorTool *vector_tool,
GtkWidget *button);
@ -1503,6 +1506,9 @@ gimp_vector_tool_set_vectors (GimpVectorTool *vector_tool,
g_signal_handlers_disconnect_by_func (sel_button,
gimp_vector_tool_to_selection,
tool);
g_signal_handlers_disconnect_by_func (sel_button,
gimp_vector_tool_to_selection_extended,
tool);
}
if (stroke_button)
@ -1553,6 +1559,9 @@ gimp_vector_tool_set_vectors (GimpVectorTool *vector_tool,
g_signal_connect_swapped (sel_button, "clicked",
G_CALLBACK (gimp_vector_tool_to_selection),
tool);
g_signal_connect_swapped (sel_button, "extended_clicked",
G_CALLBACK (gimp_vector_tool_to_selection_extended),
tool);
gtk_widget_set_sensitive (sel_button, TRUE);
}
@ -1740,19 +1749,41 @@ gimp_vector_tool_undo_push (GimpVectorTool *vector_tool, const gchar *desc)
static void
gimp_vector_tool_to_selection (GimpVectorTool *vector_tool)
{
gimp_vector_tool_to_selection_extended (vector_tool, 0);
}
static void
gimp_vector_tool_to_selection_extended (GimpVectorTool *vector_tool,
gint state)
{
GimpImage *gimage;
GimpChannelOps operation = GIMP_CHANNEL_OP_REPLACE;
if (! vector_tool->vectors)
return;
gimage = gimp_item_get_image (GIMP_ITEM (vector_tool->vectors));
if (state & GDK_SHIFT_MASK)
{
if (state & GDK_CONTROL_MASK)
operation = GIMP_CHANNEL_OP_INTERSECT;
else
operation = GIMP_CHANNEL_OP_ADD;
}
else if (state & GDK_CONTROL_MASK)
{
operation = GIMP_CHANNEL_OP_SUBTRACT;
}
gimp_channel_select_vectors (gimp_image_get_mask (gimage),
_("Path to Selection"),
vector_tool->vectors,
GIMP_CHANNEL_OP_REPLACE,
operation,
TRUE, FALSE, 0, 0);
gimp_image_flush (gimage);
}