RSS/Atom feed Twitter
Site is read-only, email is disabled

Converting old plug-ins to wirk with gimp-1.3.20 (gimp-2)

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

7 of 7 messages available
Toggle history

Please log in to manage your subscriptions.

Converting old plug-ins to wirk with gimp-1.3.20 (gimp-2) Jeff Trefftzs 28 Sep 18:44
  Converting old plug-ins to wirk with gimp-1.3.20 (gimp-2) David Neary 29 Sep 13:44
  Converting old plug-ins to wirk with gimp-1.3.20 (gimp-2) Sven Neumann 29 Sep 15:44
   Converting old plug-ins to wirk with gimp-1.3.20 (gimp-2) Jeff Trefftzs 29 Sep 19:55
    Converting old plug-ins to wirk with gimp-1.3.20 (gimp-2) Sven Neumann 29 Sep 23:42
     Converting old plug-ins to wirk with gimp-1.3.20 (gimp-2) Jeff Trefftzs 03 Oct 02:12
  Converting old plug-ins to wirk with gimp-1.3.20(gimp-2) Hans Breuer 29 Sep 23:18
Jeff Trefftzs
2003-09-28 18:44:23 UTC (over 20 years ago)

Converting old plug-ins to wirk with gimp-1.3.20 (gimp-2)

Hi all,

As we are about to move to the next stage of gimpery, I have begun looking closely at my large collection of plug-ins, many of which I remember compiling with GIMP_ENABLE_COMPAT_CRUFT, and wondering how to make them usable again under the new regime. Can anybody point me to a porting guide that identifies the changes needed to go from the old (well, present) api to that used in gimp-1.3.20 and up?

I have already written a quckie decrufter perl script to obviate the need to use GIMP_ENABLE_COMPAT_CRUFT, and I have found a few changes between present stable usage and the 1.3.20 version, but I'm still wondering what else I'm missing.

All advice and tips will b gratefully appreciated.

TIA,

David Neary
2003-09-29 13:44:52 UTC (over 20 years ago)

Converting old plug-ins to wirk with gimp-1.3.20 (gimp-2)

Hi Jeff,

Jeff Trefftzs wrote:

As we are about to move to the next stage of gimpery, I have begun looking closely at my large collection of plug-ins, many of which I remember compiling with GIMP_ENABLE_COMPAT_CRUFT, and wondering how to make them usable again under the new regime. Can anybody point me to a porting guide that identifies the changes needed to go from the old (well, present) api to that used in gimp-1.3.20 and up?

I have updated a few plug-ins to 1.3.x - but I have forgotten exactly what needed to be done.

Could you point me to a plug-in to migrate, I will migrate it and document what I do?

Cheers,
Dave.

Sven Neumann
2003-09-29 15:44:07 UTC (over 20 years ago)

Converting old plug-ins to wirk with gimp-1.3.20 (gimp-2)

Hi,

Jeff Trefftzs writes:

Hi all,

As we are about to move to the next stage of gimpery, I have begun looking closely at my large collection of plug-ins, many of which I remember compiling with GIMP_ENABLE_COMPAT_CRUFT, and wondering how to make them usable again under the new regime. Can anybody point me to a porting guide that identifies the changes needed to go from the old (well, present) api to that used in gimp-1.3.20 and up?

I have already written a quckie decrufter perl script to obviate the need to use GIMP_ENABLE_COMPAT_CRUFT, and I have found a few changes between present stable usage and the 1.3.20 version, but I'm still wondering what else I'm missing.

If your plug-in still needs GIMP_ENABLE_COMPAT_CRUFT, it hasn't been ported to gimp-1.2 yet. Of course you need to do that first.

Assuming you have a gimp-1.2 plug-in, here's what you do to port it to the 1.3 API:

(1) Replace all occurances of drawable->id with drawable->drawable_id. (2) Include .
(3) Fix whatever problems remain (if you are lucky, there are none). (4) Look at gimpcompat.h and do the changes described there. (5) Remove the inclusion of gimpcompat.h again.

Sven

Jeff Trefftzs
2003-09-29 19:55:54 UTC (over 20 years ago)

Converting old plug-ins to wirk with gimp-1.3.20 (gimp-2)

On Mon, 2003-09-29 at 06:44, Sven Neumann wrote:

If your plug-in still needs GIMP_ENABLE_COMPAT_CRUFT, it hasn't been ported to gimp-1.2 yet. Of course you need to do that first.

Do I need to do anything except replace the old cruft with the new calls as specified in gimp-1.2.5/libgimp/gimpcompat.h?

Assuming you have a gimp-1.2 plug-in, here's what you do to port it to the 1.3 API:

(1) Replace all occurances of drawable->id with drawable->drawable_id. (2) Include .
(3) Fix whatever problems remain (if you are lucky, there are none). (4) Look at gimpcompat.h and do the changes described there. (5) Remove the inclusion of gimpcompat.h again.

Thanks for your prompt and helpful reply. It looks like I found most of the required changes. I'll get busy converting and let you know how it all comes out.

Hans Breuer
2003-09-29 23:18:15 UTC (over 20 years ago)

Converting old plug-ins to wirk with gimp-1.3.20(gimp-2)

At 09:44 28.09.03 -0700, Jeff Trefftzs wrote:

Hi all,

As we are about to move to the next stage of gimpery, I have begun looking closely at my large collection of plug-ins, many of which I remember compiling with GIMP_ENABLE_COMPAT_CRUFT, and wondering how to make them usable again under the new regime. Can anybody point me to a porting guide that identifies the changes needed to go from the old (well, present) api to that used in gimp-1.3.20 and up?

I have already written a quckie decrufter perl script to obviate the need to use GIMP_ENABLE_COMPAT_CRUFT, and I have found a few changes between present stable usage and the 1.3.20 version, but I'm still wondering what else I'm missing.

Attached you'll find my small porting helper (a little bit like a working documentation; sorry if it's in the wrong scripting language :-)

Beside that there were some smaller changes required as

GimpRGB instead of guchar r,g,b;

deleting : color_cube = gimp_color_cube ();
gtk_preview_set_color_cube (color_cube[0], color_cube[1], color_cube[2], color_cube[3]);

Have Fun, Hans

ApiPrefixChanges = (
# old prefix, new prefix, identifiers rest ("G", "Gimp",
(
"Drawable",
"Param",
"ParamDef",
"PixelRgn",
"PlugInInfo",
"Tile",
)),
("PARAM_", "GIMP_PDB_",
(
"CHANNEL",
"COLOR",
"DISPLAY",
"DRAWABLE",
"FLOAT",
"LAYER",
"IMAGE",
"INT32",
"INT16",
"INT8",
"PARASITE",
"SELECTION",
"STRING",
"STRINGARRAY",
"STATUS",
)),
("PROC_", "GIMP_",
(
"EXTENSION",
#not "PLUG_IN",
"TEMPORARY"
)),
("RUN_", "GIMP_RUN_",
(
"INTERACTIVE",
"NONINTERACTIVE",
"WITH_LAST_VALS"
)),
("STATUS_", "GIMP_PDB_",
(
"CALLING_ERROR",
"EXECUTION_ERROR",
"SUCCESS"
)),
("", "GIMP_",
(
# GimpImageType
"RGB_IMAGE",
"RGBA_IMAGE",
"GRAY_IMAGE",
"GRAYA_IMAGE",
"INDEXED_IMAGE",
"INDEXEDA_IMAGE",
# GimpLayerModeEffects
"NORMAL_MODE",
"DISSOLVE_MODE",
"BEHIND_MODE"
# ...
))
)

OtherChanges = (
("GDrawableType", "GimpImageType"), ("GRunModeType", "GimpRunMode"),
("GStatusType", "GimpPDBStatusType"), ("PROC_PLUG_IN", "GIMP_PLUGIN"),
("gimp_drawable_color", "gimp_drawable_is_rgb"), ("gimp_drawable_gray", "gimp_drawable_is_gray"), ("gimp_drawable_indexed", "gimp_drawable_is_indexed"), )

import os, re, sys

# create a dictionary with all the changes to apply changes = []
sBefore = r"(^|[ \t(=])"
sAfter = r"([ \t,;:()=])"
for t1 in ApiPrefixChanges :
s1PreOld = t1[0]
s1PreNew = t1[1]
for t2 in t1[2] :
r1 = re.compile(sBefore + s1PreOld + t2 + sAfter, re.DOTALL | re.MULTILINE) r2 = r"\1" + s1PreNew + t2 + r"\2" changes.append((r1, r2))
for t1 in OtherChanges :
r1 = re.compile(sBefore + t1[0] + sAfter, re.DOTALL | re.MULTILINE) r2 = r"\1" + t1[1] + r"\2"
changes.append((r1, r2))

sFile = sys.argv[1] sFileBac = sFile + ".pre13"
os.rename(sFile, sFileBac)
f = open(sFileBac)
sAll = f.read()
f.close()

for t in changes :
print t[1][2:-2]
sAll = t[0].sub(t[1], sAll)

f = open(sFile, "w") f.write(sAll)

-------- Hans "at" Breuer "dot" Org ----------- Tell me what you need, and I'll tell you how to get along without it. -- Dilbert

Sven Neumann
2003-09-29 23:42:53 UTC (over 20 years ago)

Converting old plug-ins to wirk with gimp-1.3.20 (gimp-2)

Hi,

Jeff Trefftzs writes:

On Mon, 2003-09-29 at 06:44, Sven Neumann wrote:

If your plug-in still needs GIMP_ENABLE_COMPAT_CRUFT, it hasn't been ported to gimp-1.2 yet. Of course you need to do that first.

Do I need to do anything except replace the old cruft with the new calls as specified in gimp-1.2.5/libgimp/gimpcompat.h?

It it compiles against the 1.2 API with GIMP_ENABLE_COMPAT_CRUFT defined, it should compile without that define after you've made the changes defined by 1.2 gimpcompat.h.

For gimp-1.3 we decided not to include gimpcompat.h from gimp.h. So instead of adding a define to get the compat cruft, you have to include an extra header file. Not all changes are covered by this file. Mainly because you cannot wrap all API changes in #defines. There aren't too many other changes however. All of them should create a compiler error. Please compile with -Wall to request all the help the compiler can give you.

Thanks for your prompt and helpful reply. It looks like I found most of the required changes. I'll get busy converting and let you know how it all comes out.

Perhaps you want to contribute a short porting guide. Such a document should be included with the 1.3 API reference. Let me know if you are interested, I can give you a template that we can include in devel-docs/libgimp later.

Sven

Jeff Trefftzs
2003-10-03 02:12:36 UTC (over 20 years ago)

Converting old plug-ins to wirk with gimp-1.3.20 (gimp-2)

On Mon, 2003-09-29 at 14:42, Sven Neumann wrote:

Hi,

Perhaps you want to contribute a short porting guide. Such a document should be included with the 1.3 API reference. Let me know if you are interested, I can give you a template that we can include in devel-docs/libgimp later.

Now that I've successfully ported a simple plug-in (ellipse.c, the one that maps an image to a circular or elliptical window, not the selection), I can make an informed reply of yes, certainly. Please go ahead and send or point me to the template.