app: add and use more GimpCanvasItem setters
This commit is contained in:
@ -213,7 +213,7 @@ gimp_canvas_cursor_new (GimpDisplayShell *shell)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_canvas_cursor_set_coords (GimpCanvasCursor *cursor,
|
gimp_canvas_cursor_set (GimpCanvasItem *cursor,
|
||||||
gdouble x,
|
gdouble x,
|
||||||
gdouble y)
|
gdouble y)
|
||||||
{
|
{
|
||||||
@ -225,11 +225,13 @@ gimp_canvas_cursor_set_coords (GimpCanvasCursor *cursor,
|
|||||||
|
|
||||||
if (private->x != x || private->y != y)
|
if (private->x != x || private->y != y)
|
||||||
{
|
{
|
||||||
gimp_canvas_item_begin_change (GIMP_CANVAS_ITEM (cursor));
|
gimp_canvas_item_begin_change (cursor);
|
||||||
|
|
||||||
g_object_set (cursor,
|
g_object_set (cursor,
|
||||||
"x", x,
|
"x", x,
|
||||||
"y", y,
|
"y", y,
|
||||||
NULL);
|
NULL);
|
||||||
gimp_canvas_item_end_change (GIMP_CANVAS_ITEM (cursor));
|
|
||||||
|
gimp_canvas_item_end_change (cursor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ GType gimp_canvas_cursor_get_type (void) G_GNUC_CONST;
|
|||||||
|
|
||||||
GimpCanvasItem * gimp_canvas_cursor_new (GimpDisplayShell *shell);
|
GimpCanvasItem * gimp_canvas_cursor_new (GimpDisplayShell *shell);
|
||||||
|
|
||||||
void gimp_canvas_cursor_set_coords (GimpCanvasCursor *cursor,
|
void gimp_canvas_cursor_set (GimpCanvasItem *cursor,
|
||||||
gdouble x,
|
gdouble x,
|
||||||
gdouble y);
|
gdouble y);
|
||||||
|
|
||||||
|
@ -279,3 +279,20 @@ gimp_canvas_guide_new (GimpDisplayShell *shell,
|
|||||||
"guide-style", guide_style,
|
"guide-style", guide_style,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gimp_canvas_guide_set (GimpCanvasItem *guide,
|
||||||
|
GimpOrientationType orientation,
|
||||||
|
gint position)
|
||||||
|
{
|
||||||
|
g_return_if_fail (GIMP_IS_CANVAS_GUIDE (guide));
|
||||||
|
|
||||||
|
gimp_canvas_item_begin_change (guide);
|
||||||
|
|
||||||
|
g_object_set (guide,
|
||||||
|
"orientation", orientation,
|
||||||
|
"position", position,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
gimp_canvas_item_end_change (guide);
|
||||||
|
}
|
||||||
|
@ -54,5 +54,9 @@ GimpCanvasItem * gimp_canvas_guide_new (GimpDisplayShell *shell,
|
|||||||
gint position,
|
gint position,
|
||||||
gboolean guide_style);
|
gboolean guide_style);
|
||||||
|
|
||||||
|
void gimp_canvas_guide_set (GimpCanvasItem *guide,
|
||||||
|
GimpOrientationType orientation,
|
||||||
|
gint position);
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_CANVAS_GUIDE_H__ */
|
#endif /* __GIMP_CANVAS_GUIDE_H__ */
|
||||||
|
@ -289,7 +289,7 @@ gimp_canvas_path_stroke (GimpCanvasItem *item,
|
|||||||
|
|
||||||
GimpCanvasItem *
|
GimpCanvasItem *
|
||||||
gimp_canvas_path_new (GimpDisplayShell *shell,
|
gimp_canvas_path_new (GimpDisplayShell *shell,
|
||||||
const GimpBezierDesc *path,
|
const GimpBezierDesc *bezier,
|
||||||
gboolean filled,
|
gboolean filled,
|
||||||
gboolean path_style)
|
gboolean path_style)
|
||||||
{
|
{
|
||||||
@ -297,8 +297,23 @@ gimp_canvas_path_new (GimpDisplayShell *shell,
|
|||||||
|
|
||||||
return g_object_new (GIMP_TYPE_CANVAS_PATH,
|
return g_object_new (GIMP_TYPE_CANVAS_PATH,
|
||||||
"shell", shell,
|
"shell", shell,
|
||||||
"path", path,
|
"path", bezier,
|
||||||
"filled", filled,
|
"filled", filled,
|
||||||
"path-style", path_style,
|
"path-style", path_style,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gimp_canvas_path_set (GimpCanvasItem *path,
|
||||||
|
const GimpBezierDesc *bezier)
|
||||||
|
{
|
||||||
|
g_return_if_fail (GIMP_IS_CANVAS_PATH (path));
|
||||||
|
|
||||||
|
gimp_canvas_item_begin_change (path);
|
||||||
|
|
||||||
|
g_object_set (path,
|
||||||
|
"path", bezier,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
gimp_canvas_item_end_change (path);
|
||||||
|
}
|
||||||
|
@ -50,9 +50,12 @@ struct _GimpCanvasPathClass
|
|||||||
GType gimp_canvas_path_get_type (void) G_GNUC_CONST;
|
GType gimp_canvas_path_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
GimpCanvasItem * gimp_canvas_path_new (GimpDisplayShell *shell,
|
GimpCanvasItem * gimp_canvas_path_new (GimpDisplayShell *shell,
|
||||||
const GimpBezierDesc *path,
|
const GimpBezierDesc *bezier,
|
||||||
gboolean filled,
|
gboolean filled,
|
||||||
gboolean path_style);
|
gboolean path_style);
|
||||||
|
|
||||||
|
void gimp_canvas_path_set (GimpCanvasItem *path,
|
||||||
|
const GimpBezierDesc *bezier);
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_CANVAS_PATH_H__ */
|
#endif /* __GIMP_CANVAS_PATH_H__ */
|
||||||
|
@ -339,3 +339,20 @@ gimp_canvas_sample_point_new (GimpDisplayShell *shell,
|
|||||||
"sample-point-style", sample_point_style,
|
"sample-point-style", sample_point_style,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gimp_canvas_sample_point_set (GimpCanvasItem *sample_point,
|
||||||
|
gdouble x,
|
||||||
|
gdouble y)
|
||||||
|
{
|
||||||
|
g_return_if_fail (GIMP_IS_CANVAS_SAMPLE_POINT (sample_point));
|
||||||
|
|
||||||
|
gimp_canvas_item_begin_change (sample_point);
|
||||||
|
|
||||||
|
g_object_set (sample_point,
|
||||||
|
"x", x,
|
||||||
|
"y", y,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
gimp_canvas_item_end_change (sample_point);
|
||||||
|
}
|
||||||
|
@ -55,5 +55,9 @@ GimpCanvasItem * gimp_canvas_sample_point_new (GimpDisplayShell *shell,
|
|||||||
gint index,
|
gint index,
|
||||||
gboolean sample_point_style);
|
gboolean sample_point_style);
|
||||||
|
|
||||||
|
void gimp_canvas_sample_point_set (GimpCanvasItem *sample_point,
|
||||||
|
gdouble x,
|
||||||
|
gdouble y);
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_CANVAS_SAMPLE_POINT_H__ */
|
#endif /* __GIMP_CANVAS_SAMPLE_POINT_H__ */
|
||||||
|
@ -139,7 +139,7 @@ gimp_display_shell_update_software_cursor (GimpDisplayShell *shell,
|
|||||||
{
|
{
|
||||||
gimp_canvas_item_begin_change (shell->cursor);
|
gimp_canvas_item_begin_change (shell->cursor);
|
||||||
|
|
||||||
gimp_canvas_cursor_set_coords (GIMP_CANVAS_CURSOR (shell->cursor),
|
gimp_canvas_cursor_set (shell->cursor,
|
||||||
display_x,
|
display_x,
|
||||||
display_y);
|
display_y);
|
||||||
gimp_canvas_item_set_visible (shell->cursor, TRUE);
|
gimp_canvas_item_set_visible (shell->cursor, TRUE);
|
||||||
|
@ -639,12 +639,9 @@ gimp_display_shell_guide_move_handler (GimpImage *image,
|
|||||||
|
|
||||||
item = gimp_canvas_proxy_group_get_item (group, guide);
|
item = gimp_canvas_proxy_group_get_item (group, guide);
|
||||||
|
|
||||||
gimp_canvas_item_begin_change (item);
|
gimp_canvas_guide_set (item,
|
||||||
g_object_set (item,
|
gimp_guide_get_orientation (guide),
|
||||||
"orientation", gimp_guide_get_orientation (guide),
|
gimp_guide_get_position (guide));
|
||||||
"position", gimp_guide_get_position (guide),
|
|
||||||
NULL);
|
|
||||||
gimp_canvas_item_end_change (item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -717,12 +714,7 @@ gimp_display_shell_sample_point_move_handler (GimpImage *image,
|
|||||||
|
|
||||||
item = gimp_canvas_proxy_group_get_item (group, sample_point);
|
item = gimp_canvas_proxy_group_get_item (group, sample_point);
|
||||||
|
|
||||||
gimp_canvas_item_begin_change (item);
|
gimp_canvas_sample_point_set (item, sample_point->x, sample_point->y);
|
||||||
g_object_set (item,
|
|
||||||
"x", sample_point->x,
|
|
||||||
"y", sample_point->y,
|
|
||||||
NULL);
|
|
||||||
gimp_canvas_item_end_change (item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -857,11 +849,7 @@ gimp_display_shell_vectors_thaw_handler (GimpVectors *vectors,
|
|||||||
|
|
||||||
item = gimp_canvas_proxy_group_get_item (group, vectors);
|
item = gimp_canvas_proxy_group_get_item (group, vectors);
|
||||||
|
|
||||||
gimp_canvas_item_begin_change (item);
|
gimp_canvas_path_set (item, gimp_vectors_get_bezier (vectors));
|
||||||
g_object_set (item,
|
|
||||||
"path", gimp_vectors_get_bezier (vectors),
|
|
||||||
NULL);
|
|
||||||
gimp_canvas_item_end_change (item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1742,24 +1742,24 @@ gimp_display_shell_set_highlight (GimpDisplayShell *shell,
|
|||||||
{
|
{
|
||||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||||
|
|
||||||
gimp_canvas_item_begin_change (shell->passe_partout);
|
|
||||||
|
|
||||||
if (highlight)
|
if (highlight)
|
||||||
{
|
{
|
||||||
g_object_set (shell->passe_partout,
|
gimp_canvas_item_begin_change (shell->passe_partout);
|
||||||
"visible", TRUE,
|
|
||||||
"x", (gdouble) highlight->x,
|
gimp_canvas_rectangle_set (shell->passe_partout,
|
||||||
"y", (gdouble) highlight->y,
|
highlight->x,
|
||||||
"width", (gdouble) highlight->width,
|
highlight->y,
|
||||||
"height", (gdouble) highlight->height,
|
highlight->width,
|
||||||
NULL);
|
highlight->height);
|
||||||
|
|
||||||
|
gimp_canvas_item_set_visible (shell->passe_partout, TRUE);
|
||||||
|
|
||||||
|
gimp_canvas_item_end_change (shell->passe_partout);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gimp_canvas_item_set_visible (shell->passe_partout, FALSE);
|
gimp_canvas_item_set_visible (shell->passe_partout, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_canvas_item_end_change (shell->passe_partout);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user