Re: [Gimp-developer] how to call a plugin

2007-03-14 Thread Luis A. Florit
Hi Bill,

> >Now, I just want to blur my drawable from my plugin.
> >I tried this:
> >
> >  GimpParam *rreturn_vals;
> >  gint nnreturn_vals;
> >  rreturn_vals = gimp_run_procedure("plug_in_blur", &nnreturn_vals,
> >  GIMP_PDB_INT32, GIMP_RUN_NONINTERACTIVE,
> >  GIMP_PDB_IMAGE, param[1].data.d_image,
> >  GIMP_PDB_DRAWABLE, gimp_drawable_get 
> > (param[2].data.d_drawable),
> >  GIMP_PDB_END);
> >
> >However, I get the following error: [...]
>
> The problem is the "gimp_drawable_get". As you can learn in the
> "GimpDrawable" section of the libgimp documentation, this function
> does not return the integer ID of the drawable, it creatss a
> new struct containing information about the drawable. I think
> you should just use param[2].data.d_drawable. (The handling of
> drawables in libgimp is pretty awkward, but probably shouldn't
> be changed at this point because it would create huge backward
> compatibility issues.)

Yep, it worked!
Thanks a lot!!

L.

___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] how to call a plugin

2007-03-14 Thread William Skaggs



Luis Florit wrote:

>Now, I just want to blur my drawable from my plugin.
>I tried this:
>
>  GimpParam *rreturn_vals;
>  gint nnreturn_vals;
>  rreturn_vals = gimp_run_procedure("plug_in_blur", &nnreturn_vals,
>  GIMP_PDB_INT32, GIMP_RUN_NONINTERACTIVE,
>  GIMP_PDB_IMAGE, param[1].data.d_image,
>  GIMP_PDB_DRAWABLE, gimp_drawable_get (param[2].data.d_drawable),
>  GIMP_PDB_END);
>
>However, I get the following error: [...]

The problem is the "gimp_drawable_get".  As you can learn in the
"GimpDrawable" section of the libgimp documentation, this function
does not return the integer ID of the drawable, it creatss a
new struct containing information about the drawable.  I think
you should just use param[2].data.d_drawable.  (The handling of
drawables in libgimp is pretty awkward, but probably shouldn't
be changed at this point because it would create huge backward
compatibility issues.)

  -- Bill
 

 
__ __ __ __
Sent via the CNPRC Email system at primate.ucdavis.edu


 
   
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


[Gimp-developer] how to call a plugin

2007-03-14 Thread Luis A. Florit
Pals,

I am feeling so silly in trying to develop a plugin...
I am stalling even at the most easy tasks.

Now, I just want to blur my drawable from my plugin.
I tried this:

  GimpParam *rreturn_vals;
  gint nnreturn_vals;
  rreturn_vals = gimp_run_procedure("plug_in_blur", &nnreturn_vals,
  GIMP_PDB_INT32, GIMP_RUN_NONINTERACTIVE,
  GIMP_PDB_IMAGE, param[1].data.d_image,
  GIMP_PDB_DRAWABLE, gimp_drawable_get (param[2].data.d_drawable),
  GIMP_PDB_END);

However, I get the following error:

Procedure 'plug-in-blur' has been called with an invalid ID for
argument 'drawable'. Most likely a plug-in is trying to work on a
layer that doesn't exist any longer.

What am I doing wrong?

Sorry for the silly questions and thanks!

Luis.
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer