[gimp] app: add public API for the "guide-style" and "sample-point-style" properties
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: add public API for the "guide-style" and "sample-point-style" properties
- Date: Sun, 3 Oct 2010 20:17:00 +0000 (UTC)
commit d88a348c1858bc8be9b38370b91723a264357122
Author: Michael Natterer <mitch gimp org>
Date: Sun Oct 3 22:14:40 2010 +0200
app: add public API for the "guide-style" and "sample-point-style" properties
of the guide and sample point canvas items. They are too obscure to
additionally hide them, and these items are used rarely enough to
justify the additional parameter to the new() functions.
app/display/gimpcanvasguide.c | 4 +++-
app/display/gimpcanvasguide.h | 3 ++-
app/display/gimpcanvassamplepoint.c | 12 +++++++-----
app/display/gimpcanvassamplepoint.h | 3 ++-
app/display/gimpdisplayshell-handlers.c | 7 +++----
app/tools/gimpcolortool.c | 1 -
app/tools/gimpdrawtool.c | 7 ++++---
app/tools/gimpdrawtool.h | 3 ++-
app/tools/gimpmovetool.c | 8 ++++----
9 files changed, 27 insertions(+), 21 deletions(-)
---
diff --git a/app/display/gimpcanvasguide.c b/app/display/gimpcanvasguide.c
index 92685b7..919c0b6 100644
--- a/app/display/gimpcanvasguide.c
+++ b/app/display/gimpcanvasguide.c
@@ -267,7 +267,8 @@ gimp_canvas_guide_stroke (GimpCanvasItem *item,
GimpCanvasItem *
gimp_canvas_guide_new (GimpDisplayShell *shell,
GimpOrientationType orientation,
- gint position)
+ gint position,
+ gboolean guide_style)
{
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), NULL);
@@ -275,5 +276,6 @@ gimp_canvas_guide_new (GimpDisplayShell *shell,
"shell", shell,
"orientation", orientation,
"position", position,
+ "guide-style", guide_style,
NULL);
}
diff --git a/app/display/gimpcanvasguide.h b/app/display/gimpcanvasguide.h
index b25f8ee..f2f8356 100644
--- a/app/display/gimpcanvasguide.h
+++ b/app/display/gimpcanvasguide.h
@@ -51,7 +51,8 @@ GType gimp_canvas_guide_get_type (void) G_GNUC_CONST;
GimpCanvasItem * gimp_canvas_guide_new (GimpDisplayShell *shell,
GimpOrientationType orientation,
- gint position);
+ gint position,
+ gboolean guide_style);
#endif /* __GIMP_CANVAS_GUIDE_H__ */
diff --git a/app/display/gimpcanvassamplepoint.c b/app/display/gimpcanvassamplepoint.c
index acff04d..d73dff8 100644
--- a/app/display/gimpcanvassamplepoint.c
+++ b/app/display/gimpcanvassamplepoint.c
@@ -326,14 +326,16 @@ GimpCanvasItem *
gimp_canvas_sample_point_new (GimpDisplayShell *shell,
gint x,
gint y,
- gint index)
+ gint index,
+ gboolean sample_point_style)
{
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), NULL);
return g_object_new (GIMP_TYPE_CANVAS_SAMPLE_POINT,
- "shell", shell,
- "x", x,
- "y", y,
- "index", index,
+ "shell", shell,
+ "x", x,
+ "y", y,
+ "index", index,
+ "sample-point-style", sample_point_style,
NULL);
}
diff --git a/app/display/gimpcanvassamplepoint.h b/app/display/gimpcanvassamplepoint.h
index 053a14a..3f54a77 100644
--- a/app/display/gimpcanvassamplepoint.h
+++ b/app/display/gimpcanvassamplepoint.h
@@ -52,7 +52,8 @@ GType gimp_canvas_sample_point_get_type (void) G_GNUC_CONST;
GimpCanvasItem * gimp_canvas_sample_point_new (GimpDisplayShell *shell,
gint x,
gint y,
- gint index);
+ gint index,
+ gboolean sample_point_style);
#endif /* __GIMP_CANVAS_SAMPLE_POINT_H__ */
diff --git a/app/display/gimpdisplayshell-handlers.c b/app/display/gimpdisplayshell-handlers.c
index 0bebde5..77fd047 100644
--- a/app/display/gimpdisplayshell-handlers.c
+++ b/app/display/gimpdisplayshell-handlers.c
@@ -551,8 +551,8 @@ gimp_display_shell_guide_add_handler (GimpImage *image,
item = gimp_canvas_guide_new (shell,
gimp_guide_get_orientation (guide),
- gimp_guide_get_position (guide));
- g_object_set (item, "guide-style", TRUE, NULL);
+ gimp_guide_get_position (guide),
+ TRUE);
gimp_canvas_proxy_group_add_item (group, guide, item);
g_object_unref (item);
@@ -599,8 +599,7 @@ gimp_display_shell_sample_point_add_handler (GimpImage *image,
item = gimp_canvas_sample_point_new (shell,
sample_point->x,
sample_point->y,
- 0);
- g_object_set (item, "sample-point-style", TRUE, NULL);
+ 0, TRUE);
gimp_canvas_proxy_group_add_item (group, sample_point, item);
g_object_unref (item);
diff --git a/app/tools/gimpcolortool.c b/app/tools/gimpcolortool.c
index 88247be..1f74b6b 100644
--- a/app/tools/gimpcolortool.c
+++ b/app/tools/gimpcolortool.c
@@ -537,7 +537,6 @@ gimp_color_tool_draw (GimpDrawTool *draw_tool)
color_tool->sample_point->x,
color_tool->sample_point->y,
index);
- g_object_set (item, "sample-point-style", TRUE, NULL);
gimp_canvas_item_set_highlight (item, TRUE);
}
diff --git a/app/tools/gimpdrawtool.c b/app/tools/gimpdrawtool.c
index 893284b..7e0b9d8 100644
--- a/app/tools/gimpdrawtool.c
+++ b/app/tools/gimpdrawtool.c
@@ -438,14 +438,15 @@ gimp_draw_tool_add_line (GimpDrawTool *draw_tool,
GimpCanvasItem *
gimp_draw_tool_add_guide (GimpDrawTool *draw_tool,
GimpOrientationType orientation,
- gint position)
+ gint position,
+ gboolean guide_style)
{
GimpCanvasItem *item;
g_return_val_if_fail (GIMP_IS_DRAW_TOOL (draw_tool), NULL);
item = gimp_canvas_guide_new (gimp_display_get_shell (draw_tool->display),
- orientation, position);
+ orientation, position, guide_style);
gimp_draw_tool_add_item (draw_tool, item);
g_object_unref (item);
@@ -473,7 +474,7 @@ gimp_draw_tool_add_sample_point (GimpDrawTool *draw_tool,
g_return_val_if_fail (GIMP_IS_DRAW_TOOL (draw_tool), NULL);
item = gimp_canvas_sample_point_new (gimp_display_get_shell (draw_tool->display),
- x, y, index);
+ x, y, index, TRUE);
gimp_draw_tool_add_item (draw_tool, item);
g_object_unref (item);
diff --git a/app/tools/gimpdrawtool.h b/app/tools/gimpdrawtool.h
index 433ddbe..d4df8f2 100644
--- a/app/tools/gimpdrawtool.h
+++ b/app/tools/gimpdrawtool.h
@@ -94,7 +94,8 @@ GimpCanvasItem * gimp_draw_tool_add_line (GimpDrawTool *draw_too
gdouble y2);
GimpCanvasItem * gimp_draw_tool_add_guide (GimpDrawTool *draw_tool,
GimpOrientationType orientation,
- gint position);
+ gint position,
+ gboolean guide_style);
GimpCanvasItem * gimp_draw_tool_add_sample_point (GimpDrawTool *draw_tool,
gint x,
gint y,
diff --git a/app/tools/gimpmovetool.c b/app/tools/gimpmovetool.c
index 97c7cd3..7a17959 100644
--- a/app/tools/gimpmovetool.c
+++ b/app/tools/gimpmovetool.c
@@ -757,9 +757,8 @@ gimp_move_tool_draw (GimpDrawTool *draw_tool)
item = gimp_draw_tool_add_guide (draw_tool,
gimp_guide_get_orientation (move->guide),
- gimp_guide_get_position (move->guide));
-
- g_object_set (item, "guide-style", TRUE, NULL);
+ gimp_guide_get_position (move->guide),
+ TRUE);
gimp_canvas_item_set_highlight (item, TRUE);
}
@@ -767,7 +766,8 @@ gimp_move_tool_draw (GimpDrawTool *draw_tool)
{
gimp_draw_tool_add_guide (draw_tool,
move->guide_orientation,
- move->guide_position);
+ move->guide_position,
+ FALSE);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]