Commit fc491e5f authored by Manish Singh's avatar Manish Singh

applied gimp-ruth-981025-0, cosmetic fix for indexed palette dialog

* 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

-Yosh
parent d86fa542
Tue Oct 27 01:21:17 PST 1998 Manish Singh <yosh@gimp.org>
* 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 <pcg@goof.com>
* configure.in: changed order in library search path
......
......@@ -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,
......
......@@ -9,6 +9,7 @@
#include "channel.h"
#include "layer.h"
#include <libgimp/parasiteF.h>
#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 *);
......
......@@ -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,
......
......@@ -9,6 +9,7 @@
#include "channel.h"
#include "layer.h"
#include <libgimp/parasiteF.h>
#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 *);
......
......@@ -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,
......
......@@ -9,6 +9,7 @@
#include "channel.h"
#include "layer.h"
#include <libgimp/parasiteF.h>
#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 *);
......
......@@ -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,
......
......@@ -9,6 +9,7 @@
#include "channel.h"
#include "layer.h"
#include <libgimp/parasiteF.h>
#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 *);
......
......@@ -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,
......
......@@ -9,6 +9,7 @@
#include "channel.h"
#include "layer.h"
#include <libgimp/parasiteF.h>
#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 *);
......
......@@ -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,
......
......@@ -9,6 +9,7 @@
#include "channel.h"
#include "layer.h"
#include <libgimp/parasiteF.h>
#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 *);
......
......@@ -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,
......
......@@ -9,6 +9,7 @@
#include "channel.h"
#include "layer.h"
#include <libgimp/parasiteF.h>
#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 *);
......
......@@ -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);
......
......@@ -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 */
......@@ -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
......
......@@ -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,
......
......@@ -9,6 +9,7 @@
#include "channel.h"
#include "layer.h"
#include <libgimp/parasiteF.h>
#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 *);
......
......@@ -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 */
......
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment