made gimp_preview_draw() public, added some gtk-doc comments.

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

	* libgimpwidgets/gimppreview.[ch]: made gimp_preview_draw() public,
	added some gtk-doc comments.
	(gimp_preview_toggle_callback): immidiately invalidate the preview.

	* plug-ins/common/gauss.c (gauss): fixed (and simplified) handling
	of zero radii by using the new GimpPreview API.
This commit is contained in:
Sven Neumann 2004-09-02 10:23:52 +00:00 committed by Sven Neumann
parent 072bd88d4f
commit 50627802d0
4 changed files with 73 additions and 31 deletions

View File

@ -1,9 +1,25 @@
2004-09-02 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimppreview.[ch]: made gimp_preview_draw() public,
added some gtk-doc comments.
(gimp_preview_toggle_callback): immidiately invalidate the preview.
* plug-ins/common/gauss.c (gauss): fixed (and simplified) handling
of zero radii by using the new GimpPreview API.
2004-09-01 Helvetix Victorinox <helvetix@gimp.org>
* Added gimp_composite_addition_va8_va8_va8_mmx():
* Regression tests now include printing the image type for each test.
* Regenerated
* app/composite/gimp-composite-mmx.[ch]: Added
gimp_composite_addition_va8_va8_va8_mmx().
* app/composite/make-installer.py: Regression tests now include
printing the image type for each test.
* app/composite/gimp-composite-mmx-test.c
* app/composite/gimp-composite-regression.c
* app/composite/gimp-composite-sse-test.c
* app/composite/gimp-composite-sse2-test.c
* app/composite/gimp-composite-x86.h: regenerated.
2004-09-02 Sven Neumann <sven@gimp.org>
@ -15,7 +31,7 @@
* plug-ins/common/ripple.c
* plug-ins/common/spread.c
* plug-ins/common/video.c: don't pass run_mode to
gimp_rgn_iterator_new(), it's unused. Removes the need for ir being
gimp_rgn_iterator_new(), it's unused. Removes the need for it being
a global variable.
2004-09-01 Michael Natterer <mitch@gimp.org>

View File

@ -58,7 +58,6 @@ static void gimp_preview_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_preview_draw (GimpPreview *preview);
static void gimp_preview_area_realize (GtkWidget *widget,
GimpPreview *preview);
@ -77,6 +76,8 @@ static void gimp_preview_v_scroll (GtkAdjustment *vadj,
GimpPreview *preview);
static void gimp_preview_toggle_callback (GtkWidget *toggle,
GimpPreview *preview);
static gboolean gimp_preview_invalidate_now (GimpPreview *preview);
static guint preview_signals[LAST_SIGNAL] = { 0 };
@ -300,15 +301,6 @@ gimp_preview_set_property (GObject *object,
}
}
static void
gimp_preview_draw (GimpPreview *preview)
{
GimpPreviewClass *class = GIMP_PREVIEW_GET_CLASS (preview);
if (class->draw)
class->draw (preview);
}
static void
gimp_preview_area_realize (GtkWidget *widget,
GimpPreview *preview)
@ -512,11 +504,16 @@ gimp_preview_toggle_callback (GtkWidget *toggle,
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle)))
{
preview->update_preview = TRUE;
gimp_preview_invalidate (preview);
if (preview->timeout_id)
g_source_remove (preview->timeout_id);
gimp_preview_invalidate_now (preview);
}
else
{
preview->update_preview = FALSE;
gimp_preview_draw (preview);
}
@ -562,7 +559,10 @@ gimp_preview_invalidate_now (GimpPreview *preview)
/**
* gimp_preview_set_update:
* @preview: a #GimpPreview widget
* @update:
* @update: %TRUE if the preview should invalidate itself when being
* scrolled or when gimp_preview_invalidate() is being called
*
* Sets the state of the "Preview" check button.
*
* Since: GIMP 2.2
**/
@ -637,10 +637,42 @@ gimp_preview_get_position (GimpPreview *preview,
*y = preview->yoff + preview->ymin;
}
/*
* gimp_preview_draw:
* @preview: a #GimpPreview widget
*
* Calls the GimpPreview::draw method. GimpPreview itself doesn't
* implement a default draw method so the behaviour is determined by
* the derived class implementing this method.
*
* #GimpDrawablePreview implements gimp_preview_draw() by drawing the
* original, unmodified drawable to the @preview.
*
* Since: GIMP 2.2
**/
void
gimp_preview_draw (GimpPreview *preview)
{
GimpPreviewClass *class = GIMP_PREVIEW_GET_CLASS (preview);
if (class->draw)
class->draw (preview);
}
/*
* gimp_preview_invalidate:
* @preview: a #GimpPreview widget
*
* This function starts or renews a short low-priority timeout. When
* the timeout expires, the GimpPreview::invalidated signal is emitted
* which will usually cause the @preview to be updated.
*
* This function does nothing unless the "Preview" button is checked.
*
* During the emission of the signal a busy cursor is set on the
* toplevel window containing the @preview and on the preview area
* itself.
*
* Since: GIMP 2.2
**/
void

View File

@ -89,6 +89,7 @@ void gimp_preview_get_position (GimpPreview *preview,
gint *x,
gint *y);
void gimp_preview_draw (GimpPreview *preview);
void gimp_preview_invalidate (GimpPreview *preview);

View File

@ -557,12 +557,9 @@ static void
update_preview (GtkWidget *preview,
GtkWidget *size)
{
gdouble horizontal = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size), 0);
gdouble vertical = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size), 1);
gauss (GIMP_DRAWABLE_PREVIEW (preview)->drawable,
horizontal,
vertical,
gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size), 0),
gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size), 1),
bvals.method,
preview);
}
@ -652,7 +649,12 @@ gauss (GimpDrawable *drawable,
guchar *preview_buffer2 = NULL;
if (horz <= 0.0 && vert <= 0.0)
return;
{
if (preview)
gimp_preview_draw (preview);
return;
}
if (preview)
{
@ -872,11 +874,6 @@ gauss (GimpDrawable *drawable,
drawable, 0, 0, drawable->width, drawable->height,
FALSE, TRUE);
}
else if (preview)
{
gimp_pixel_rgn_get_rect (&src_rgn, preview_buffer1,
x1, y1, width, height);
}
/* Now the horizontal pass */
if (horz > 0.0)
@ -1047,10 +1044,6 @@ gauss (GimpDrawable *drawable,
}
}
}
else if (preview)
{
memcpy (preview_buffer2, preview_buffer1, width * height * bytes);
}
if (preview)
{