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.
This commit is contained in:
@ -118,7 +118,7 @@ static void gimp_tool_compass_get_property (GObject *object
|
|||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
|
|
||||||
static void gimp_tool_compass_changed (GimpToolWidget *widget);
|
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,
|
const GimpCoords *coords,
|
||||||
guint32 time,
|
guint32 time,
|
||||||
GdkModifierType state,
|
GdkModifierType state,
|
||||||
@ -557,7 +557,7 @@ gimp_tool_compass_changed (GimpToolWidget *widget)
|
|||||||
gimp_tool_compass_update_hilight (compass);
|
gimp_tool_compass_update_hilight (compass);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gint
|
||||||
gimp_tool_compass_button_press (GimpToolWidget *widget,
|
gimp_tool_compass_button_press (GimpToolWidget *widget,
|
||||||
const GimpCoords *coords,
|
const GimpCoords *coords,
|
||||||
guint32 time,
|
guint32 time,
|
||||||
@ -639,7 +639,7 @@ gimp_tool_compass_button_press (GimpToolWidget *widget,
|
|||||||
private->function = ADDING;
|
private->function = ADDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -105,7 +105,7 @@ static void gimp_tool_line_get_property (GObject *object,
|
|||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
|
|
||||||
static void gimp_tool_line_changed (GimpToolWidget *widget);
|
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,
|
const GimpCoords *coords,
|
||||||
guint32 time,
|
guint32 time,
|
||||||
GdkModifierType state,
|
GdkModifierType state,
|
||||||
@ -372,10 +372,10 @@ gimp_tool_line_button_press (GimpToolWidget *widget,
|
|||||||
gimp_tool_line_point_motion (line,
|
gimp_tool_line_point_motion (line,
|
||||||
state & gimp_get_constrain_behavior_mask ());
|
state & gimp_get_constrain_behavior_mask ());
|
||||||
|
|
||||||
return TRUE;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -430,22 +430,22 @@ gimp_tool_widget_add_transform_guides (GimpToolWidget *widget,
|
|||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gint
|
||||||
gimp_tool_widget_button_press (GimpToolWidget *widget,
|
gimp_tool_widget_button_press (GimpToolWidget *widget,
|
||||||
const GimpCoords *coords,
|
const GimpCoords *coords,
|
||||||
guint32 time,
|
guint32 time,
|
||||||
GdkModifierType state,
|
GdkModifierType state,
|
||||||
GimpButtonPressType press_type)
|
GimpButtonPressType press_type)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (GIMP_IS_TOOL_WIDGET (widget), FALSE);
|
g_return_val_if_fail (GIMP_IS_TOOL_WIDGET (widget), 0);
|
||||||
g_return_val_if_fail (coords != NULL, FALSE);
|
g_return_val_if_fail (coords != NULL, 0);
|
||||||
|
|
||||||
if (GIMP_TOOL_WIDGET_GET_CLASS (widget)->button_press)
|
if (GIMP_TOOL_WIDGET_GET_CLASS (widget)->button_press)
|
||||||
return GIMP_TOOL_WIDGET_GET_CLASS (widget)->button_press (widget,
|
return GIMP_TOOL_WIDGET_GET_CLASS (widget)->button_press (widget,
|
||||||
coords, time, state,
|
coords, time, state,
|
||||||
press_type);
|
press_type);
|
||||||
|
|
||||||
return FALSE;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -58,7 +58,7 @@ struct _GimpToolWidgetClass
|
|||||||
const gchar *status);
|
const gchar *status);
|
||||||
|
|
||||||
/* virtual functions */
|
/* virtual functions */
|
||||||
gboolean (* button_press) (GimpToolWidget *widget,
|
gint (* button_press) (GimpToolWidget *widget,
|
||||||
const GimpCoords *coords,
|
const GimpCoords *coords,
|
||||||
guint32 time,
|
guint32 time,
|
||||||
GdkModifierType state,
|
GdkModifierType state,
|
||||||
@ -152,7 +152,7 @@ GimpCanvasItem * gimp_tool_widget_add_transform_guides
|
|||||||
/* for tools, to be called from the respective GimpTool method
|
/* for tools, to be called from the respective GimpTool method
|
||||||
* implementations
|
* implementations
|
||||||
*/
|
*/
|
||||||
gboolean gimp_tool_widget_button_press (GimpToolWidget *widget,
|
gint gimp_tool_widget_button_press (GimpToolWidget *widget,
|
||||||
const GimpCoords *coords,
|
const GimpCoords *coords,
|
||||||
guint32 time,
|
guint32 time,
|
||||||
GdkModifierType state,
|
GdkModifierType state,
|
||||||
|
Reference in New Issue
Block a user