diff --git a/ChangeLog b/ChangeLog index ec825b600b..6bb2c1d929 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Tue Oct 27 01:21:17 PST 1998 Manish Singh + + * app/indexed_palette.c: applied gimp-ruth-981025-0, cosmetic fix + for indexed palette dialog + + * app/fileops.[ch] + * app/gimage.h + * app/gimpimage.[ch] + * app/gimpimageP.h: applied gimp-ruth-981025-1, remember LAST_VALS + for image save + Sun Oct 25 18:59:56 CET 1998 Marc Lehmann * configure.in: changed order in library search path diff --git a/app/core/gimpimage-guides.c b/app/core/gimpimage-guides.c index f8780ee8d6..cff5ba82ee 100644 --- a/app/core/gimpimage-guides.c +++ b/app/core/gimpimage-guides.c @@ -155,6 +155,7 @@ static void gimp_image_init (GimpImage *gimage) gimage->parasites = NULL; gimp_matrix_identity(gimage->transform); gimage->resolution = 72.0; /* maybe should be rc-supplied default? */ + gimage->save_proc= NULL; } GtkType gimp_image_get_type(void){ @@ -304,13 +305,23 @@ gimp_image_set_resolution (GimpImage *gimage, float resolution) gimage->resolution = resolution; } - float gimp_image_get_resolution (GimpImage *gimage) { return gimage->resolution; } +void +gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc) +{ + gimage->save_proc = proc; +} + +PlugInProcDef * +gimp_image_get_save_proc (GimpImage *gimage) +{ + return gimage->save_proc; +} void gimp_image_resize (GimpImage *gimage, int new_width, int new_height, diff --git a/app/core/gimpimage-guides.h b/app/core/gimpimage-guides.h index 7210c26ceb..ab6b1fba90 100644 --- a/app/core/gimpimage-guides.h +++ b/app/core/gimpimage-guides.h @@ -9,6 +9,7 @@ #include "channel.h" #include "layer.h" #include +#include "plug_in.h" #include "temp_buf.h" #include "tile_manager.h" @@ -105,6 +106,8 @@ GimpImage * gimp_image_new (int, int, int); void gimp_image_set_filename (GimpImage *, char *); void gimp_image_set_resolution (GimpImage *, float); float gimp_image_get_resolution (GimpImage *); +void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *); +PlugInProcDef * gimp_image_get_save_proc (GimpImage *); void gimp_image_resize (GimpImage *, int, int, int, int); void gimp_image_scale (GimpImage *, int, int); GimpImage * gimp_image_get_named (char *); diff --git a/app/core/gimpimage-merge.c b/app/core/gimpimage-merge.c index f8780ee8d6..cff5ba82ee 100644 --- a/app/core/gimpimage-merge.c +++ b/app/core/gimpimage-merge.c @@ -155,6 +155,7 @@ static void gimp_image_init (GimpImage *gimage) gimage->parasites = NULL; gimp_matrix_identity(gimage->transform); gimage->resolution = 72.0; /* maybe should be rc-supplied default? */ + gimage->save_proc= NULL; } GtkType gimp_image_get_type(void){ @@ -304,13 +305,23 @@ gimp_image_set_resolution (GimpImage *gimage, float resolution) gimage->resolution = resolution; } - float gimp_image_get_resolution (GimpImage *gimage) { return gimage->resolution; } +void +gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc) +{ + gimage->save_proc = proc; +} + +PlugInProcDef * +gimp_image_get_save_proc (GimpImage *gimage) +{ + return gimage->save_proc; +} void gimp_image_resize (GimpImage *gimage, int new_width, int new_height, diff --git a/app/core/gimpimage-merge.h b/app/core/gimpimage-merge.h index 7210c26ceb..ab6b1fba90 100644 --- a/app/core/gimpimage-merge.h +++ b/app/core/gimpimage-merge.h @@ -9,6 +9,7 @@ #include "channel.h" #include "layer.h" #include +#include "plug_in.h" #include "temp_buf.h" #include "tile_manager.h" @@ -105,6 +106,8 @@ GimpImage * gimp_image_new (int, int, int); void gimp_image_set_filename (GimpImage *, char *); void gimp_image_set_resolution (GimpImage *, float); float gimp_image_get_resolution (GimpImage *); +void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *); +PlugInProcDef * gimp_image_get_save_proc (GimpImage *); void gimp_image_resize (GimpImage *, int, int, int, int); void gimp_image_scale (GimpImage *, int, int); GimpImage * gimp_image_get_named (char *); diff --git a/app/core/gimpimage-projection.c b/app/core/gimpimage-projection.c index f8780ee8d6..cff5ba82ee 100644 --- a/app/core/gimpimage-projection.c +++ b/app/core/gimpimage-projection.c @@ -155,6 +155,7 @@ static void gimp_image_init (GimpImage *gimage) gimage->parasites = NULL; gimp_matrix_identity(gimage->transform); gimage->resolution = 72.0; /* maybe should be rc-supplied default? */ + gimage->save_proc= NULL; } GtkType gimp_image_get_type(void){ @@ -304,13 +305,23 @@ gimp_image_set_resolution (GimpImage *gimage, float resolution) gimage->resolution = resolution; } - float gimp_image_get_resolution (GimpImage *gimage) { return gimage->resolution; } +void +gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc) +{ + gimage->save_proc = proc; +} + +PlugInProcDef * +gimp_image_get_save_proc (GimpImage *gimage) +{ + return gimage->save_proc; +} void gimp_image_resize (GimpImage *gimage, int new_width, int new_height, diff --git a/app/core/gimpimage-projection.h b/app/core/gimpimage-projection.h index 7210c26ceb..ab6b1fba90 100644 --- a/app/core/gimpimage-projection.h +++ b/app/core/gimpimage-projection.h @@ -9,6 +9,7 @@ #include "channel.h" #include "layer.h" #include +#include "plug_in.h" #include "temp_buf.h" #include "tile_manager.h" @@ -105,6 +106,8 @@ GimpImage * gimp_image_new (int, int, int); void gimp_image_set_filename (GimpImage *, char *); void gimp_image_set_resolution (GimpImage *, float); float gimp_image_get_resolution (GimpImage *); +void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *); +PlugInProcDef * gimp_image_get_save_proc (GimpImage *); void gimp_image_resize (GimpImage *, int, int, int, int); void gimp_image_scale (GimpImage *, int, int); GimpImage * gimp_image_get_named (char *); diff --git a/app/core/gimpimage-resize.c b/app/core/gimpimage-resize.c index f8780ee8d6..cff5ba82ee 100644 --- a/app/core/gimpimage-resize.c +++ b/app/core/gimpimage-resize.c @@ -155,6 +155,7 @@ static void gimp_image_init (GimpImage *gimage) gimage->parasites = NULL; gimp_matrix_identity(gimage->transform); gimage->resolution = 72.0; /* maybe should be rc-supplied default? */ + gimage->save_proc= NULL; } GtkType gimp_image_get_type(void){ @@ -304,13 +305,23 @@ gimp_image_set_resolution (GimpImage *gimage, float resolution) gimage->resolution = resolution; } - float gimp_image_get_resolution (GimpImage *gimage) { return gimage->resolution; } +void +gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc) +{ + gimage->save_proc = proc; +} + +PlugInProcDef * +gimp_image_get_save_proc (GimpImage *gimage) +{ + return gimage->save_proc; +} void gimp_image_resize (GimpImage *gimage, int new_width, int new_height, diff --git a/app/core/gimpimage-resize.h b/app/core/gimpimage-resize.h index 7210c26ceb..ab6b1fba90 100644 --- a/app/core/gimpimage-resize.h +++ b/app/core/gimpimage-resize.h @@ -9,6 +9,7 @@ #include "channel.h" #include "layer.h" #include +#include "plug_in.h" #include "temp_buf.h" #include "tile_manager.h" @@ -105,6 +106,8 @@ GimpImage * gimp_image_new (int, int, int); void gimp_image_set_filename (GimpImage *, char *); void gimp_image_set_resolution (GimpImage *, float); float gimp_image_get_resolution (GimpImage *); +void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *); +PlugInProcDef * gimp_image_get_save_proc (GimpImage *); void gimp_image_resize (GimpImage *, int, int, int, int); void gimp_image_scale (GimpImage *, int, int); GimpImage * gimp_image_get_named (char *); diff --git a/app/core/gimpimage-scale.c b/app/core/gimpimage-scale.c index f8780ee8d6..cff5ba82ee 100644 --- a/app/core/gimpimage-scale.c +++ b/app/core/gimpimage-scale.c @@ -155,6 +155,7 @@ static void gimp_image_init (GimpImage *gimage) gimage->parasites = NULL; gimp_matrix_identity(gimage->transform); gimage->resolution = 72.0; /* maybe should be rc-supplied default? */ + gimage->save_proc= NULL; } GtkType gimp_image_get_type(void){ @@ -304,13 +305,23 @@ gimp_image_set_resolution (GimpImage *gimage, float resolution) gimage->resolution = resolution; } - float gimp_image_get_resolution (GimpImage *gimage) { return gimage->resolution; } +void +gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc) +{ + gimage->save_proc = proc; +} + +PlugInProcDef * +gimp_image_get_save_proc (GimpImage *gimage) +{ + return gimage->save_proc; +} void gimp_image_resize (GimpImage *gimage, int new_width, int new_height, diff --git a/app/core/gimpimage-scale.h b/app/core/gimpimage-scale.h index 7210c26ceb..ab6b1fba90 100644 --- a/app/core/gimpimage-scale.h +++ b/app/core/gimpimage-scale.h @@ -9,6 +9,7 @@ #include "channel.h" #include "layer.h" #include +#include "plug_in.h" #include "temp_buf.h" #include "tile_manager.h" @@ -105,6 +106,8 @@ GimpImage * gimp_image_new (int, int, int); void gimp_image_set_filename (GimpImage *, char *); void gimp_image_set_resolution (GimpImage *, float); float gimp_image_get_resolution (GimpImage *); +void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *); +PlugInProcDef * gimp_image_get_save_proc (GimpImage *); void gimp_image_resize (GimpImage *, int, int, int, int); void gimp_image_scale (GimpImage *, int, int); GimpImage * gimp_image_get_named (char *); diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c index f8780ee8d6..cff5ba82ee 100644 --- a/app/core/gimpimage.c +++ b/app/core/gimpimage.c @@ -155,6 +155,7 @@ static void gimp_image_init (GimpImage *gimage) gimage->parasites = NULL; gimp_matrix_identity(gimage->transform); gimage->resolution = 72.0; /* maybe should be rc-supplied default? */ + gimage->save_proc= NULL; } GtkType gimp_image_get_type(void){ @@ -304,13 +305,23 @@ gimp_image_set_resolution (GimpImage *gimage, float resolution) gimage->resolution = resolution; } - float gimp_image_get_resolution (GimpImage *gimage) { return gimage->resolution; } +void +gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc) +{ + gimage->save_proc = proc; +} + +PlugInProcDef * +gimp_image_get_save_proc (GimpImage *gimage) +{ + return gimage->save_proc; +} void gimp_image_resize (GimpImage *gimage, int new_width, int new_height, diff --git a/app/core/gimpimage.h b/app/core/gimpimage.h index 7210c26ceb..ab6b1fba90 100644 --- a/app/core/gimpimage.h +++ b/app/core/gimpimage.h @@ -9,6 +9,7 @@ #include "channel.h" #include "layer.h" #include +#include "plug_in.h" #include "temp_buf.h" #include "tile_manager.h" @@ -105,6 +106,8 @@ GimpImage * gimp_image_new (int, int, int); void gimp_image_set_filename (GimpImage *, char *); void gimp_image_set_resolution (GimpImage *, float); float gimp_image_get_resolution (GimpImage *); +void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *); +PlugInProcDef * gimp_image_get_save_proc (GimpImage *); void gimp_image_resize (GimpImage *, int, int, int, int); void gimp_image_scale (GimpImage *, int, int); GimpImage * gimp_image_get_named (char *); diff --git a/app/core/gimpprojection-construct.c b/app/core/gimpprojection-construct.c index f8780ee8d6..cff5ba82ee 100644 --- a/app/core/gimpprojection-construct.c +++ b/app/core/gimpprojection-construct.c @@ -155,6 +155,7 @@ static void gimp_image_init (GimpImage *gimage) gimage->parasites = NULL; gimp_matrix_identity(gimage->transform); gimage->resolution = 72.0; /* maybe should be rc-supplied default? */ + gimage->save_proc= NULL; } GtkType gimp_image_get_type(void){ @@ -304,13 +305,23 @@ gimp_image_set_resolution (GimpImage *gimage, float resolution) gimage->resolution = resolution; } - float gimp_image_get_resolution (GimpImage *gimage) { return gimage->resolution; } +void +gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc) +{ + gimage->save_proc = proc; +} + +PlugInProcDef * +gimp_image_get_save_proc (GimpImage *gimage) +{ + return gimage->save_proc; +} void gimp_image_resize (GimpImage *gimage, int new_width, int new_height, diff --git a/app/core/gimpprojection-construct.h b/app/core/gimpprojection-construct.h index 7210c26ceb..ab6b1fba90 100644 --- a/app/core/gimpprojection-construct.h +++ b/app/core/gimpprojection-construct.h @@ -9,6 +9,7 @@ #include "channel.h" #include "layer.h" #include +#include "plug_in.h" #include "temp_buf.h" #include "tile_manager.h" @@ -105,6 +106,8 @@ GimpImage * gimp_image_new (int, int, int); void gimp_image_set_filename (GimpImage *, char *); void gimp_image_set_resolution (GimpImage *, float); float gimp_image_get_resolution (GimpImage *); +void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *); +PlugInProcDef * gimp_image_get_save_proc (GimpImage *); void gimp_image_resize (GimpImage *, int, int, int, int); void gimp_image_scale (GimpImage *, int, int); GimpImage * gimp_image_get_named (char *); diff --git a/app/fileops.c b/app/fileops.c index 731c044a1a..04300340f2 100644 --- a/app/fileops.c +++ b/app/fileops.c @@ -565,7 +565,7 @@ file_save_callback (GtkWidget *w, } else file_save (gdisplay->gimage, gimage_filename (gdisplay->gimage), - prune_filename (gimage_filename(gdisplay->gimage))); + prune_filename (gimage_filename(gdisplay->gimage)), 2); } } @@ -774,7 +774,8 @@ file_open (char *filename, char* raw_filename) int file_save (GimpImage* gimage, char *filename, - char *raw_filename) + char *raw_filename, + gint mode) { PlugInProcDef *file_proc; ProcRecord *proc; @@ -786,7 +787,8 @@ file_save (GimpImage* gimage, if (gimage_active_drawable (gimage) == NULL) return FALSE; - file_proc = save_file_proc; + file_proc = gimage_get_save_proc(gimage); + if (!file_proc) file_proc = file_proc_find (save_procs, raw_filename); @@ -801,7 +803,7 @@ file_save (GimpImage* gimage, for (i = 0; i < proc->num_args; i++) args[i].arg_type = proc->args[i].arg_type; - args[0].value.pdb_int = 0; + args[0].value.pdb_int = mode; args[1].value.pdb_int = pdb_image_to_id(gimage); args[2].value.pdb_int = drawable_ID (gimage_active_drawable (gimage)); args[3].value.pdb_pointer = filename; @@ -821,6 +823,9 @@ file_save (GimpImage* gimage, /* set the image title */ gimp_image_set_filename (gimage, filename); + + /* use the same plug-in for this image next time */ + gimage_set_save_proc(gimage, file_proc); } g_free (return_vals); @@ -1035,7 +1040,9 @@ file_save_ok_callback (GtkWidget *w, } } else { gtk_widget_set_sensitive (GTK_WIDGET (fs), FALSE); - if (file_save (the_gimage, filename, raw_filename)) + + gimage_set_save_proc(the_gimage, save_file_proc); + if (file_save (the_gimage, filename, raw_filename, 0)) { file_dialog_hide (client_data); gtk_widget_set_sensitive (GTK_WIDGET (fs), TRUE); @@ -1136,7 +1143,7 @@ file_overwrite_yes_callback (GtkWidget *w, gtk_widget_destroy (overwrite_box->obox); if ((gimage = the_gimage) != NULL && - file_save (the_gimage, overwrite_box->full_filename, overwrite_box->raw_filename)) + file_save (the_gimage, overwrite_box->full_filename, overwrite_box->raw_filename, 0)) { the_gimage = NULL; file_dialog_hide (filesave); diff --git a/app/fileops.h b/app/fileops.h index 7d28b62aa4..3d6f240a19 100644 --- a/app/fileops.h +++ b/app/fileops.h @@ -40,7 +40,8 @@ int file_open (char *filename, char *raw_filename); int file_save (GimpImage* gimage, char *filename, - char *raw_filename); + char *raw_filename, + gint mode); #endif /* FILE_IO_H */ diff --git a/app/gimage.h b/app/gimage.h index 6d9becdd0f..ca9b82b1cf 100644 --- a/app/gimage.h +++ b/app/gimage.h @@ -52,6 +52,8 @@ gimage_foreach (GFunc func, gpointer user_data); #define gimage_set_filename gimp_image_set_filename #define gimage_set_resolution gimp_image_set_resolution #define gimage_get_resolution gimp_image_get_resolution +#define gimage_set_save_proc gimp_image_set_save_proc +#define gimage_get_save_proc gimp_image_get_save_proc #define gimage_resize gimp_image_resize #define gimage_scale gimp_image_scale #define gimage_shadow gimp_image_shadow diff --git a/app/gimpimage.c b/app/gimpimage.c index f8780ee8d6..cff5ba82ee 100644 --- a/app/gimpimage.c +++ b/app/gimpimage.c @@ -155,6 +155,7 @@ static void gimp_image_init (GimpImage *gimage) gimage->parasites = NULL; gimp_matrix_identity(gimage->transform); gimage->resolution = 72.0; /* maybe should be rc-supplied default? */ + gimage->save_proc= NULL; } GtkType gimp_image_get_type(void){ @@ -304,13 +305,23 @@ gimp_image_set_resolution (GimpImage *gimage, float resolution) gimage->resolution = resolution; } - float gimp_image_get_resolution (GimpImage *gimage) { return gimage->resolution; } +void +gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc) +{ + gimage->save_proc = proc; +} + +PlugInProcDef * +gimp_image_get_save_proc (GimpImage *gimage) +{ + return gimage->save_proc; +} void gimp_image_resize (GimpImage *gimage, int new_width, int new_height, diff --git a/app/gimpimage.h b/app/gimpimage.h index 7210c26ceb..ab6b1fba90 100644 --- a/app/gimpimage.h +++ b/app/gimpimage.h @@ -9,6 +9,7 @@ #include "channel.h" #include "layer.h" #include +#include "plug_in.h" #include "temp_buf.h" #include "tile_manager.h" @@ -105,6 +106,8 @@ GimpImage * gimp_image_new (int, int, int); void gimp_image_set_filename (GimpImage *, char *); void gimp_image_set_resolution (GimpImage *, float); float gimp_image_get_resolution (GimpImage *); +void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *); +PlugInProcDef * gimp_image_get_save_proc (GimpImage *); void gimp_image_resize (GimpImage *, int, int, int, int); void gimp_image_scale (GimpImage *, int, int); GimpImage * gimp_image_get_named (char *); diff --git a/app/gimpimageP.h b/app/gimpimageP.h index 092838a847..af86f6f03c 100644 --- a/app/gimpimageP.h +++ b/app/gimpimageP.h @@ -18,6 +18,7 @@ struct _GimpImage GimpObject gobject; char *filename; /* original filename */ int has_filename; /* has a valid filename */ + PlugInProcDef *save_proc; /* last PDB save proc used */ int width, height; /* width and height attributes */ float resolution; /* image res, in dpi */ diff --git a/app/indexed_palette.c b/app/indexed_palette.c index f61a67cbea..67e1a3c778 100644 --- a/app/indexed_palette.c +++ b/app/indexed_palette.c @@ -494,7 +494,8 @@ create_image_menu_cb (gpointer im, gpointer d) image_name = prune_filename (gimage_filename (gimage)); menu_item_label = (char *) g_malloc (strlen (image_name) + 15); - sprintf (menu_item_label, "%s-%p", image_name, gimage); + sprintf (menu_item_label, "%s-%d", image_name, + pdb_image_to_id (gimage)); menu_item = gtk_menu_item_new_with_label (menu_item_label); gtk_signal_connect (GTK_OBJECT (menu_item), "activate", (GtkSignalFunc) data->callback,