On 07/15/2009 12:20 AM, Sven Neumann wrote:
> Hi,
> On Tue, 2009-07-14 at 22:59 +0200, Martin Nordholts wrote:
>> Exactly how will it break existing plug-ins? It will just be changed to
>> act as if the user clicked the Export button. Take a look at the code on
>> the branch and you'll see what I mean
> There are questions to ask the user and we can't just start to skip
> these questions. Third-party plug-ins that use the gimp_export_image()
> function should continue to behave exactly as they behave now.


Let us then add the following function to libgimp

   gimp_export_prepare_image (gint32                 *image_ID,
                              gint32                 *drawable_ID,
                              GimpExportCapabilities  capabilities);

that shares the implementation and semantics with gimp_export_image() 
except that it doesn't show any dialogs, it just goes ahead and creates 
a merged copy of the image if needed. By sharing the implementation with 
gimp_export_image() we can use well-tested code and it becomes easy to 
port plug-ins to the new API.

Regarding changing gimp_export_dialog_get_container() into having 
semantics similar to gtk_container_add(), I fear that we will have to 
duplicate too much of the API. If we provide _add() we need to wrap 
_remove() and so on. Instead of doing that I propose a name change to

   GtkWidget *
   gimp_export_dialog_get_vbox (GtkWidget *dialog);

Again, this API has the benefit of making porting plug-ins easy. For 
completeness, here is the third function in the new export API, 
unchanged from before:

   GtkWidget *
   gimp_export_dialog_new (const gchar *format_name,
                           const gchar *role,
                           const gchar *help_id);

For people with time to look at code, the git branch is updated (rewritten):

Gimp-developer mailing list

Reply via email to