app: add gimp_display_shell_show_image()
... which controls whether or not the image is rendered by the
shell. We'll use this to hide the image while showing its
transform preview in the next commits.
(cherry picked from commit 539d666ae2
)
This commit is contained in:
@ -494,17 +494,20 @@ gimp_display_shell_canvas_draw_image (GimpDisplayShell *shell,
|
||||
gimp_display_shell_draw_checkerboard (shell, cr);
|
||||
cairo_restore (cr);
|
||||
|
||||
cairo_set_matrix (cr, &matrix);
|
||||
|
||||
for (i = 0; i < clip_rectangles->num_rectangles; i++)
|
||||
if (shell->show_image)
|
||||
{
|
||||
cairo_rectangle_t rect = clip_rectangles->rectangles[i];
|
||||
cairo_set_matrix (cr, &matrix);
|
||||
|
||||
gimp_display_shell_draw_image (shell, cr,
|
||||
floor (rect.x),
|
||||
floor (rect.y),
|
||||
ceil (rect.width),
|
||||
ceil (rect.height));
|
||||
for (i = 0; i < clip_rectangles->num_rectangles; i++)
|
||||
{
|
||||
cairo_rectangle_t rect = clip_rectangles->rectangles[i];
|
||||
|
||||
gimp_display_shell_draw_image (shell, cr,
|
||||
floor (rect.x),
|
||||
floor (rect.y),
|
||||
ceil (rect.width),
|
||||
ceil (rect.height));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -326,6 +326,8 @@ gimp_display_shell_init (GimpDisplayShell *shell)
|
||||
shell->scale_x = 1.0;
|
||||
shell->scale_y = 1.0;
|
||||
|
||||
shell->show_image = TRUE;
|
||||
|
||||
gimp_display_shell_items_init (shell);
|
||||
|
||||
shell->icon_size = 128;
|
||||
@ -1784,6 +1786,20 @@ gimp_display_shell_mask_bounds (GimpDisplayShell *shell,
|
||||
return (*width > 0) && (*height > 0);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_set_show_image (GimpDisplayShell *shell,
|
||||
gboolean show_image)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
if (show_image != shell->show_image)
|
||||
{
|
||||
shell->show_image = show_image;
|
||||
|
||||
gimp_display_shell_expose_full (shell);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_flush (GimpDisplayShell *shell,
|
||||
gboolean now)
|
||||
|
@ -91,6 +91,8 @@ struct _GimpDisplayShell
|
||||
|
||||
gboolean proximity; /* is a device in proximity */
|
||||
|
||||
gboolean show_image; /* whether to show the image */
|
||||
|
||||
Selection *selection; /* Selection (marching ants) */
|
||||
|
||||
GList *children;
|
||||
@ -297,6 +299,10 @@ gboolean gimp_display_shell_mask_bounds (GimpDisplayShell *shell,
|
||||
gint *width,
|
||||
gint *height);
|
||||
|
||||
void gimp_display_shell_set_show_image
|
||||
(GimpDisplayShell *shell,
|
||||
gboolean show_image);
|
||||
|
||||
void gimp_display_shell_flush (GimpDisplayShell *shell,
|
||||
gboolean now);
|
||||
|
||||
|
Reference in New Issue
Block a user