diff --git a/fix-ca.c b/fix-ca.c index 9a054c8..5b351ad 100644 --- a/fix-ca.c +++ b/fix-ca.c @@ -108,8 +108,7 @@ static void fix_ca_region (guchar *srcPTR, guchar *dstPTR, gint x1, gint x2, gint y1, gint y2, gboolean show_progress); static gboolean fix_ca_dialog (gint32 drawable_ID, FixCaParams *params); -//static void preview_update (GimpPreview *preview, FixCaParams *params); -static void preview_update (GimpDrawablePreview *preview, FixCaParams *params); +static void preview_update (GtkWidget *widget, FixCaParams *params); static int color_size (const Babl *format); static gdouble get_pixel (guchar *ptr, gint bpc); static void set_pixel (guchar *dest, gdouble d, gint bpc); @@ -304,6 +303,7 @@ static void run (const gchar *name, gint nparams, break; case GIMP_RUN_WITH_LAST_VALS: + gimp_ui_init ("fix_ca", TRUE); gimp_get_data (DATA_KEY_VALS, &fix_ca_params); break; @@ -614,9 +614,9 @@ static gboolean fix_ca_dialog (gint32 drawable_ID, FixCaParams *params) return run; } -//static void preview_update (GtkWidget *widget, FixCaParams *params) -static void preview_update (GimpDrawablePreview *preview, FixCaParams *params) +static void preview_update (GtkWidget *widget, FixCaParams *params) { + GimpDrawablePreview *preview; GimpPreview *ptr; gint32 preview_ID; gint b, i, j, x, y, width, height, xImg, yImg, bppImg, bpcImg, size; @@ -625,8 +625,8 @@ static void preview_update (GimpDrawablePreview *preview, FixCaParams *params) const Babl *format; gdouble d; - /* GimpPreview is a subset of GimpScrolledPreview */ - ptr = (GimpPreview *)(preview); + preview = GIMP_DRAWABLE_PREVIEW (widget); + ptr = GIMP_PREVIEW (preview); gimp_preview_get_position (ptr, &x, &y); gimp_preview_get_size (ptr, &width, &height); diff --git a/tests/Makefile.am b/tests/Makefile.am index 3828f2f..d050cd1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -10,9 +10,9 @@ test_fix_ca_SOURCES = test-fix-ca.c test_fix_ca.$(OBJEXT): fix-ca-config.h test_fix_ca_LDADD = ${LIBS} ${GIMP_LIBS} ${GTK_LIBS} ${WSLIB} ${FCA_LIB} -update-tests: +update-test1: echo "#!/bin/sh" > ${builddir}/test1.sh; \ - echo "rm -f ${builddir}/test1.tga" >> ${builddir}/test1.sh; \ + echo "rm -f ${builddir}/test1.bmp" >> ${builddir}/test1.sh; \ echo "${GIMPTOOL} --install-script ${srcdir}/test-fix-ca.scm" >> ${builddir}/test1.sh; \ echo "${GIMPTOOL} --install-bin ${builddir}/test-fix-ca" >> ${builddir}/test1.sh; \ echo "gimp --verbose --console-messages -i -b '(test \"${top_srcdir}/img-fix-ca/full-branches.jpg\" \"${builddir}/test1.bmp\" 6.0 -2.4 658 1280 1 0.0 0.0 0.0 0.0)' -b '(gimp-quit 0)'" >> ${builddir}/test1.sh; \ @@ -24,9 +24,9 @@ update-tests: TESTS = ${builddir}/test1.sh test1.sh: - make update-tests + make update-test1 clean-local: rm -f ${builddir}/test?.sh ${builddir}/test?.bmp -.PHONY: update-tests +.PHONY: update-test1