Continuing the work on 
http://gui.gimp.org/index.php/Save_%2B_export_specification , here is my 
API proposal for common export dialog logic to be shared by file format 

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

This function creates a new dialog, and plug-ins then use

   GtkWidget * gimp_export_dialog_get_container (GtkWidget *dialog);

to get a vbox that the file-format specific widgets with export options 
are put it.

By getting rid of all dialogs that gimp_export_image() pops up, and by 
porting plug-ins to this new API, we have a much nicer export workflow 
already. You can try it out on the export-dialog-cleanup-tmp branch in 
GIMP git for JPEG, PNG, TIFF and BMP:


One open question is how to deal with exporting specific layers to 
files. With the removal of dialogs in gimp_export_image() one does not 
have the possibility to ignore flattening/merging the image any longer, 
so it's not possible to export a single layer to a PNG without creating 
a separate image for that layer. But on the other hand, it doesn't seem 
unreasonable to require a user to do that if he/she wants to export a 
single layer. With some effort I guess we can add common logic to the 
export dialog to deal with single-layer exports somehow.

Btw, the -tmp suffix to the git branch name is supposed to be 
interpreted as that the branch is volatile and no work should be based 
on it.

  / Martin

Gimp-developer mailing list

Reply via email to