Commit 9ccab852 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

app/commands.[ch] app/fileops.[ch] app/gdisplay.c Implemented "Save a Copy

2001-01-02  Michael Natterer  <mitch@gimp.org>

	* app/commands.[ch]
	* app/fileops.[ch]
	* app/gdisplay.c
	* app/menus.c: Implemented "Save a Copy as..." which saves the image
	without changing it's filename.

	* app/layers_dialogP.h: export layers_dialog_layer_merge_query()
	here instead of defining it in commands.c

	* TODO.xml: mark this entry as done :)
parent 6684bb77
2001-01-02 Michael Natterer <mitch@gimp.org>
* app/commands.[ch]
* app/fileops.[ch]
* app/gdisplay.c
* app/menus.c: Implemented "Save a Copy as..." which saves the image
without changing it's filename.
* app/layers_dialogP.h: export layers_dialog_layer_merge_query()
here instead of defining it in commands.c
* TODO.xml: mark this entry as done :)
2001-01-01 Michael Natterer <mitch@gimp.org>
* TODO.xml: added a TODO item for "Save a Copy..."
......
......@@ -235,7 +235,7 @@
</contact>
</entry>
<entry size="small" difficulty="easy" status="0%" target="1.4">
<entry size="small" difficulty="easy" status="100%" target="1.4">
<title>Implement "Save a Copy..."</title>
<description>
<p>
......
......@@ -59,6 +59,7 @@
#include "invert.h"
#include "lc_dialog.h"
#include "layer_select.h"
#include "layers_dialogP.h"
#include "module_db.h"
#include "palette.h"
#include "pattern_select.h"
......@@ -84,20 +85,29 @@
gdisp = gdisplay_active (); \
if (!gdisp) return
/* external functions */
extern void layers_dialog_layer_merge_query (GImage *, gboolean);
/* local functions */
static void image_resize_callback (GtkWidget *, gpointer);
static void image_scale_callback (GtkWidget *, gpointer);
static void gimage_mask_feather_callback (GtkWidget *, gdouble, GimpUnit,
gpointer);
static void gimage_mask_border_callback (GtkWidget *, gdouble, GimpUnit,
gpointer);
static void gimage_mask_grow_callback (GtkWidget *, gdouble, GimpUnit,
gpointer);
static void gimage_mask_shrink_callback (GtkWidget *, gdouble, GimpUnit,
gpointer);
static void image_resize_callback (GtkWidget *,
gpointer );
static void image_scale_callback (GtkWidget *,
gpointer );
static void gimage_mask_feather_callback (GtkWidget *,
gdouble ,
GimpUnit ,
gpointer );
static void gimage_mask_border_callback (GtkWidget *,
gdouble ,
GimpUnit ,
gpointer );
static void gimage_mask_grow_callback (GtkWidget *,
gdouble ,
GimpUnit ,
gpointer );
static void gimage_mask_shrink_callback (GtkWidget *,
gdouble ,
GimpUnit ,
gpointer );
/* local variables */
static gdouble selection_feather_radius = 5.0;
......@@ -130,6 +140,13 @@ file_save_as_cmd_callback (GtkWidget *widget,
file_save_as_callback (widget, client_data);
}
void
file_save_a_copy_as_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
file_save_a_copy_as_callback (widget, client_data);
}
void
file_revert_cmd_callback (GtkWidget *widget,
gpointer client_data)
......
......@@ -20,14 +20,15 @@
#define __COMMANDS_H__
void file_new_cmd_callback (GtkWidget *, gpointer, guint);
void file_open_cmd_callback (GtkWidget *, gpointer);
void file_save_cmd_callback (GtkWidget *, gpointer);
void file_save_as_cmd_callback (GtkWidget *, gpointer);
void file_revert_cmd_callback (GtkWidget *, gpointer);
void file_pref_cmd_callback (GtkWidget *, gpointer);
void file_close_cmd_callback (GtkWidget *, gpointer);
void file_quit_cmd_callback (GtkWidget *, gpointer);
void file_new_cmd_callback (GtkWidget *, gpointer, guint);
void file_open_cmd_callback (GtkWidget *, gpointer);
void file_save_cmd_callback (GtkWidget *, gpointer);
void file_save_as_cmd_callback (GtkWidget *, gpointer);
void file_save_a_copy_as_cmd_callback (GtkWidget *, gpointer);
void file_revert_cmd_callback (GtkWidget *, gpointer);
void file_pref_cmd_callback (GtkWidget *, gpointer);
void file_close_cmd_callback (GtkWidget *, gpointer);
void file_quit_cmd_callback (GtkWidget *, gpointer);
void edit_undo_cmd_callback (GtkWidget *, gpointer);
void edit_redo_cmd_callback (GtkWidget *, gpointer);
......
......@@ -59,6 +59,7 @@
#include "invert.h"
#include "lc_dialog.h"
#include "layer_select.h"
#include "layers_dialogP.h"
#include "module_db.h"
#include "palette.h"
#include "pattern_select.h"
......@@ -84,20 +85,29 @@
gdisp = gdisplay_active (); \
if (!gdisp) return
/* external functions */
extern void layers_dialog_layer_merge_query (GImage *, gboolean);
/* local functions */
static void image_resize_callback (GtkWidget *, gpointer);
static void image_scale_callback (GtkWidget *, gpointer);
static void gimage_mask_feather_callback (GtkWidget *, gdouble, GimpUnit,
gpointer);
static void gimage_mask_border_callback (GtkWidget *, gdouble, GimpUnit,
gpointer);
static void gimage_mask_grow_callback (GtkWidget *, gdouble, GimpUnit,
gpointer);
static void gimage_mask_shrink_callback (GtkWidget *, gdouble, GimpUnit,
gpointer);
static void image_resize_callback (GtkWidget *,
gpointer );
static void image_scale_callback (GtkWidget *,
gpointer );
static void gimage_mask_feather_callback (GtkWidget *,
gdouble ,
GimpUnit ,
gpointer );
static void gimage_mask_border_callback (GtkWidget *,
gdouble ,
GimpUnit ,
gpointer );
static void gimage_mask_grow_callback (GtkWidget *,
gdouble ,
GimpUnit ,
gpointer );
static void gimage_mask_shrink_callback (GtkWidget *,
gdouble ,
GimpUnit ,
gpointer );
/* local variables */
static gdouble selection_feather_radius = 5.0;
......@@ -130,6 +140,13 @@ file_save_as_cmd_callback (GtkWidget *widget,
file_save_as_callback (widget, client_data);
}
void
file_save_a_copy_as_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
file_save_a_copy_as_callback (widget, client_data);
}
void
file_revert_cmd_callback (GtkWidget *widget,
gpointer client_data)
......
......@@ -20,14 +20,15 @@
#define __COMMANDS_H__
void file_new_cmd_callback (GtkWidget *, gpointer, guint);
void file_open_cmd_callback (GtkWidget *, gpointer);
void file_save_cmd_callback (GtkWidget *, gpointer);
void file_save_as_cmd_callback (GtkWidget *, gpointer);
void file_revert_cmd_callback (GtkWidget *, gpointer);
void file_pref_cmd_callback (GtkWidget *, gpointer);
void file_close_cmd_callback (GtkWidget *, gpointer);
void file_quit_cmd_callback (GtkWidget *, gpointer);
void file_new_cmd_callback (GtkWidget *, gpointer, guint);
void file_open_cmd_callback (GtkWidget *, gpointer);
void file_save_cmd_callback (GtkWidget *, gpointer);
void file_save_as_cmd_callback (GtkWidget *, gpointer);
void file_save_a_copy_as_cmd_callback (GtkWidget *, gpointer);
void file_revert_cmd_callback (GtkWidget *, gpointer);
void file_pref_cmd_callback (GtkWidget *, gpointer);
void file_close_cmd_callback (GtkWidget *, gpointer);
void file_quit_cmd_callback (GtkWidget *, gpointer);
void edit_undo_cmd_callback (GtkWidget *, gpointer);
void edit_redo_cmd_callback (GtkWidget *, gpointer);
......
......@@ -1777,7 +1777,8 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp)
menus_set_state ("<Image>/" menu, (condition) != 0)
SET_SENSITIVE ("File/Save", gdisp && drawable);
SET_SENSITIVE ("File/Save As...", gdisp && drawable);
SET_SENSITIVE ("File/Save as...", gdisp && drawable);
SET_SENSITIVE ("File/Save a Copy as...", gdisp && drawable);
SET_SENSITIVE ("File/Revert...", gdisp && gdisp->gimage->filename);
SET_SENSITIVE ("File/Close", gdisp);
......
......@@ -1777,7 +1777,8 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp)
menus_set_state ("<Image>/" menu, (condition) != 0)
SET_SENSITIVE ("File/Save", gdisp && drawable);
SET_SENSITIVE ("File/Save As...", gdisp && drawable);
SET_SENSITIVE ("File/Save as...", gdisp && drawable);
SET_SENSITIVE ("File/Save a Copy as...", gdisp && drawable);
SET_SENSITIVE ("File/Revert...", gdisp && gdisp->gimage->filename);
SET_SENSITIVE ("File/Close", gdisp);
......
This diff is collapsed.
......@@ -34,6 +34,8 @@ void file_save_callback (GtkWidget *widget,
gpointer data);
void file_save_as_callback (GtkWidget *widget,
gpointer data);
void file_save_a_copy_as_callback (GtkWidget *widget,
gpointer data);
void file_revert_callback (GtkWidget *widget,
gpointer data);
......
......@@ -1777,7 +1777,8 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp)
menus_set_state ("<Image>/" menu, (condition) != 0)
SET_SENSITIVE ("File/Save", gdisp && drawable);
SET_SENSITIVE ("File/Save As...", gdisp && drawable);
SET_SENSITIVE ("File/Save as...", gdisp && drawable);
SET_SENSITIVE ("File/Save a Copy as...", gdisp && drawable);
SET_SENSITIVE ("File/Revert...", gdisp && gdisp->gimage->filename);
SET_SENSITIVE ("File/Close", gdisp);
......
......@@ -59,6 +59,7 @@
#include "invert.h"
#include "lc_dialog.h"
#include "layer_select.h"
#include "layers_dialogP.h"
#include "module_db.h"
#include "palette.h"
#include "pattern_select.h"
......@@ -84,20 +85,29 @@
gdisp = gdisplay_active (); \
if (!gdisp) return
/* external functions */
extern void layers_dialog_layer_merge_query (GImage *, gboolean);
/* local functions */
static void image_resize_callback (GtkWidget *, gpointer);
static void image_scale_callback (GtkWidget *, gpointer);
static void gimage_mask_feather_callback (GtkWidget *, gdouble, GimpUnit,
gpointer);
static void gimage_mask_border_callback (GtkWidget *, gdouble, GimpUnit,
gpointer);
static void gimage_mask_grow_callback (GtkWidget *, gdouble, GimpUnit,
gpointer);
static void gimage_mask_shrink_callback (GtkWidget *, gdouble, GimpUnit,
gpointer);
static void image_resize_callback (GtkWidget *,
gpointer );
static void image_scale_callback (GtkWidget *,
gpointer );
static void gimage_mask_feather_callback (GtkWidget *,
gdouble ,
GimpUnit ,
gpointer );
static void gimage_mask_border_callback (GtkWidget *,
gdouble ,
GimpUnit ,
gpointer );
static void gimage_mask_grow_callback (GtkWidget *,
gdouble ,
GimpUnit ,
gpointer );
static void gimage_mask_shrink_callback (GtkWidget *,
gdouble ,
GimpUnit ,
gpointer );
/* local variables */
static gdouble selection_feather_radius = 5.0;
......@@ -130,6 +140,13 @@ file_save_as_cmd_callback (GtkWidget *widget,
file_save_as_callback (widget, client_data);
}
void
file_save_a_copy_as_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
file_save_a_copy_as_callback (widget, client_data);
}
void
file_revert_cmd_callback (GtkWidget *widget,
gpointer client_data)
......
......@@ -20,14 +20,15 @@
#define __COMMANDS_H__
void file_new_cmd_callback (GtkWidget *, gpointer, guint);
void file_open_cmd_callback (GtkWidget *, gpointer);
void file_save_cmd_callback (GtkWidget *, gpointer);
void file_save_as_cmd_callback (GtkWidget *, gpointer);
void file_revert_cmd_callback (GtkWidget *, gpointer);
void file_pref_cmd_callback (GtkWidget *, gpointer);
void file_close_cmd_callback (GtkWidget *, gpointer);
void file_quit_cmd_callback (GtkWidget *, gpointer);
void file_new_cmd_callback (GtkWidget *, gpointer, guint);
void file_open_cmd_callback (GtkWidget *, gpointer);
void file_save_cmd_callback (GtkWidget *, gpointer);
void file_save_as_cmd_callback (GtkWidget *, gpointer);
void file_save_a_copy_as_cmd_callback (GtkWidget *, gpointer);
void file_revert_cmd_callback (GtkWidget *, gpointer);
void file_pref_cmd_callback (GtkWidget *, gpointer);
void file_close_cmd_callback (GtkWidget *, gpointer);
void file_quit_cmd_callback (GtkWidget *, gpointer);
void edit_undo_cmd_callback (GtkWidget *, gpointer);
void edit_redo_cmd_callback (GtkWidget *, gpointer);
......
......@@ -59,6 +59,7 @@
#include "invert.h"
#include "lc_dialog.h"
#include "layer_select.h"
#include "layers_dialogP.h"
#include "module_db.h"
#include "palette.h"
#include "pattern_select.h"
......@@ -84,20 +85,29 @@
gdisp = gdisplay_active (); \
if (!gdisp) return
/* external functions */
extern void layers_dialog_layer_merge_query (GImage *, gboolean);
/* local functions */
static void image_resize_callback (GtkWidget *, gpointer);
static void image_scale_callback (GtkWidget *, gpointer);
static void gimage_mask_feather_callback (GtkWidget *, gdouble, GimpUnit,
gpointer);
static void gimage_mask_border_callback (GtkWidget *, gdouble, GimpUnit,
gpointer);
static void gimage_mask_grow_callback (GtkWidget *, gdouble, GimpUnit,
gpointer);
static void gimage_mask_shrink_callback (GtkWidget *, gdouble, GimpUnit,
gpointer);
static void image_resize_callback (GtkWidget *,
gpointer );
static void image_scale_callback (GtkWidget *,
gpointer );
static void gimage_mask_feather_callback (GtkWidget *,
gdouble ,
GimpUnit ,
gpointer );
static void gimage_mask_border_callback (GtkWidget *,
gdouble ,
GimpUnit ,
gpointer );
static void gimage_mask_grow_callback (GtkWidget *,
gdouble ,
GimpUnit ,
gpointer );
static void gimage_mask_shrink_callback (GtkWidget *,
gdouble ,
GimpUnit ,
gpointer );
/* local variables */
static gdouble selection_feather_radius = 5.0;
......@@ -130,6 +140,13 @@ file_save_as_cmd_callback (GtkWidget *widget,
file_save_as_callback (widget, client_data);
}
void
file_save_a_copy_as_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
file_save_a_copy_as_callback (widget, client_data);
}
void
file_revert_cmd_callback (GtkWidget *widget,
gpointer client_data)
......
......@@ -20,14 +20,15 @@
#define __COMMANDS_H__
void file_new_cmd_callback (GtkWidget *, gpointer, guint);
void file_open_cmd_callback (GtkWidget *, gpointer);
void file_save_cmd_callback (GtkWidget *, gpointer);
void file_save_as_cmd_callback (GtkWidget *, gpointer);
void file_revert_cmd_callback (GtkWidget *, gpointer);
void file_pref_cmd_callback (GtkWidget *, gpointer);
void file_close_cmd_callback (GtkWidget *, gpointer);
void file_quit_cmd_callback (GtkWidget *, gpointer);
void file_new_cmd_callback (GtkWidget *, gpointer, guint);
void file_open_cmd_callback (GtkWidget *, gpointer);
void file_save_cmd_callback (GtkWidget *, gpointer);
void file_save_as_cmd_callback (GtkWidget *, gpointer);
void file_save_a_copy_as_cmd_callback (GtkWidget *, gpointer);
void file_revert_cmd_callback (GtkWidget *, gpointer);
void file_pref_cmd_callback (GtkWidget *, gpointer);
void file_close_cmd_callback (GtkWidget *, gpointer);
void file_quit_cmd_callback (GtkWidget *, gpointer);
void edit_undo_cmd_callback (GtkWidget *, gpointer);
void edit_redo_cmd_callback (GtkWidget *, gpointer);
......
......@@ -215,7 +215,9 @@ static GimpItemFactoryEntry image_entries[] =
"file/dialogs/file_open.html", NULL },
{ { N_("/File/Save"), "<control>S", file_save_cmd_callback, 0 },
"file/dialogs/file_save.html", NULL },
{ { N_("/File/Save As..."), NULL, file_save_as_cmd_callback, 0 },
{ { N_("/File/Save as..."), NULL, file_save_as_cmd_callback, 0 },
"file/dialogs/file_save.html", NULL },
{ { N_("/File/Save a Copy as..."), NULL, file_save_a_copy_as_cmd_callback, 0 },
"file/dialogs/file_save.html", NULL },
{ { N_("/File/Revert..."), NULL, file_revert_cmd_callback, 0 },
"file/revert.html", NULL },
......
......@@ -15,11 +15,21 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __LAYERS_DIALOG_P_H__
#define __LAYERS_DIALOG_P_H__
void render_fs_preview (GtkWidget *, GdkPixmap *);
void render_preview (TempBuf *, GtkWidget *, int, int, int);
void layers_dialog_invalidate_previews (GimpImage *gimage);
void render_fs_preview (GtkWidget *widget,
GdkPixmap *pixmap);
void render_preview (TempBuf *preview_buf,
GtkWidget *preview_widget,
gint width,
gint height,
gint channel);
void layers_dialog_invalidate_previews (GimpImage *gimage);
void layers_dialog_layer_merge_query (GImage *gimage,
gboolean merge_visible);
#endif /* __LAYERS_DIALOG_P_H__ */
......@@ -215,7 +215,9 @@ static GimpItemFactoryEntry image_entries[] =
"file/dialogs/file_open.html", NULL },
{ { N_("/File/Save"), "<control>S", file_save_cmd_callback, 0 },
"file/dialogs/file_save.html", NULL },
{ { N_("/File/Save As..."), NULL, file_save_as_cmd_callback, 0 },
{ { N_("/File/Save as..."), NULL, file_save_as_cmd_callback, 0 },
"file/dialogs/file_save.html", NULL },
{ { N_("/File/Save a Copy as..."), NULL, file_save_a_copy_as_cmd_callback, 0 },
"file/dialogs/file_save.html", NULL },
{ { N_("/File/Revert..."), NULL, file_revert_cmd_callback, 0 },
"file/revert.html", NULL },
......
......@@ -215,7 +215,9 @@ static GimpItemFactoryEntry image_entries[] =
"file/dialogs/file_open.html", NULL },
{ { N_("/File/Save"), "<control>S", file_save_cmd_callback, 0 },
"file/dialogs/file_save.html", NULL },
{ { N_("/File/Save As..."), NULL, file_save_as_cmd_callback, 0 },
{ { N_("/File/Save as..."), NULL, file_save_as_cmd_callback, 0 },
"file/dialogs/file_save.html", NULL },
{ { N_("/File/Save a Copy as..."), NULL, file_save_a_copy_as_cmd_callback, 0 },
"file/dialogs/file_save.html", NULL },
{ { N_("/File/Revert..."), NULL, file_revert_cmd_callback, 0 },
"file/revert.html", NULL },
......
......@@ -215,7 +215,9 @@ static GimpItemFactoryEntry image_entries[] =
"file/dialogs/file_open.html", NULL },
{ { N_("/File/Save"), "<control>S", file_save_cmd_callback, 0 },
"file/dialogs/file_save.html", NULL },
{ { N_("/File/Save As..."), NULL, file_save_as_cmd_callback, 0 },
{ { N_("/File/Save as..."), NULL, file_save_as_cmd_callback, 0 },
"file/dialogs/file_save.html", NULL },
{ { N_("/File/Save a Copy as..."), NULL, file_save_a_copy_as_cmd_callback, 0 },
"file/dialogs/file_save.html", NULL },
{ { N_("/File/Revert..."), NULL, file_revert_cmd_callback, 0 },
"file/revert.html", NULL },
......
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