[gimp] app: change return value of GimpToolWidget::button_press() from gboolean to gint
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: change return value of GimpToolWidget::button_press() from gboolean to gint
- Date: Fri, 16 Jun 2017 18:58:28 +0000 (UTC)
commit 44d33bfd3b3a1115719a7fee7dfb734849ffded1
Author: Michael Natterer <mitch gimp org>
Date: Fri Jun 16 20:55:02 2017 +0200
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.
app/display/gimptoolcompass.c | 6 +++---
app/display/gimptoolline.c | 6 +++---
app/display/gimptoolwidget.c | 8 ++++----
app/display/gimptoolwidget.h | 4 ++--
4 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/app/display/gimptoolcompass.c b/app/display/gimptoolcompass.c
index b302305..e5c0774 100644
--- a/app/display/gimptoolcompass.c
+++ b/app/display/gimptoolcompass.c
@@ -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
diff --git a/app/display/gimptoolline.c b/app/display/gimptoolline.c
index 0404aef..481dbba 100644
--- a/app/display/gimptoolline.c
+++ b/app/display/gimptoolline.c
@@ -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
diff --git a/app/display/gimptoolwidget.c b/app/display/gimptoolwidget.c
index fd6fbe4..5bbabde 100644
--- a/app/display/gimptoolwidget.c
+++ b/app/display/gimptoolwidget.c
@@ -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
diff --git a/app/display/gimptoolwidget.h b/app/display/gimptoolwidget.h
index 31f1ba0..6481223 100644
--- a/app/display/gimptoolwidget.h
+++ b/app/display/gimptoolwidget.h
@@ -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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]