[Gimp-developer] plug-in preview widget (another try)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

there are a couple of patches pending in Bugzilla that add previews to
some of our plug-ins. In particular these are:

 http://bugzilla.gnome.org/show_bug.cgi?id=140974
 http://bugzilla.gnome.org/show_bug.cgi?id=142318
 http://bugzilla.gnome.org/show_bug.cgi?id=142587

If you take a look at these bug-reports you will notice that there's
quite some confusion on how a preview should best be implemented. I'd
like to settle on one way before accepting these patches and I think
we need to come to a decision here soon so that more plug-ins can get
a preview added for gimp-2.2.

There seem to be a couple of options. Let me try to summarize the ones
that I see:

 -  Use GtkPreview.

    GtkPreview is declared deprecated by the GTK+ team and we will
    want to get rid of it at some point. On the other hand there isn't
    really a good reason not to use it. The API does it's job w/o and
    I never understood why it as deprecated in the first place.

 -  Use a drawing area and draw from the expose event.

    This seems to be asked too much for a plug-in developer and it
    would duplicate even more code. IMHO not an option.

 -  Use a GdkPixbuf as the pixel buffer and use a GtkImage to display it.

    The disadvantage is that the GdkPixbuf and GtkImage API are not
    too well suited for our needs. GdkPixbuf doesn't handle greyscale
    buffers and GtkImage can only display the full pixbuf. If we
    wanted to show only a region of the buffer we could work around
    this using gdk_pixbuf_new_subpixbuf() but IMHO this is becoming
    too hackish to consider it.

 -  Come up with a full-featured preview widget.

    We could use the widget that Ernst Lippe wrote but since there
    hasn't been any effort so far to discuss it's API again and to get
    it into CVS I am not sure if it makes sense to wait for this to
    happen.

 -  Come up with a simple preview widget to replace GtkPreview.

    We could add a simple GimpPreview to libgimpwidgets and try to
    design the API so that it

    o  easily replaces GtkPreview

       An API that isn't too different from the GtkPreview API would make
       it easy to port plug-ins that currently use GtkPreview to the new
       widget.

    o  allows to be turned into a full-featured preview widget later

    o  performs some very common tasks like the drawing of the
       checkerboard for the alpha channel

    So the question here is what functionality should a simple
    GimpPreview widget provide and how should the API look like?  I
    will try to come up with a more detailed proposal for a simple
    GimpPreview widget this weekend. Your feedback will help me to
    find out what we actually need.



Sven

PS: I've added Federico to the Cc: because he lately expressed
    interest in adding a preview to Unsharp Mask (w/o knowing about
    the patch in Bugzilla).

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux