app: rename GimpImageViewable to GimpImageProxy

We're going to have GimpImageProxy implement GimpPickable, so that
it can be used as either a viewable or a pickable proxy for an
image.

(cherry picked from commit 8d8cc12f40)
This commit is contained in:
Ell
2019-11-03 19:12:55 +02:00
parent defe920d43
commit d1324ad802
7 changed files with 284 additions and 283 deletions

View File

@ -36,7 +36,7 @@
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimpimageviewable.h"
#include "core/gimpimageproxy.h"
#include "widgets/gimpdocked.h"
#include "widgets/gimphelp-ids.h"
@ -150,7 +150,7 @@ gimp_navigation_editor_init (GimpNavigationEditor *editor)
editor->view = gimp_view_new_by_types (NULL,
GIMP_TYPE_NAVIGATION_VIEW,
GIMP_TYPE_IMAGE_VIEWABLE,
GIMP_TYPE_IMAGE_PROXY,
GIMP_VIEW_SIZE_MEDIUM, 0, TRUE);
gtk_container_add (GTK_CONTAINER (frame), editor->view);
gtk_widget_show (editor->view);
@ -530,20 +530,20 @@ gimp_navigation_editor_set_shell (GimpNavigationEditor *editor,
{
GimpImage *image = gimp_display_get_image (shell->display);
g_clear_object (&editor->image_viewable);
g_clear_object (&editor->image_proxy);
if (image)
{
editor->image_viewable = gimp_image_viewable_new (image);
editor->image_proxy = gimp_image_proxy_new (image);
g_signal_connect (
editor->image_viewable, "size-changed",
editor->image_proxy, "size-changed",
G_CALLBACK (gimp_navigation_editor_viewable_size_changed),
editor);
}
gimp_view_set_viewable (GIMP_VIEW (editor->view),
GIMP_VIEWABLE (editor->image_viewable));
GIMP_VIEWABLE (editor->image_proxy));
g_signal_connect (editor->shell, "notify::infinite-canvas",
G_CALLBACK (gimp_navigation_editor_shell_infinite_canvas_notify),
@ -575,7 +575,7 @@ gimp_navigation_editor_set_shell (GimpNavigationEditor *editor,
gimp_view_set_viewable (GIMP_VIEW (editor->view), NULL);
gtk_widget_set_sensitive (GTK_WIDGET (editor), FALSE);
g_clear_object (&editor->image_viewable);
g_clear_object (&editor->image_proxy);
}
if (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)))
@ -612,8 +612,8 @@ gimp_navigation_editor_marker_changed (GimpNavigationView *view,
{
GeglRectangle bounding_box;
bounding_box = gimp_image_viewable_get_bounding_box (
GIMP_IMAGE_VIEWABLE (renderer->viewable));
bounding_box = gimp_image_proxy_get_bounding_box (
GIMP_IMAGE_PROXY (renderer->viewable));
center_x += bounding_box.x;
center_y += bounding_box.y;
@ -818,20 +818,20 @@ gimp_navigation_editor_shell_reconnect (GimpDisplayShell *shell,
{
GimpImage *image = gimp_display_get_image (shell->display);
g_clear_object (&editor->image_viewable);
g_clear_object (&editor->image_proxy);
if (image)
{
editor->image_viewable = gimp_image_viewable_new (image);
editor->image_proxy = gimp_image_proxy_new (image);
g_signal_connect (
editor->image_viewable, "size-changed",
editor->image_proxy, "size-changed",
G_CALLBACK (gimp_navigation_editor_viewable_size_changed),
editor);
}
gimp_view_set_viewable (GIMP_VIEW (editor->view),
GIMP_VIEWABLE (editor->image_viewable));
GIMP_VIEWABLE (editor->image_proxy));
if (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)))
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)),
@ -855,15 +855,15 @@ gimp_navigation_editor_update_marker (GimpNavigationEditor *editor)
gdouble x, y;
gdouble w, h;
image = gimp_image_viewable_get_image (
GIMP_IMAGE_VIEWABLE (renderer->viewable));
image = gimp_image_proxy_get_image (
GIMP_IMAGE_PROXY (renderer->viewable));
gimp_image_viewable_set_show_all (
GIMP_IMAGE_VIEWABLE (renderer->viewable),
gimp_image_proxy_set_show_all (
GIMP_IMAGE_PROXY (renderer->viewable),
gimp_display_shell_get_infinite_canvas (shell));
bounding_box = gimp_image_viewable_get_bounding_box (
GIMP_IMAGE_VIEWABLE (renderer->viewable));
bounding_box = gimp_image_proxy_get_bounding_box (
GIMP_IMAGE_PROXY (renderer->viewable));
gimp_display_shell_scroll_get_viewport (shell, &x, &y, &w, &h);
gimp_display_shell_untransform_xy_f (shell,

View File

@ -40,25 +40,25 @@ typedef struct _GimpNavigationEditorClass GimpNavigationEditorClass;
struct _GimpNavigationEditor
{
GimpEditor parent_instance;
GimpEditor parent_instance;
GimpContext *context;
GimpDisplayShell *shell;
GimpContext *context;
GimpDisplayShell *shell;
GimpImageViewable *image_viewable;
GimpImageProxy *image_proxy;
GtkWidget *view;
GtkWidget *zoom_label;
GtkAdjustment *zoom_adjustment;
GtkWidget *view;
GtkWidget *zoom_label;
GtkAdjustment *zoom_adjustment;
GtkWidget *zoom_out_button;
GtkWidget *zoom_in_button;
GtkWidget *zoom_100_button;
GtkWidget *zoom_fit_in_button;
GtkWidget *zoom_fill_button;
GtkWidget *shrink_wrap_button;
GtkWidget *zoom_out_button;
GtkWidget *zoom_in_button;
GtkWidget *zoom_100_button;
GtkWidget *zoom_fit_in_button;
GtkWidget *zoom_fill_button;
GtkWidget *shrink_wrap_button;
guint scale_timeout;
guint scale_timeout;
};
struct _GimpNavigationEditorClass