[gimp] app: change GimpCanvasItem setters to take GimpCanvasItem*
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: change GimpCanvasItem setters to take GimpCanvasItem*
- Date: Mon, 28 Mar 2011 10:22:00 +0000 (UTC)
commit accc12a3ca813e5640bdeb64dce7f11c50821222
Author: Michael Natterer <mitch gimp org>
Date: Mon Mar 28 12:20:36 2011 +0200
app: change GimpCanvasItem setters to take GimpCanvasItem*
not GimpCanvasLine* etc. We keep them around as items, and their
constructors return items, and it's getting more code anyway when
porting away from pause/resume, so let's keep the casting minimal at
least.
app/display/gimpcanvashandle.c | 20 ++++++++++----------
app/display/gimpcanvashandle.h | 4 ++--
app/display/gimpcanvasline.c | 6 +++---
app/display/gimpcanvasline.h | 2 +-
app/tools/gimpblendtool.c | 4 ++--
app/tools/gimpmeasuretool.c | 3 +--
6 files changed, 19 insertions(+), 20 deletions(-)
---
diff --git a/app/display/gimpcanvashandle.c b/app/display/gimpcanvashandle.c
index 007d050..350b301 100644
--- a/app/display/gimpcanvashandle.c
+++ b/app/display/gimpcanvashandle.c
@@ -403,35 +403,35 @@ gimp_canvas_handle_new (GimpDisplayShell *shell,
}
void
-gimp_canvas_handle_set_position (GimpCanvasHandle *handle,
- gdouble x,
- gdouble y)
+gimp_canvas_handle_set_position (GimpCanvasItem *handle,
+ gdouble x,
+ gdouble y)
{
g_return_if_fail (GIMP_IS_CANVAS_HANDLE (handle));
- gimp_canvas_item_begin_change (GIMP_CANVAS_ITEM (handle));
+ gimp_canvas_item_begin_change (handle);
g_object_set (handle,
"x", x,
"y", y,
NULL);
- gimp_canvas_item_end_change (GIMP_CANVAS_ITEM (handle));
+ gimp_canvas_item_end_change (handle);
}
void
-gimp_canvas_handle_set_angles (GimpCanvasHandle *handle,
- gdouble start_angle,
- gdouble slice_angle)
+gimp_canvas_handle_set_angles (GimpCanvasItem *handle,
+ gdouble start_angle,
+ gdouble slice_angle)
{
g_return_if_fail (GIMP_IS_CANVAS_HANDLE (handle));
- gimp_canvas_item_begin_change (GIMP_CANVAS_ITEM (handle));
+ gimp_canvas_item_begin_change (handle);
g_object_set (handle,
"start-angle", start_angle,
"slice-angle", slice_angle,
NULL);
- gimp_canvas_item_end_change (GIMP_CANVAS_ITEM (handle));
+ gimp_canvas_item_end_change (handle);
}
diff --git a/app/display/gimpcanvashandle.h b/app/display/gimpcanvashandle.h
index 7e5efeb..7dea56b 100644
--- a/app/display/gimpcanvashandle.h
+++ b/app/display/gimpcanvashandle.h
@@ -57,10 +57,10 @@ GimpCanvasItem * gimp_canvas_handle_new (GimpDisplayShell *shell,
gint width,
gint height);
-void gimp_canvas_handle_set_position (GimpCanvasHandle *handle,
+void gimp_canvas_handle_set_position (GimpCanvasItem *handle,
gdouble x,
gdouble y);
-void gimp_canvas_handle_set_angles (GimpCanvasHandle *handle,
+void gimp_canvas_handle_set_angles (GimpCanvasItem *handle,
gdouble start_handle,
gdouble slice_handle);
diff --git a/app/display/gimpcanvasline.c b/app/display/gimpcanvasline.c
index 04c204d..fe90c5c 100644
--- a/app/display/gimpcanvasline.c
+++ b/app/display/gimpcanvasline.c
@@ -269,7 +269,7 @@ gimp_canvas_line_new (GimpDisplayShell *shell,
}
void
-gimp_canvas_line_set (GimpCanvasLine *line,
+gimp_canvas_line_set (GimpCanvasItem *line,
gdouble x1,
gdouble y1,
gdouble x2,
@@ -277,7 +277,7 @@ gimp_canvas_line_set (GimpCanvasLine *line,
{
g_return_if_fail (GIMP_IS_CANVAS_LINE (line));
- gimp_canvas_item_begin_change (GIMP_CANVAS_ITEM (line));
+ gimp_canvas_item_begin_change (line);
g_object_set (line,
"x1", x1,
@@ -286,5 +286,5 @@ gimp_canvas_line_set (GimpCanvasLine *line,
"y2", y2,
NULL);
- gimp_canvas_item_end_change (GIMP_CANVAS_ITEM (line));
+ gimp_canvas_item_end_change (line);
}
diff --git a/app/display/gimpcanvasline.h b/app/display/gimpcanvasline.h
index a38abc2..13246cc 100644
--- a/app/display/gimpcanvasline.h
+++ b/app/display/gimpcanvasline.h
@@ -55,7 +55,7 @@ GimpCanvasItem * gimp_canvas_line_new (GimpDisplayShell *shell,
gdouble x2,
gdouble y2);
-void gimp_canvas_line_set (GimpCanvasLine *line,
+void gimp_canvas_line_set (GimpCanvasItem *line,
gdouble x1,
gdouble y1,
gdouble x2,
diff --git a/app/tools/gimpblendtool.c b/app/tools/gimpblendtool.c
index 6876586..858fa76 100644
--- a/app/tools/gimpblendtool.c
+++ b/app/tools/gimpblendtool.c
@@ -409,12 +409,12 @@ gimp_blend_tool_update_items (GimpBlendTool *blend_tool)
{
if (gimp_draw_tool_is_active (GIMP_DRAW_TOOL (blend_tool)))
{
- gimp_canvas_line_set (GIMP_CANVAS_LINE (blend_tool->line),
+ gimp_canvas_line_set (blend_tool->line,
blend_tool->start_x,
blend_tool->start_y,
blend_tool->end_x,
blend_tool->end_y);
- gimp_canvas_handle_set_position (GIMP_CANVAS_HANDLE (blend_tool->end_handle),
+ gimp_canvas_handle_set_position (blend_tool->end_handle,
blend_tool->end_x,
blend_tool->end_y);
}
diff --git a/app/tools/gimpmeasuretool.c b/app/tools/gimpmeasuretool.c
index 5623e78..f645d96 100644
--- a/app/tools/gimpmeasuretool.c
+++ b/app/tools/gimpmeasuretool.c
@@ -737,8 +737,7 @@ gimp_measure_tool_draw (GimpDrawTool *draw_tool)
ARC_RADIUS * 2 + 1,
GIMP_HANDLE_ANCHOR_CENTER);
- gimp_canvas_handle_set_angles (GIMP_CANVAS_HANDLE (item),
- angle1, angle2);
+ gimp_canvas_handle_set_angles (item, angle1, angle2);
if (measure->num_points == 2)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]