[gimp] app: get rid of some public draw tool API
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: get rid of some public draw tool API
- Date: Sun, 19 Sep 2010 22:14:26 +0000 (UTC)
commit 0c1073460cd4a5b747affad8ec8258f919504294
Author: Michael Natterer <mitch gimp org>
Date: Mon Sep 20 00:13:32 2010 +0200
app: get rid of some public draw tool API
and use gimp_draw_tool_draw_handle() instead which does exactly the
same for these cases.
app/tools/gimpdrawtool.c | 16 ++++------------
app/tools/gimpdrawtool.h | 15 ---------------
app/tools/gimpeditselectiontool.c | 15 ++++++++-------
app/tools/gimprectangletool.c | 15 ++++++++-------
4 files changed, 20 insertions(+), 41 deletions(-)
---
diff --git a/app/tools/gimpdrawtool.c b/app/tools/gimpdrawtool.c
index 2522038..13bb667 100644
--- a/app/tools/gimpdrawtool.c
+++ b/app/tools/gimpdrawtool.c
@@ -647,7 +647,7 @@ gimp_draw_tool_draw_arc (GimpDrawTool *draw_tool,
}
}
-void
+static void
gimp_draw_tool_draw_rectangle_by_anchor (GimpDrawTool *draw_tool,
gboolean filled,
gdouble x,
@@ -657,13 +657,9 @@ gimp_draw_tool_draw_rectangle_by_anchor (GimpDrawTool *draw_tool,
GtkAnchorType anchor,
gboolean use_offsets)
{
- GimpDisplayShell *shell;
+ GimpDisplayShell *shell = gimp_display_get_shell (draw_tool->display);
gdouble tx, ty;
- g_return_if_fail (GIMP_IS_DRAW_TOOL (draw_tool));
-
- shell = gimp_display_get_shell (draw_tool->display);
-
gimp_display_shell_transform_xy_f (shell,
x, y,
&tx, &ty,
@@ -729,7 +725,7 @@ gimp_draw_tool_draw_arc_by_anchor (GimpDrawTool *draw_tool,
angle1, angle2);
}
-void
+static void
gimp_draw_tool_draw_cross_by_anchor (GimpDrawTool *draw_tool,
gdouble x,
gdouble y,
@@ -738,13 +734,9 @@ gimp_draw_tool_draw_cross_by_anchor (GimpDrawTool *draw_tool,
GtkAnchorType anchor,
gboolean use_offsets)
{
- GimpDisplayShell *shell;
+ GimpDisplayShell *shell = gimp_display_get_shell (draw_tool->display);
gdouble tx, ty;
- g_return_if_fail (GIMP_IS_DRAW_TOOL (draw_tool));
-
- shell = gimp_display_get_shell (draw_tool->display);
-
gimp_display_shell_transform_xy_f (shell,
x, y,
&tx, &ty,
diff --git a/app/tools/gimpdrawtool.h b/app/tools/gimpdrawtool.h
index e2d010f..b1d2df5 100644
--- a/app/tools/gimpdrawtool.h
+++ b/app/tools/gimpdrawtool.h
@@ -133,14 +133,6 @@ void gimp_draw_tool_draw_arc (GimpDrawTool *draw_tool,
gint angle2,
gboolean use_offsets);
-void gimp_draw_tool_draw_rectangle_by_anchor (GimpDrawTool *draw_tool,
- gboolean filled,
- gdouble x,
- gdouble y,
- gint width,
- gint height,
- GtkAnchorType anchor,
- gboolean use_offsets);
void gimp_draw_tool_draw_arc_by_anchor (GimpDrawTool *draw_tool,
gboolean filled,
gdouble x,
@@ -151,13 +143,6 @@ void gimp_draw_tool_draw_arc_by_anchor (GimpDrawTool *draw_tool,
gint angle2,
GtkAnchorType anchor,
gboolean use_offsets);
-void gimp_draw_tool_draw_cross_by_anchor (GimpDrawTool *draw_tool,
- gdouble x,
- gdouble y,
- gint width,
- gint height,
- GtkAnchorType anchor,
- gboolean use_offsets);
void gimp_draw_tool_draw_handle (GimpDrawTool *draw_tool,
GimpHandleType type,
diff --git a/app/tools/gimpeditselectiontool.c b/app/tools/gimpeditselectiontool.c
index d586eac..d4f8c20 100644
--- a/app/tools/gimpeditselectiontool.c
+++ b/app/tools/gimpeditselectiontool.c
@@ -973,13 +973,14 @@ gimp_edit_selection_tool_draw (GimpDrawTool *draw_tool)
}
/* Mark the center because we snap to it */
- gimp_draw_tool_draw_cross_by_anchor (draw_tool,
- edit_select->center_x + edit_select->cumlx,
- edit_select->center_y + edit_select->cumly,
- CENTER_CROSS_SIZE,
- CENTER_CROSS_SIZE,
- GTK_ANCHOR_CENTER,
- FALSE);
+ gimp_draw_tool_draw_handle (draw_tool,
+ GIMP_HANDLE_CROSS,
+ edit_select->center_x + edit_select->cumlx,
+ edit_select->center_y + edit_select->cumly,
+ CENTER_CROSS_SIZE,
+ CENTER_CROSS_SIZE,
+ GTK_ANCHOR_CENTER,
+ FALSE);
GIMP_DRAW_TOOL_CLASS (parent_class)->draw (draw_tool);
}
diff --git a/app/tools/gimprectangletool.c b/app/tools/gimprectangletool.c
index eba3470..3cf2d39 100644
--- a/app/tools/gimprectangletool.c
+++ b/app/tools/gimprectangletool.c
@@ -1748,13 +1748,14 @@ gimp_rectangle_tool_draw (GimpDrawTool *draw_tool)
if (gimp_tool_control_is_active (tool->control))
{
/* Mark the center because we snap to it */
- gimp_draw_tool_draw_cross_by_anchor (draw_tool,
- (pub_x1 + pub_x2) / 2.0,
- (pub_y1 + pub_y2) / 2.0,
- CENTER_CROSS_SIZE,
- CENTER_CROSS_SIZE,
- GTK_ANCHOR_CENTER,
- FALSE);
+ gimp_draw_tool_draw_handle (draw_tool,
+ GIMP_HANDLE_CROSS,
+ (pub_x1 + pub_x2) / 2.0,
+ (pub_y1 + pub_y2) / 2.0,
+ CENTER_CROSS_SIZE,
+ CENTER_CROSS_SIZE,
+ GTK_ANCHOR_CENTER,
+ FALSE);
break;
}
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]