After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 125141 - Deprecate gimpmisc and gimpmiscui
Deprecate gimpmisc and gimpmiscui
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: libgimp
git master
Other All
: Normal normal
: 2.0
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2003-10-21 18:30 UTC by Dave Neary
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gimpmisc.c (13.74 KB, text/plain)
2003-12-24 13:01 UTC, Dave Neary
  Details
gimpmisc.h (4.07 KB, text/plain)
2003-12-24 13:01 UTC, Dave Neary
  Details
curve bend (95.37 KB, text/plain)
2003-12-24 13:02 UTC, Dave Neary
  Details
displace (19.09 KB, text/plain)
2003-12-24 13:06 UTC, Dave Neary
  Details
edge (20.28 KB, text/plain)
2003-12-24 13:09 UTC, Dave Neary
  Details
gflare (132.98 KB, text/plain)
2003-12-24 13:11 UTC, Dave Neary
  Details
illusion (13.63 KB, text/plain)
2003-12-24 13:15 UTC, Dave Neary
  Details
shift (10.85 KB, text/plain)
2003-12-24 13:16 UTC, Dave Neary
  Details
diff of Maurits' changes. (16.09 KB, patch)
2003-12-25 20:36 UTC, David Odin
none Details | Review

Description Dave Neary 2003-10-21 18:30:28 UTC
libgimpmisc has helped rationalise some of the shared code in plug-ins, but
it also contains quite a few things of questionable value. 

Before 2.0, we should hide the libgimpmisc API from 3rd party plug-in
designers, and anticipate removing it completely between now and (say) 3.0. 

To do this, we need to not install it or its headers, and links statically
for the core plug-ins that use it. Since this is an API change this should
be done before the first 2.0 prerelease.

The alternative is to live with this for at least two release cycles.

Cheers,
Dave.
Comment 1 Maurits Rijk 2003-10-21 21:26:57 UTC
Afaik there is no such thing as a libgimpmisc. The code that is in the
files gimpmisc.c and gimpmiscui.c is added to the existing libraries
(libgimp and libgimpui). I do agree however that the API should not be
visisble to 3d party developers, especially since some of the code is
hopefully going to dissapear soon (like GimpFixmePreview stuff) and
for other code the API isn't stable enough. 

The alternative (the one I prefer) for static libraries is to go the
same road as GTK does for it's deprecated widgets: you disable the
stuff, unless someone explicitely wants to use it:

#undef GIMP_DISABLE_USE_AT_YOUR_OWN_RISK ;)

And of we don't have to distribute these header files.
Comment 2 Dave Neary 2003-10-24 18:10:50 UTC
Sven's comments in a mail to the list:

Someone should check what functions are in libgimpmisc.h and
libgimpmiscui.h. Everything that seems very useful and has a clean API
should be moved to a final place (and be documented). The rest of the
functions can stay. We then change the Makefile.am not to install
these headers and link the functionality directly into the plug-ins
(see how it is done for libgck). This also means that the plug-ins
using these functions will have to include the header files from the
source tree explicitely.
                                                                     
          

Comment 3 Dave Neary 2003-11-11 13:04:04 UTC
I believe that David Odin is looking into this. David, could you add a
comment here to let people know what you're doing?

Cheers,
Dave.
Comment 4 Dave Neary 2003-11-11 13:46:41 UTC
Changing subject to reflect reality.

Dave.
Comment 5 Maurits Rijk 2003-11-26 11:09:57 UTC
I'm working right now on merging the gimp_pixel_fetcher_get_pixel and
gimp_pixel_fetcher_get_pixel2 routine. This will become one routine
with the following API:

void gimp_pixel_fetcher_get_pixel (GimpPixelFetcher *pf, gint x, gint
y, guchar *pixel);

The `wrapmode' has to be set by a new function call:

void gimp_pixel_fetcher_set_wrapmode (GimpPixelFetcher *pf,
GimpPixelFetcherWrapMode wrapmode);

typedef enum (PIXEL_NONE, PIXEL_WRAP, PIXEL_SMEAR, PIXEL_BLACK}
GimpPixelFetcherWrapMode;

The default value will be PIXEL_NONE



Comment 6 Sven Neumann 2003-11-26 11:20:03 UTC
Please make sure that the enum values live in the GIMP namespace.
I would suggest to use

 GIMP_PIXEL_FETCHER_WRAP_NONE,
 GIMP_PIXEL_FETCHER_WRAP_AROUND,
 GIMP_PIXEL_FETCHER_WRAP_SMEAR,
 GIMP_PIXEL_FETCHER_WRAP_BLACK

Or perhaps rename to GimpPixelFetcherEdgeMode and go for

 GIMP_PIXEL_FETCHER_EDGE_NONE,
 GIMP_PIXEL_FETCHER_EDGE_WRAP,
 GIMP_PIXEL_FETCHER_EDGE_SMEAR,
 GIMP_PIXEL_FETCHER_EDGE_BLACK
Comment 7 Maurits Rijk 2003-11-26 20:03:12 UTC
I agree that EdgeMode is a far better name.
Comment 8 Dave Neary 2003-12-08 10:53:08 UTC
Can I get a status update on this, please? Maurits, David - what's the
state of play?

Dave.
Comment 9 Maurits Rijk 2003-12-08 16:40:57 UTC
Dave, I've made a few changes so the gimp_pixel_fetcher routines are
now as described above. I also changed the plug-ins accordingly and
will commit this stuff soon. I think the API for this set of routines
is now pretty clean so I will start to document it. 

On very short notice, however, we should go with the solution as
proposed by Sven: put this stuff asap in a libgck like library, so we
can finally get our pre-release out. Note: I haven't looked at how to
do this yet. Too busy with buying presents and writing poems for
`Sinterklaas' ;)
Comment 10 Sven Neumann 2003-12-08 17:12:02 UTC
It doesn't make any sense to do move useful routines into an internal
library only for the purpose of a pre-release. There must not be an
API change after the prerelease.

Please move the pixel fetcher routines to new files before you start
to document them. And please attach a header file for review to this
report.
Comment 11 David Odin 2003-12-10 13:26:05 UTC
I'll take care of the gimpmiscui part.

This means: <ul>
<li>remove gimp_parameter_settings_new() and fix the plug-ins which
use it.</li>
<li>remove gimp_plug_in_get_path(), and fix the plug-ins which use
it.</li>
<li>Rename gimpfixmepreview and put it in a better place, since it
looks we can keep it anyway.</li>
Comment 12 David Odin 2003-12-12 09:55:13 UTC
gimp_parameter_settings_new() has been removed (mostly by reveting the
commit that introduced it.

gimp_fixme_preview has been renamed gimp_old_preview and now live in
its own, not installed, library in /plug-ins/libgimpoldpreview.

I have yet to understand the rational behind gimp_plug_in_get_path().
To me this function is only a wrapper around gimp_gimprc_query() with
a message displayed if the path is NULL, and nothing more. I think we
should simply fix gimp_gimprc_query() so it displays the erreur
message itself and remove completly gimp_plug_in_get_path(). Anyway,
only 3 plug-ins use it for now.
Comment 13 Sven Neumann 2003-12-12 10:34:08 UTC
IMO gimprc_query() should stay as it is. It's a PDB procedure and the
C wrapper shouldn't add any functionality that is not in the PDB.
I vote for moving this code back to the 3 plug-ins that use it.

BTW: Very nice job on libgimpmisc(ui)! Your help is very much appreciated.
Comment 14 David Odin 2003-12-14 00:09:10 UTC
OK. I've done what Sven has been suggesting. So the
libgimp/gimpmiscui.[ch] files have been removed from the CVS tree.
This bug is now partly fixed.

I guess Maurits will go on with the pixel fetchers part.
Comment 15 Dave Neary 2003-12-24 12:59:28 UTC
Hi,

Maurits just sent me a mail about this - he's been very busy recently,
and was just on his way out the dorr for the holidays when he replied.
He thinks that he's more or less done, but he'd like someone else to
check over what he's done before committing.

David, do you think you could have a look? He sent me all the files he
changed (unfortunately not a diff), so I'll attach them all here.

Cheers,
Dave.
Comment 16 Dave Neary 2003-12-24 13:01:13 UTC
Created attachment 22678 [details]
gimpmisc.c
Comment 17 Dave Neary 2003-12-24 13:01:51 UTC
Created attachment 22679 [details]
gimpmisc.h
Comment 18 Dave Neary 2003-12-24 13:02:46 UTC
Created attachment 22680 [details]
curve bend
Comment 19 Dave Neary 2003-12-24 13:06:39 UTC
Created attachment 22681 [details]
displace
Comment 20 Dave Neary 2003-12-24 13:09:45 UTC
Created attachment 22682 [details]
edge
Comment 21 Dave Neary 2003-12-24 13:11:22 UTC
Created attachment 22683 [details]
gflare
Comment 22 Dave Neary 2003-12-24 13:15:20 UTC
Created attachment 22684 [details]
illusion
Comment 23 Dave Neary 2003-12-24 13:16:03 UTC
Created attachment 22685 [details]
shift
Comment 24 Dave Neary 2003-12-24 13:19:42 UTC
To sum up:

The files above were changed my Maurits in line with the comments
earlier on in the report. All that remains is to move the remaining
functions to another file with a better name.

The files changed, with their paths, are:
libgimpwidgets/gimpmisc.[ch]
plug-ins/common/curve_bend.c
plug-ins/common/displace.c
plug-ins/common/edge.c
plug-ins/common/illusion.c
plug-ins/common/shift.c
plug-ins/gflare/gflare.c

Somewhere in the middle of all that, I realised it would have been
quicker to just over-write the local files here and do a CVS diff. I'm
not sure how old Maurits' CVS sandbox is, though - there may be
conflicts to resolve in some of the plug-ins.

Cheers,
Dave.
Comment 25 Sven Neumann 2003-12-25 12:19:21 UTC
We need a diff attached to this report so it can be sanely reviewed.
If someone wants to help with this report, please create such a diff
and attach it.
Comment 26 David Odin 2003-12-25 20:36:19 UTC
Created attachment 22710 [details] [review]
diff of Maurits' changes.
Comment 27 Sven Neumann 2003-12-26 17:28:52 UTC
2003-12-26  Sven Neumann  <sven@gimp.org>
 
  * libgimp/gimpmisc.[ch]: applied a modified version of a patch
  from Maurits Rijk that cleans up the remaining API (bug #125141).
 
  * plug-ins/common/curve_bend.c
  * plug-ins/common/displace.c
  * plug-ins/common/edge.c
  * plug-ins/common/illusion.c
  * plug-ins/common/shift.c
  * plug-ins/gflare/gflare.c: changed accordingly.


This leaves the following to do:
(1) The functions should be moved to a different file.
(2) The functions must be documented using inline comments.
(3) The API reference manual needs to include the new file(s).

Bumping to 2.0 since this isn't a prerequisite for the pre-release.
Comment 28 David Odin 2004-01-12 16:40:19 UTC
libgimp/gimpmisc.[ch] have been split into 
libgimp/gimppixelfetcher.[ch] and
libgimp/gimpregioniterator.[ch].

We still need to documents all these functions.
Comment 29 Michael Natterer 2004-01-13 10:19:56 UTC
Missing documentation applies to quite a few libgimp functions.
It's a bug, but a different issue. The gimpmisc one is FIXED:

2004-01-12  DindinX  <david@dindinx.org>

	* libgimp/gimpmisc.[ch]: remove these files

	* libgimp/gimppixelfetcher.c:
	* libgimp/gimppixelfetcher.h:
	* libgimp/gimpregioniterator.c:
	* libgimp/gimpregioniterator.h: and created these ones.
	  Regarding #125141, gimpmisc was split into gimppixelfetcher and
	  gimpregioniterator.

	* libgimp/Makefile.am:
	* libgimp/gimp.h: modified accordingly.