Re: Sane with latest Gimp

From: Jeremy L Rosenberger (jlr4@cornell.edu)
Date: Tue Oct 10 2000 - 19:12:07 PDT

  • Next message: Stens, Ralph: "AW: [SnapScan] Core testing group"

    I modified xscanimage.c (the only file that appeared to require
    modification) myself; a patch file (to be applied to 1.0.3) is attached.

    Cheers,
    Jeremy

    Joachim Ansorg wrote:
     
    > Sane doesn''t compile with the latest GIMP (they changed the names of
    > the enums, structs and other things).
    >
    > Does somebody have a patch?
    > xsane doesn't compile, too.

    -- 
    

    Jeremy L. Rosenberger * jlr4@cornell.edu

    --- xscanimage.c.orig Mon Oct 2 22:15:03 2000 +++ xscanimage.c Mon Oct 2 22:30:07 2000 @@ -60,10 +60,10 @@ #include <libgimp/gimp.h> static void query (void); -static void run (char *name, int nparams, GParam * param, - int *nreturn_vals, GParam ** return_vals); +static void run (char *name, int nparams, GimpParam * param, + int *nreturn_vals, GimpParam ** return_vals); -GPlugInInfo PLUG_IN_INFO = +GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ @@ -100,10 +100,10 @@ #ifdef HAVE_LIBGIMP_GIMP_H /* for GIMP mode: */ gint32 image_ID; - GDrawable *drawable; + GimpDrawable *drawable; guchar *tile; unsigned tile_offset; - GPixelRgn region; + GimpPixelRgn region; int first_frame; /* used for RED/GREEN/BLUE frames */ #endif } @@ -231,11 +231,11 @@ static void query (void) { - static GParamDef args[] = + static GimpParamDef args[] = { - {PARAM_INT32, "run_mode", "Interactive, non-interactive"}, + {GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive"}, }; - static GParamDef *return_vals = NULL; + static GimpParamDef *return_vals = NULL; static int nargs = sizeof (args) / sizeof (args[0]); static int nreturn_vals = 0; char mpath[1024]; @@ -253,7 +253,7 @@ "8th June 1997", "<Toolbox>/Xtns/Acquire Image/Device dialog...", "RGB, GRAY", - PROC_EXTENSION, + GIMP_EXTENSION, nargs, nreturn_vals, args, return_vals); @@ -284,18 +284,18 @@ "interface.", "Andy Beck, Tristan Tarrant, and David Mosberger", "Andy Beck, Tristan Tarrant, and David Mosberger", - "8th June 1997", mpath, "RGB, GRAY", PROC_EXTENSION, + "8th June 1997", mpath, "RGB, GRAY", GIMP_EXTENSION, nargs, nreturn_vals, args, return_vals); } sane_exit (); } static void -run (char *name, int nparams, GParam * param, - int *nreturn_vals, GParam ** return_vals) +run (char *name, int nparams, GimpParam * param, + int *nreturn_vals, GimpParam ** return_vals) { - static GParam values[2]; - GRunModeType run_mode; + static GimpParam values[2]; + GimpRunModeType run_mode; char devname[1024]; char *args[2]; int nargs; @@ -306,8 +306,8 @@ *nreturn_vals = 1; *return_vals = values; - values[0].type = PARAM_STATUS; - values[0].data.d_status = STATUS_CALLING_ERROR; + values[0].type = GIMP_PDB_STATUS; + values[0].data.d_status = GIMP_PDB_CALLING_ERROR; nargs = 0; args[nargs++] = "xscanimage"; @@ -322,16 +322,16 @@ switch (run_mode) { - case RUN_INTERACTIVE: + case GIMP_RUN_INTERACTIVE: interface (nargs, args); - values[0].data.d_status = STATUS_SUCCESS; + values[0].data.d_status = GIMP_PDB_SUCCESS; break; - case RUN_NONINTERACTIVE: + case GIMP_RUN_NONINTERACTIVE: /* Make sure all the arguments are there! */ break; - case RUN_WITH_LAST_VALS: + case GIMP_RUN_WITH_LAST_VALS: /* Possibly retrieve data */ break; @@ -912,14 +912,14 @@ scan_win.first_frame = 0; else { - GImageType image_type = RGB; - GDrawableType drawable_type = RGB_IMAGE; + GimpImageBaseType image_type = GIMP_RGB; + GimpImageType drawable_type = GIMP_RGB_IMAGE; gint32 layer_ID; if (scan_win.param.format == SANE_FRAME_GRAY) { - image_type = GRAY; - drawable_type = GRAY_IMAGE; + image_type = GIMP_GRAY; + drawable_type = GIMP_GRAY_IMAGE; } scan_win.image_ID = gimp_image_new (scan_win.param.pixels_per_line, @@ -927,7 +927,7 @@ layer_ID = gimp_layer_new (scan_win.image_ID, "Background", scan_win.param.pixels_per_line, scan_win.param.lines, - drawable_type, 100, NORMAL_MODE); + drawable_type, 100, GIMP_NORMAL_MODE); gimp_image_add_layer (scan_win.image_ID, layer_ID, 0); scan_win.drawable = gimp_drawable_get (layer_ID);

    --
    Source code, list archive, and docs: http://www.mostang.com/sane/
    To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com
    



    This archive was generated by hypermail 2b29 : Tue Oct 10 2000 - 19:09:36 PDT