libgimpwidgets/gimppreview.[ch] libgimpwidgets/gimpscrolledpreview.[ch]

2004-09-29  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimppreview.[ch]
	* libgimpwidgets/gimpscrolledpreview.[ch]
	* libgimpwidgets/gimpwidgets.def: moved the offsets and the
	draw_thumb method back to the GimpPreview class.

	* libgimp/gimpdrawablepreview.c: changed accordingly.

	* plug-ins/common/bumpmap.c
	* plug-ins/common/cartoon.c
	* plug-ins/common/deinterlace.c
	* plug-ins/common/despeckle.c
	* plug-ins/common/dog.c
	* plug-ins/common/edge.c
	* plug-ins/common/engrave.c
	* plug-ins/common/exchange.c
	* plug-ins/common/gauss.c
	* plug-ins/common/grid.c
	* plug-ins/common/mblur.c
	* plug-ins/common/neon.c
	* plug-ins/common/noisify.c
	* plug-ins/common/oilify.c
	* plug-ins/common/photocopy.c
	* plug-ins/common/sel_gauss.c
	* plug-ins/common/sharpen.c
	* plug-ins/common/shift.c
	* plug-ins/common/sobel.c
	* plug-ins/common/softglow.c
	* plug-ins/common/spread.c
	* plug-ins/common/struc.c
	* plug-ins/common/unsharp.c
	* plug-ins/common/wind.c: back to using gimp_preview_get_position().

	* libgimp/gimpregioniterator.c (gimp_rgn_iterator_new): corrected
	gtk-doc comment.
This commit is contained in:
Sven Neumann 2004-09-29 13:39:23 +00:00 committed by Sven Neumann
parent 17272d76c8
commit c4bf786cc2
32 changed files with 191 additions and 172 deletions

View File

@ -1,3 +1,40 @@
2004-09-29 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimppreview.[ch]
* libgimpwidgets/gimpscrolledpreview.[ch]
* libgimpwidgets/gimpwidgets.def: moved the offsets and the
draw_thumb method back to the GimpPreview class.
* libgimp/gimpdrawablepreview.c: changed accordingly.
* plug-ins/common/bumpmap.c
* plug-ins/common/cartoon.c
* plug-ins/common/deinterlace.c
* plug-ins/common/despeckle.c
* plug-ins/common/dog.c
* plug-ins/common/edge.c
* plug-ins/common/engrave.c
* plug-ins/common/exchange.c
* plug-ins/common/gauss.c
* plug-ins/common/grid.c
* plug-ins/common/mblur.c
* plug-ins/common/neon.c
* plug-ins/common/noisify.c
* plug-ins/common/oilify.c
* plug-ins/common/photocopy.c
* plug-ins/common/sel_gauss.c
* plug-ins/common/sharpen.c
* plug-ins/common/shift.c
* plug-ins/common/sobel.c
* plug-ins/common/softglow.c
* plug-ins/common/spread.c
* plug-ins/common/struc.c
* plug-ins/common/unsharp.c
* plug-ins/common/wind.c: back to using gimp_preview_get_position().
* libgimp/gimpregioniterator.c (gimp_rgn_iterator_new): corrected
gtk-doc comment.
2004-09-29 DindinX <dindinx@gimp.org>
* plug-ins/common/snoise.c: Use a GimpAspectPreview here, so the

View File

@ -42,13 +42,14 @@ static void gimp_drawable_preview_style_set (GtkWidget *widget,
GtkStyle *prev_style);
static void gimp_drawable_preview_draw_original (GimpPreview *preview);
static void gimp_drawable_preview_draw_thumb (GimpScrolledPreview *preview,
static void gimp_drawable_preview_draw_thumb (GimpPreview *preview,
GimpPreviewArea *area,
gint width,
gint height);
static GimpScrolledPreviewClass *parent_class = NULL;
GType
gimp_drawable_preview_get_type (void)
{
@ -82,14 +83,13 @@ gimp_drawable_preview_class_init (GimpDrawablePreviewClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GimpPreviewClass *preview_class = GIMP_PREVIEW_CLASS (klass);
GimpScrolledPreviewClass *scrolled_preview_class = GIMP_SCROLLED_PREVIEW_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
widget_class->style_set = gimp_drawable_preview_style_set;
widget_class->style_set = gimp_drawable_preview_style_set;
preview_class->draw = gimp_drawable_preview_draw_original;
scrolled_preview_class->draw_thumb = gimp_drawable_preview_draw_thumb;
preview_class->draw = gimp_drawable_preview_draw_original;
preview_class->draw_thumb = gimp_drawable_preview_draw_thumb;
}
static void
@ -125,7 +125,6 @@ static void
gimp_drawable_preview_draw_original (GimpPreview *preview)
{
GimpDrawablePreview *drawable_preview = GIMP_DRAWABLE_PREVIEW (preview);
GimpScrolledPreview *scrolled_preview = GIMP_SCROLLED_PREVIEW (preview);
GimpDrawable *drawable = drawable_preview->drawable;
guchar *buffer;
GimpPixelRgn srcPR;
@ -137,20 +136,20 @@ gimp_drawable_preview_draw_original (GimpPreview *preview)
rowstride = preview->width * drawable->bpp;
buffer = g_new (guchar, rowstride * preview->height);
scrolled_preview->xoff = CLAMP (scrolled_preview->xoff,
0, preview->xmax - preview->xmin - preview->width);
scrolled_preview->yoff = CLAMP (scrolled_preview->yoff,
0, preview->ymax - preview->ymin - preview->height);
preview->xoff = CLAMP (preview->xoff,
0, preview->xmax - preview->xmin - preview->width);
preview->yoff = CLAMP (preview->yoff,
0, preview->ymax - preview->ymin - preview->height);
gimp_pixel_rgn_init (&srcPR, drawable,
scrolled_preview->xoff + preview->xmin,
scrolled_preview->yoff + preview->ymin,
preview->xoff + preview->xmin,
preview->yoff + preview->ymin,
preview->width, preview->height,
FALSE, FALSE);
gimp_pixel_rgn_get_rect (&srcPR, buffer,
scrolled_preview->xoff + preview->xmin,
scrolled_preview->yoff + preview->ymin,
preview->xoff + preview->xmin,
preview->yoff + preview->ymin,
preview->width, preview->height);
gimp_preview_area_draw (GIMP_PREVIEW_AREA (preview->area),
@ -162,10 +161,10 @@ gimp_drawable_preview_draw_original (GimpPreview *preview)
}
static void
gimp_drawable_preview_draw_thumb (GimpScrolledPreview *preview,
GimpPreviewArea *area,
gint width,
gint height)
gimp_drawable_preview_draw_thumb (GimpPreview *preview,
GimpPreviewArea *area,
gint width,
gint height)
{
GimpDrawablePreview *drawable_preview = GIMP_DRAWABLE_PREVIEW (preview);
GimpDrawable *drawable = drawable_preview->drawable;
@ -214,18 +213,17 @@ gimp_drawable_preview_draw_area (GimpDrawablePreview *preview,
const guchar *buf,
gint rowstride)
{
GimpPreview *gimp_preview = GIMP_PREVIEW (preview);
GimpScrolledPreview *scrolled_preview = GIMP_SCROLLED_PREVIEW (preview);
GimpDrawable *drawable = preview->drawable;
gint32 image_id;
GimpPreview *gimp_preview = GIMP_PREVIEW (preview);
GimpDrawable *drawable = preview->drawable;
gint32 image_id;
image_id = gimp_drawable_get_image (drawable->drawable_id);
if (gimp_selection_is_empty (image_id))
{
gimp_preview_area_draw (GIMP_PREVIEW_AREA (gimp_preview->area),
x - scrolled_preview->xoff - gimp_preview->xmin,
y - scrolled_preview->yoff - gimp_preview->ymin,
x - gimp_preview->xoff - gimp_preview->xmin,
y - gimp_preview->yoff - gimp_preview->ymin,
width,
height,
gimp_drawable_type (drawable->drawable_id),
@ -255,8 +253,8 @@ gimp_drawable_preview_draw_area (GimpDrawablePreview *preview,
gimp_pixel_rgn_get_rect (&selection_rgn, sel, x, y, width, height);
gimp_preview_area_mask (GIMP_PREVIEW_AREA (gimp_preview->area),
x - scrolled_preview->xoff - gimp_preview->xmin,
y - scrolled_preview->yoff - gimp_preview->ymin,
x - gimp_preview->xoff - gimp_preview->xmin,
y - gimp_preview->yoff - gimp_preview->ymin,
width,
height,
gimp_drawable_type (drawable->drawable_id),
@ -381,19 +379,17 @@ gimp_drawable_preview_draw_buffer (GimpDrawablePreview *preview,
const guchar *buffer,
gint rowstride)
{
GimpPreview *gimp_preview;
GimpScrolledPreview *scrolled_preview;
GimpPreview *gimp_preview;
g_return_if_fail (GIMP_IS_DRAWABLE_PREVIEW (preview));
g_return_if_fail (preview->drawable != NULL);
g_return_if_fail (buffer != NULL);
gimp_preview = GIMP_PREVIEW (preview);
scrolled_preview = GIMP_SCROLLED_PREVIEW (preview);
gimp_preview = GIMP_PREVIEW (preview);
gimp_drawable_preview_draw_area (preview,
gimp_preview->xmin + scrolled_preview->xoff,
gimp_preview->ymin + scrolled_preview->yoff,
gimp_preview->xmin + gimp_preview->xoff,
gimp_preview->ymin + gimp_preview->yoff,
gimp_preview->width,
gimp_preview->height,
buffer, rowstride);

View File

@ -61,9 +61,9 @@ static void gimp_rgn_render_region (const GimpPixelRgn *srcPR,
/**
* gimp_rgn_iterator_new:
* @drawable: a #GimpDrawable
* @run_mode: unused
* @unused: ignored
*
* Creates a new #GimpRgnIterator for @drawable. The @run_mode
* Creates a new #GimpRgnIterator for @drawable. The #GimpRunMode
* parameter is ignored.
*
* Return value: a newly allocated #GimpRgnIterator.

View File

@ -144,6 +144,7 @@ gimp_preview_class_init (GimpPreviewClass *klass)
widget_class->popup_menu = gimp_preview_popup_menu;
klass->draw = NULL;
klass->draw_thumb = NULL;
klass->set_cursor = gimp_preview_set_cursor;
g_object_class_install_property (object_class,
@ -190,6 +191,9 @@ gimp_preview_init (GimpPreview *preview)
preview->width = preview->xmax - preview->xmin;
preview->height = preview->ymax - preview->ymin;
preview->xoff = 0;
preview->yoff = 0;
/* preview area */
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
@ -545,6 +549,28 @@ gimp_preview_get_size (GimpPreview *preview,
*height = preview->height;
}
/**
* gimp_preview_get_position:
* @preview: a #GimpPreview widget
* @x: return location for the horizontal offset
* @y: return location for the vertical offset
*
* Since: GIMP 2.2
**/
void
gimp_preview_get_position (GimpPreview *preview,
gint *x,
gint *y)
{
g_return_if_fail (GIMP_IS_PREVIEW (preview));
if (x)
*x = preview->xoff + GIMP_PREVIEW (preview)->xmin;
if (y)
*y = preview->yoff + GIMP_PREVIEW (preview)->ymin;
}
/*
* gimp_preview_draw:
* @preview: a #GimpPreview widget

View File

@ -54,6 +54,7 @@ struct _GimpPreview
GdkCursor *cursor_busy;
/*< private >*/
gint xoff, yoff;
gint xmin, xmax, ymin, ymax;
gint width, height;
@ -66,6 +67,10 @@ struct _GimpPreviewClass
/* virtuals */
void (* draw) (GimpPreview *preview);
void (* draw_thumb) (GimpPreview *preview,
GimpPreviewArea *area,
gint width,
gint height);
void (* set_cursor) (GimpPreview *preview);
/* signal */
@ -85,6 +90,9 @@ void gimp_preview_set_bounds (GimpPreview *preview,
gint xmax,
gint ymax);
void gimp_preview_get_position (GimpPreview *preview,
gint *x,
gint *y);
void gimp_preview_get_size (GimpPreview *preview,
gint *width,
gint *height);

View File

@ -31,9 +31,11 @@
#include "libgimp/libgimp-intl.h"
#define POPUP_SIZE 100
#define PEN_WIDTH 3
static void gimp_scrolled_preview_class_init (GimpScrolledPreviewClass *klass);
static void gimp_scrolled_preview_init (GimpScrolledPreview *preview);
static void gimp_scrolled_preview_dispose (GObject *object);
@ -50,9 +52,9 @@ static gboolean gimp_scrolled_preview_area_event (GtkWidget
GimpScrolledPreview *preview);
static void gimp_scrolled_preview_h_scroll (GtkAdjustment *hadj,
GimpScrolledPreview *preview);
GimpPreview *preview);
static void gimp_scrolled_preview_v_scroll (GtkAdjustment *vadj,
GimpScrolledPreview *preview);
GimpPreview *preview);
static gboolean gimp_scrolled_preview_nav_button_press (GtkWidget *widget,
GdkEventButton *event,
@ -70,8 +72,10 @@ static gboolean gimp_scrolled_preview_nav_popup_expose (GtkWidget
GimpScrolledPreview *preview);
static void gimp_scrolled_preview_set_cursor (GimpPreview *preview);
static GimpPreviewClass *parent_class = NULL;
GType
gimp_scrolled_preview_get_type (void)
{
@ -111,8 +115,6 @@ gimp_scrolled_preview_class_init (GimpScrolledPreviewClass *klass)
object_class->dispose = gimp_scrolled_preview_dispose;
klass->draw_thumb = NULL;
preview_class->set_cursor = gimp_scrolled_preview_set_cursor;
}
@ -122,11 +124,8 @@ gimp_scrolled_preview_init (GimpScrolledPreview *preview)
GtkWidget *image;
GtkObject *adj;
preview->xoff = 0;
preview->yoff = 0;
preview->in_drag = FALSE;
preview->nav_popup = NULL;
preview->in_drag = FALSE;
preview->nav_popup = NULL;
/* scrollbars */
adj = gtk_adjustment_new (0, 0, GIMP_PREVIEW (preview)->width - 1, 1.0,
@ -283,7 +282,7 @@ gimp_scrolled_preview_area_size_allocate (GtkWidget *widget,
if (GTK_WIDGET_VISIBLE (preview->vscr) &&
GTK_WIDGET_VISIBLE (preview->hscr) &&
GIMP_SCROLLED_PREVIEW_GET_CLASS (preview)->draw_thumb)
GIMP_PREVIEW_GET_CLASS (preview)->draw_thumb)
{
gtk_widget_show (preview->nav_icon);
}
@ -314,8 +313,8 @@ gimp_scrolled_preview_area_event (GtkWidget *area,
case 1:
gtk_widget_get_pointer (area, &preview->drag_x, &preview->drag_y);
preview->drag_xoff = preview->xoff;
preview->drag_yoff = preview->yoff;
preview->drag_xoff = GIMP_PREVIEW (preview)->xoff;
preview->drag_yoff = GIMP_PREVIEW (preview)->yoff;
preview->in_drag = TRUE;
gtk_grab_add (area);
@ -350,11 +349,18 @@ gimp_scrolled_preview_area_event (GtkWidget *area,
dy = y - preview->drag_y;
xoff = CLAMP (preview->drag_xoff - dx,
0, GIMP_PREVIEW (preview)->xmax - GIMP_PREVIEW (preview)->xmin - GIMP_PREVIEW (preview)->width);
0,
GIMP_PREVIEW (preview)->xmax -
GIMP_PREVIEW (preview)->xmin -
GIMP_PREVIEW (preview)->width);
yoff = CLAMP (preview->drag_yoff - dy,
0, GIMP_PREVIEW (preview)->ymax - GIMP_PREVIEW (preview)->ymin - GIMP_PREVIEW (preview)->height);
0,
GIMP_PREVIEW (preview)->ymax -
GIMP_PREVIEW (preview)->ymin -
GIMP_PREVIEW (preview)->height);
if (preview->xoff != xoff || preview->yoff != yoff)
if (GIMP_PREVIEW (preview)->xoff != xoff ||
GIMP_PREVIEW (preview)->yoff != yoff)
{
gtk_range_set_value (GTK_RANGE (preview->hscr), xoff);
gtk_range_set_value (GTK_RANGE (preview->vscr), yoff);
@ -373,34 +379,34 @@ gimp_scrolled_preview_area_event (GtkWidget *area,
}
static void
gimp_scrolled_preview_h_scroll (GtkAdjustment *hadj,
GimpScrolledPreview *preview)
gimp_scrolled_preview_h_scroll (GtkAdjustment *hadj,
GimpPreview *preview)
{
preview->xoff = hadj->value;
gimp_preview_area_set_offsets (GIMP_PREVIEW_AREA (GIMP_PREVIEW (preview)->area),
gimp_preview_area_set_offsets (GIMP_PREVIEW_AREA (preview->area),
preview->xoff, preview->yoff);
if (! preview->in_drag)
if (! GIMP_SCROLLED_PREVIEW (preview)->in_drag)
{
gimp_preview_draw (GIMP_PREVIEW (preview));
gimp_preview_invalidate (GIMP_PREVIEW (preview));
gimp_preview_draw (preview);
gimp_preview_invalidate (preview);
}
}
static void
gimp_scrolled_preview_v_scroll (GtkAdjustment *vadj,
GimpScrolledPreview *preview)
gimp_scrolled_preview_v_scroll (GtkAdjustment *vadj,
GimpPreview *preview)
{
preview->yoff = vadj->value;
gimp_preview_area_set_offsets (GIMP_PREVIEW_AREA (GIMP_PREVIEW (preview)->area),
gimp_preview_area_set_offsets (GIMP_PREVIEW_AREA (preview->area),
preview->xoff, preview->yoff);
if (! preview->in_drag)
if (! GIMP_SCROLLED_PREVIEW (preview)->in_drag)
{
gimp_preview_draw (GIMP_PREVIEW (preview));
gimp_preview_invalidate (GIMP_PREVIEW (preview));
gimp_preview_draw (preview);
gimp_preview_invalidate (preview);
}
}
@ -409,6 +415,8 @@ gimp_scrolled_preview_nav_button_press (GtkWidget *widget,
GdkEventButton *event,
GimpScrolledPreview *preview)
{
GimpPreview *gimp_preview = GIMP_PREVIEW (preview);
if (preview->nav_popup)
return TRUE;
@ -452,18 +460,18 @@ gimp_scrolled_preview_nav_button_press (GtkWidget *widget,
G_CALLBACK (gimp_scrolled_preview_nav_popup_expose),
preview);
GIMP_SCROLLED_PREVIEW_GET_CLASS (preview)->draw_thumb (preview,
GIMP_PREVIEW_AREA (area),
POPUP_SIZE, POPUP_SIZE);
GIMP_PREVIEW_GET_CLASS (preview)->draw_thumb (gimp_preview,
GIMP_PREVIEW_AREA (area),
POPUP_SIZE, POPUP_SIZE);
gtk_widget_realize (area);
gtk_widget_show (area);
gdk_window_get_origin (widget->window, &x, &y);
h = ((gdouble) (preview->xoff + GIMP_PREVIEW (preview)->width / 2) /
(gdouble) (GIMP_PREVIEW (preview)->xmax - GIMP_PREVIEW (preview)->xmin));
v = ((gdouble) (preview->yoff + GIMP_PREVIEW (preview)->height / 2) /
(gdouble) (GIMP_PREVIEW (preview)->ymax - GIMP_PREVIEW (preview)->ymin));
h = ((gdouble) (gimp_preview->xoff + gimp_preview->width / 2) /
(gdouble) (gimp_preview->xmax - gimp_preview->xmin));
v = ((gdouble) (gimp_preview->yoff + gimp_preview->height / 2) /
(gdouble) (gimp_preview->ymax - gimp_preview->ymin));
x += event->x - h * (gdouble) GIMP_PREVIEW_AREA (area)->width;
y += event->y - v * (gdouble) GIMP_PREVIEW_AREA (area)->height;
@ -580,14 +588,19 @@ gimp_scrolled_preview_nav_popup_expose (GtkWidget *widget,
GdkEventExpose *event,
GimpScrolledPreview *preview)
{
gdouble x, y;
gdouble w, h;
GimpPreview *gimp_preview = GIMP_PREVIEW (preview);
gdouble x, y;
gdouble w, h;
x = (gdouble) preview->xoff / (gdouble) (GIMP_PREVIEW (preview)->xmax - GIMP_PREVIEW (preview)->xmin);
y = (gdouble) preview->yoff / (gdouble) (GIMP_PREVIEW (preview)->ymax - GIMP_PREVIEW (preview)->ymin);
x = ((gdouble) gimp_preview->xoff /
(gdouble) (gimp_preview->xmax - gimp_preview->xmin));
y = ((gdouble) gimp_preview->yoff /
(gdouble) (gimp_preview->ymax - gimp_preview->ymin));
w = (gdouble) GIMP_PREVIEW (preview)->width / (gdouble) (GIMP_PREVIEW (preview)->xmax - GIMP_PREVIEW (preview)->xmin);
h = (gdouble) GIMP_PREVIEW (preview)->height / (gdouble) (GIMP_PREVIEW (preview)->ymax - GIMP_PREVIEW (preview)->ymin);
w = ((gdouble) gimp_preview->width /
(gdouble) (gimp_preview->xmax - gimp_preview->xmin));
h = ((gdouble) gimp_preview->height /
(gdouble) (gimp_preview->ymax - gimp_preview->ymin));
gdk_gc_set_clip_rectangle (preview->nav_gc, &event->area);
@ -617,26 +630,3 @@ gimp_scrolled_preview_set_cursor (GimpPreview *preview)
gdk_window_set_cursor (preview->area->window, NULL);
}
}
/**
* gimp_preview_get_position:
* @preview: a #GimpPreview widget
* @x: return location for the horizontal offset
* @y: return location for the vertical offset
*
* Since: GIMP 2.2
**/
void
gimp_scrolled_preview_get_position (GimpScrolledPreview *preview,
gint *x,
gint *y)
{
g_return_if_fail (GIMP_IS_SCROLLED_PREVIEW (preview));
if (x)
*x = preview->xoff + GIMP_PREVIEW (preview)->xmin;
if (y)
*y = preview->yoff + GIMP_PREVIEW (preview)->ymin;
}

View File

@ -53,7 +53,6 @@ struct _GimpScrolledPreview
GdkGC *nav_gc;
/*< private >*/
gint xoff, yoff;
gint drag_x, drag_y;
gint drag_xoff, drag_yoff;
@ -62,21 +61,12 @@ struct _GimpScrolledPreview
struct _GimpScrolledPreviewClass
{
GimpPreviewClass parent_class;
/* virtuals */
void (* draw_thumb) (GimpScrolledPreview *preview,
GimpPreviewArea *area,
gint width,
gint height);
GimpPreviewClass parent_class;
};
GType gimp_scrolled_preview_get_type (void) G_GNUC_CONST;
GType gimp_scrolled_preview_get_type (void) G_GNUC_CONST;
void gimp_scrolled_preview_get_position (GimpScrolledPreview *preview,
gint *x,
gint *y);
G_END_DECLS

View File

@ -163,6 +163,7 @@ EXPORTS
gimp_preview_area_set_max_size
gimp_preview_area_set_offsets
gimp_preview_draw
gimp_preview_get_position
gimp_preview_get_size
gimp_preview_get_type
gimp_preview_get_update
@ -183,7 +184,6 @@ EXPORTS
gimp_scale_entry_new
gimp_scale_entry_set_logarithmic
gimp_scale_entry_set_sensitive
gimp_scrolled_preview_get_position
gimp_scrolled_preview_get_type
gimp_size_entry_add_field
gimp_size_entry_attach_label

View File

@ -1229,8 +1229,7 @@ dialog_update_preview (GimpPreview *preview)
gint width, height;
gint bytes;
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_position (preview, &x1, &y1);
gimp_preview_get_size (preview, &width, &height);
bytes =drawable->bpp;

View File

@ -289,8 +289,7 @@ cartoon (GimpDrawable *drawable,
if (preview)
{
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_position (preview, &x1, &y1);
gimp_preview_get_size (GIMP_PREVIEW (preview), &width, &height);
}
else

View File

@ -199,8 +199,7 @@ deinterlace (GimpDrawable *drawable,
if (preview)
{
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_position (GIMP_PREVIEW (preview), &x1, &y1);
gimp_preview_get_size (GIMP_PREVIEW (preview), &width, &height);
dest_buffer = dest = g_new (guchar, width * height * bytes);
}

View File

@ -721,11 +721,8 @@ preview_update (GtkWidget *widget)
preview = GIMP_PREVIEW (widget);
rgba = g_new (guchar, preview->width * preview->height * img_bpp);
/*
* Setup for filter...
*/
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_position (preview, &x1, &y1);
gimp_pixel_rgn_init (&src_rgn, drawable,
x1, y1, preview->width, preview->height,

View File

@ -923,8 +923,7 @@ preview_update_preview (GimpDrawablePreview *preview,
bpp = gimp_drawable_bpp (drawable->drawable_id);
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_position (GIMP_PREVIEW (preview), &x1, &y1);
gimp_preview_get_size (GIMP_PREVIEW (preview), &width, &height);
buffer = g_new (guchar, width * height * bpp);

View File

@ -800,10 +800,8 @@ edge_preview_update (GimpDrawablePreview *preview)
/*
* Setup for filter...
*/
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_size (GIMP_PREVIEW (preview),
&width, &height);
gimp_preview_get_position (GIMP_PREVIEW (preview), &x1, &y1);
gimp_preview_get_size (GIMP_PREVIEW (preview), &width, &height);
/* initialize pixel regions */
gimp_pixel_rgn_init (&srcPR, preview->drawable,

View File

@ -434,8 +434,7 @@ engrave_small (GimpDrawable *drawable,
if (preview)
{
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_position (GIMP_PREVIEW (preview), &x1, &y1);
gimp_preview_get_size (GIMP_PREVIEW (preview), &width, &height);
x2 = x1 + width;

View File

@ -661,8 +661,7 @@ exchange (GimpDrawable *drawable,
if (preview)
{
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_position (GIMP_PREVIEW (preview), &x1, &y1);
gimp_preview_get_size (GIMP_PREVIEW (preview), &width, &height);
x2 = x1 + width;

View File

@ -654,9 +654,7 @@ gauss (GimpDrawable *drawable,
if (preview)
{
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_position (GIMP_PREVIEW (preview), &x1, &y1);
gimp_preview_get_size (GIMP_PREVIEW (preview), &width, &height);
}
else

View File

@ -384,8 +384,7 @@ grid (gint32 image_ID,
if (preview)
{
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&sx1, &sy1);
gimp_preview_get_position (preview, &sx1, &sy1);
gimp_preview_get_size (preview, &sx2, &sy2);
buffer = g_new (guchar, bytes * sx2 * sy2);

View File

@ -779,8 +779,7 @@ mblur (GimpDrawable *drawable,
if (preview)
{
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x, &y);
gimp_preview_get_position (preview, &x, &y);
gimp_preview_get_size (preview, &width, &height);
}
else

View File

@ -261,9 +261,7 @@ neon (GimpDrawable *drawable,
if (preview)
{
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_position (GIMP_PREVIEW (preview), &x1, &y1);
gimp_preview_get_size (GIMP_PREVIEW (preview), &width, &height);
x2 = x1 + width;
y2 = y1 + height;

View File

@ -282,9 +282,9 @@ noisify (GimpDrawablePreview *preview)
gint bpp;
GRand *gr = g_rand_new ();
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_position (GIMP_PREVIEW (preview), &x1, &y1);
gimp_preview_get_size (GIMP_PREVIEW (preview), &width, &height);
bpp = preview->drawable->bpp;
src = g_new (guchar, width * height * bpp);

View File

@ -235,8 +235,7 @@ oilify_rgb (GimpDrawable *drawable,
/* get the selection bounds */
if (preview)
{
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_position (GIMP_PREVIEW (preview), &x1, &y1);
gimp_preview_get_size (GIMP_PREVIEW (preview), &width, &height);
x2 = x1 + width;
@ -357,8 +356,7 @@ oilify_intensity (GimpDrawable *drawable,
/* get the selection bounds */
if (preview)
{
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_position (GIMP_PREVIEW (preview), &x1, &y1);
gimp_preview_get_size (GIMP_PREVIEW (preview), &width, &height);
x2 = x1 + width;

View File

@ -304,8 +304,7 @@ photocopy (GimpDrawable *drawable,
if (preview)
{
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_position (GIMP_PREVIEW (preview), &x1, &y1);
gimp_preview_get_size (GIMP_PREVIEW (preview), &width, &height);
}
else

View File

@ -471,8 +471,7 @@ preview_update (GimpDrawablePreview *preview)
/*
* Setup for filter...
*/
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_position (GIMP_PREVIEW (preview), &x1, &y1);
gimp_preview_get_size (GIMP_PREVIEW (preview), &width, &height);
/* initialize pixel regions */

View File

@ -553,13 +553,11 @@ preview_update (GimpDrawablePreview *preview)
filter = NULL;
compute_luts();
/*
* Setup for filter...
*/
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_position (GIMP_PREVIEW (preview), &x1, &y1);
gimp_preview_get_size (GIMP_PREVIEW (preview),
&preview_width, &preview_height);
img_bpp = gimp_drawable_bpp (preview->drawable->drawable_id);

View File

@ -241,8 +241,7 @@ shift (GimpDrawable *drawable,
if (preview)
{
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_position (GIMP_PREVIEW (preview), &x1, &y1);
gimp_preview_get_size (GIMP_PREVIEW (preview), &width, &height);
}
else

View File

@ -348,8 +348,7 @@ sobel (GimpDrawable *drawable,
if (preview)
{
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_position (preview, &x1, &y1);
gimp_preview_get_size (preview, &width, &height);
x2 = x1 + width;
y2 = y1 + height;

View File

@ -256,8 +256,7 @@ softglow (GimpDrawable *drawable,
if (preview)
{
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_position (preview, &x1, &y1);
gimp_preview_get_size (preview, &width, &height);
x2 = x1 + width;
y2 = y1 + height;

View File

@ -308,8 +308,8 @@ spread_preview_update (GimpPreview *preview,
bpp = drawable_preview->drawable->bpp;
dest = buffer = g_new (guchar, width * height * bpp);
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x_off, &y_off);
gimp_preview_get_position (preview, &x_off, &y_off);
for (y = 0 ; y < height ; y++)
for (x = 0 ; x < width ; x++)

View File

@ -1353,8 +1353,7 @@ strucpi (GimpDrawable *drawable,
if (preview)
{
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_position (GIMP_PREVIEW (preview), &x1, &y1);
gimp_preview_get_size (GIMP_PREVIEW (preview), &width, &height);
x2 = x1 + width;

View File

@ -771,8 +771,7 @@ preview_update (GimpPreview *preview)
/*
* Setup for filter...
*/
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&preview_x1, &preview_y1);
gimp_preview_get_position (preview, &preview_x1, &preview_y1);
gimp_preview_get_size (preview, &preview_x2, &preview_y2);
preview_x2 += preview_x1;
preview_y2 += preview_y1;

View File

@ -303,9 +303,9 @@ render_blast (GimpDrawable *drawable,
if (preview)
{
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_position (GIMP_PREVIEW (preview), &x1, &y1);
gimp_preview_get_size (GIMP_PREVIEW (preview), &width, &height);
x2 = x1 + width;
y2 = y1 + height;
@ -427,9 +427,9 @@ render_wind (GimpDrawable *drawable,
if (preview)
{
gimp_scrolled_preview_get_position (GIMP_SCROLLED_PREVIEW (preview),
&x1, &y1);
gimp_preview_get_position (GIMP_PREVIEW (preview), &x1, &y1);
gimp_preview_get_size (GIMP_PREVIEW (preview), &width, &height);
x2 = x1 + width;
y2 = y1 + height;