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.
This commit is contained in:
Michael Natterer 2010-10-03 22:14:40 +02:00
parent 19bf6ff497
commit d88a348c18
9 changed files with 27 additions and 21 deletions

View File

@ -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);
}

View File

@ -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__ */

View File

@ -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);
}

View File

@ -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__ */

View File

@ -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);

View File

@ -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);
}

View File

@ -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);

View File

@ -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,

View File

@ -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);
}
}