Commit 8d8cc12f authored by Ell's avatar Ell

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.
parent 0ddd3330
......@@ -197,7 +197,7 @@ typedef struct _GimpExtensionManager GimpExtensionManager;
typedef struct _GimpHistogram GimpHistogram;
typedef struct _GimpIdTable GimpIdTable;
typedef struct _GimpImagefile GimpImagefile;
typedef struct _GimpImageViewable GimpImageViewable;
typedef struct _GimpImageProxy GimpImageProxy;
typedef struct _GimpInterpreterDB GimpInterpreterDB;
typedef struct _GimpLineArt GimpLineArt;
typedef struct _GimpObjectQueue GimpObjectQueue;
......
This diff is collapsed.
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpimageviewable.h
* gimpimageproxy.h
* Copyright (C) 2019 Ell
*
* This program is free software: you can redistribute it and/or modify
......@@ -18,48 +18,48 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_IMAGE_VIEWABLE_H__
#define __GIMP_IMAGE_VIEWABLE_H__
#ifndef __GIMP_IMAGE_PROXY_H__
#define __GIMP_IMAGE_PROXY_H__
#include "gimpviewable.h"
#define GIMP_TYPE_IMAGE_VIEWABLE (gimp_image_viewable_get_type ())
#define GIMP_IMAGE_VIEWABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_IMAGE_VIEWABLE, GimpImageViewable))
#define GIMP_IMAGE_VIEWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_IMAGE_VIEWABLE, GimpImageViewableClass))
#define GIMP_IS_IMAGE_VIEWABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_IMAGE_VIEWABLE))
#define GIMP_IS_IMAGE_VIEWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_IMAGE_VIEWABLE))
#define GIMP_IMAGE_VIEWABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_IMAGE_VIEWABLE, GimpImageViewableClass))
#define GIMP_TYPE_IMAGE_PROXY (gimp_image_proxy_get_type ())
#define GIMP_IMAGE_PROXY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_IMAGE_PROXY, GimpImageProxy))
#define GIMP_IMAGE_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_IMAGE_PROXY, GimpImageProxyClass))
#define GIMP_IS_IMAGE_PROXY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_IMAGE_PROXY))
#define GIMP_IS_IMAGE_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_IMAGE_PROXY))
#define GIMP_IMAGE_PROXY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_IMAGE_PROXY, GimpImageProxyClass))
typedef struct _GimpImageViewablePrivate GimpImageViewablePrivate;
typedef struct _GimpImageViewableClass GimpImageViewableClass;
typedef struct _GimpImageProxyPrivate GimpImageProxyPrivate;
typedef struct _GimpImageProxyClass GimpImageProxyClass;
struct _GimpImageViewable
struct _GimpImageProxy
{
GimpViewable parent_instance;
GimpViewable parent_instance;
GimpImageViewablePrivate *priv;
GimpImageProxyPrivate *priv;
};
struct _GimpImageViewableClass
struct _GimpImageProxyClass
{
GimpViewableClass parent_class;
};
GType gimp_image_viewable_get_type (void) G_GNUC_CONST;
GType gimp_image_proxy_get_type (void) G_GNUC_CONST;
GimpImageViewable * gimp_image_viewable_new (GimpImage *image);
GimpImageProxy * gimp_image_proxy_new (GimpImage *image);
GimpImage * gimp_image_viewable_get_image (GimpImageViewable *image_viewable);
GimpImage * gimp_image_proxy_get_image (GimpImageProxy *image_proxy);
void gimp_image_proxy_set_show_all (GimpImageProxy *image_proxy,
gboolean show_all);
gboolean gimp_image_proxy_get_show_all (GimpImageProxy *image_proxy);
GeglRectangle gimp_image_proxy_get_bounding_box (GimpImageProxy *image_proxy);
void gimp_image_viewable_set_show_all (GimpImageViewable *image_viewable,
gboolean show_all);
gboolean gimp_image_viewable_get_show_all (GimpImageViewable *image_viewable);
GeglRectangle gimp_image_viewable_get_bounding_box (GimpImageViewable *image_viewable);
#endif /* __GIMP_IMAGE_VIEWABLE_H__ */
#endif /* __GIMP_IMAGE_PROXY_H__ */
......@@ -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"
......@@ -151,7 +151,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);
......@@ -540,20 +540,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),
......@@ -585,7 +585,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)))
......@@ -622,8 +622,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;
......@@ -800,20 +800,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)),
......@@ -837,15 +837,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,
......
......@@ -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
......
......@@ -30,7 +30,8 @@
#include "core/gimpgradient.h"
#include "core/gimpimage.h"
#include "core/gimpimagefile.h"
#include "core/gimpimageviewable.h"
#include "core/gimpimageproxy.h"
#include "core/gimplayer.h"
#include "core/gimppalette.h"
......@@ -64,7 +65,7 @@ gimp_view_renderer_type_from_viewable_type (GType viewable_type)
type = GIMP_TYPE_VIEW_RENDERER_BUFFER;
}
else if (g_type_is_a (viewable_type, GIMP_TYPE_IMAGE) ||
g_type_is_a (viewable_type, GIMP_TYPE_IMAGE_VIEWABLE))
g_type_is_a (viewable_type, GIMP_TYPE_IMAGE_PROXY))
{
type = GIMP_TYPE_VIEW_RENDERER_IMAGE;
}
......
......@@ -28,7 +28,7 @@
#include "widgets-types.h"
#include "core/gimpimage.h"
#include "core/gimpimageviewable.h"
#include "core/gimpimageproxy.h"
#include "core/gimptempbuf.h"
#include "gimpviewrendererimage.h"
......@@ -72,10 +72,10 @@ gimp_view_renderer_image_render (GimpViewRenderer *renderer,
{
image = GIMP_IMAGE (renderer->viewable);
}
else if (GIMP_IS_IMAGE_VIEWABLE (renderer->viewable))
else if (GIMP_IS_IMAGE_PROXY (renderer->viewable))
{
image = gimp_image_viewable_get_image (
GIMP_IMAGE_VIEWABLE (renderer->viewable));
image = gimp_image_proxy_get_image (
GIMP_IMAGE_PROXY (renderer->viewable));
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment