Commit 44d33bfd authored by Michael Natterer's avatar Michael Natterer 😴

app: change return value of GimpToolWidget::button_press() from gboolean to gint

so widgets can return which handle was clicked. The values boolean
semantics stay the same so if(retval) gives the same result. This is
useful for the upcoming transform tool widgets.
parent b097dce9
......@@ -118,7 +118,7 @@ static void gimp_tool_compass_get_property (GObject *object
GParamSpec *pspec);
static void gimp_tool_compass_changed (GimpToolWidget *widget);
static gboolean gimp_tool_compass_button_press (GimpToolWidget *widget,
static gint gimp_tool_compass_button_press (GimpToolWidget *widget,
const GimpCoords *coords,
guint32 time,
GdkModifierType state,
......@@ -557,7 +557,7 @@ gimp_tool_compass_changed (GimpToolWidget *widget)
gimp_tool_compass_update_hilight (compass);
}
gboolean
gint
gimp_tool_compass_button_press (GimpToolWidget *widget,
const GimpCoords *coords,
guint32 time,
......@@ -639,7 +639,7 @@ gimp_tool_compass_button_press (GimpToolWidget *widget,
private->function = ADDING;
}
return TRUE;
return 1;
}
void
......
......@@ -105,7 +105,7 @@ static void gimp_tool_line_get_property (GObject *object,
GParamSpec *pspec);
static void gimp_tool_line_changed (GimpToolWidget *widget);
static gboolean gimp_tool_line_button_press (GimpToolWidget *widget,
static gint gimp_tool_line_button_press (GimpToolWidget *widget,
const GimpCoords *coords,
guint32 time,
GdkModifierType state,
......@@ -372,10 +372,10 @@ gimp_tool_line_button_press (GimpToolWidget *widget,
gimp_tool_line_point_motion (line,
state & gimp_get_constrain_behavior_mask ());
return TRUE;
return 1;
}
return FALSE;
return 0;
}
void
......
......@@ -430,22 +430,22 @@ gimp_tool_widget_add_transform_guides (GimpToolWidget *widget,
return item;
}
gboolean
gint
gimp_tool_widget_button_press (GimpToolWidget *widget,
const GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpButtonPressType press_type)
{
g_return_val_if_fail (GIMP_IS_TOOL_WIDGET (widget), FALSE);
g_return_val_if_fail (coords != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_TOOL_WIDGET (widget), 0);
g_return_val_if_fail (coords != NULL, 0);
if (GIMP_TOOL_WIDGET_GET_CLASS (widget)->button_press)
return GIMP_TOOL_WIDGET_GET_CLASS (widget)->button_press (widget,
coords, time, state,
press_type);
return FALSE;
return 0;
}
void
......
......@@ -58,7 +58,7 @@ struct _GimpToolWidgetClass
const gchar *status);
/* virtual functions */
gboolean (* button_press) (GimpToolWidget *widget,
gint (* button_press) (GimpToolWidget *widget,
const GimpCoords *coords,
guint32 time,
GdkModifierType state,
......@@ -152,7 +152,7 @@ GimpCanvasItem * gimp_tool_widget_add_transform_guides
/* for tools, to be called from the respective GimpTool method
* implementations
*/
gboolean gimp_tool_widget_button_press (GimpToolWidget *widget,
gint gimp_tool_widget_button_press (GimpToolWidget *widget,
const GimpCoords *coords,
guint32 time,
GdkModifierType state,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment