mirror of https://github.com/GNOME/gimp.git
app/commands.c app/desaturate.[ch] no need to pass the image as a void
1999-07-27 Michael Natterer <mitschel@cs.tu-berlin.de> * app/commands.c * app/desaturate.[ch] * app/equalize.[ch]: no need to pass the image as a void pointer to desaturate and equalize. * app/gimage.h * app/gimpimage.[ch]: new function gimp_image_position_layer(). * app/layers_dialog.c: move layers with drag'n'drop.
This commit is contained in:
parent
21e0ceb948
commit
acffb96f7b
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
1999-07-27 Michael Natterer <mitschel@cs.tu-berlin.de>
|
||||
|
||||
* app/commands.c
|
||||
* app/desaturate.[ch]
|
||||
* app/equalize.[ch]: no need to pass the image as a void pointer
|
||||
to desaturate and equalize.
|
||||
|
||||
* app/gimage.h
|
||||
* app/gimpimage.[ch]: new function gimp_image_position_layer().
|
||||
|
||||
* app/layers_dialog.c: drag'n'drop movement of layers.
|
||||
|
||||
1999-07-27 Tomas Ogren <stric@ing.umu.se>
|
||||
|
||||
* app/transform_tool.c: Fixed a typo
|
||||
|
|
|
@ -15,22 +15,15 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "appenv.h"
|
||||
#include "about_dialog.h"
|
||||
#include "app_procs.h"
|
||||
#include "brightness_contrast.h"
|
||||
#include "gimpbrushlist.h"
|
||||
#include "by_color_select.h"
|
||||
#include "colormaps.h"
|
||||
#include "colormap_dialog.i.h"
|
||||
#include "color_area.h"
|
||||
#include "color_balance.h"
|
||||
#include "commands.h"
|
||||
#include "convert.h"
|
||||
#include "curves.h"
|
||||
#include "desaturate.h"
|
||||
#include "devices.h"
|
||||
#include "channel_ops.h"
|
||||
|
@ -44,23 +37,18 @@
|
|||
#include "gimprc.h"
|
||||
#include "global_edit.h"
|
||||
#include "gradient.h"
|
||||
#include "histogram_tool.h"
|
||||
#include "hue_saturation.h"
|
||||
#include "image_render.h"
|
||||
#include "info_window.h"
|
||||
#include "interface.h"
|
||||
#include "invert.h"
|
||||
#include "lc_dialog.h"
|
||||
#include "layer_select.h"
|
||||
#include "levels.h"
|
||||
#include "module_db.h"
|
||||
#include "palette.h"
|
||||
#include "patterns.h"
|
||||
#include "plug_in.h"
|
||||
#include "posterize.h"
|
||||
#include "resize.h"
|
||||
#include "scale.h"
|
||||
#include "threshold.h"
|
||||
#include "tips_dialog.h"
|
||||
#include "tools.h"
|
||||
#include "undo.h"
|
||||
|
@ -78,7 +66,7 @@ typedef struct
|
|||
} ImageResize;
|
||||
|
||||
/* external functions */
|
||||
extern void layers_dialog_layer_merge_query (GImage *, int);
|
||||
extern void layers_dialog_layer_merge_query (GImage *, gboolean);
|
||||
|
||||
/* local functions */
|
||||
static void image_resize_callback (GtkWidget *, gpointer);
|
||||
|
@ -686,7 +674,7 @@ image_equalize_cmd_callback (GtkWidget *widget,
|
|||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
image_equalize ((void *) gdisp->gimage);
|
||||
image_equalize (gdisp->gimage);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -697,74 +685,74 @@ image_invert_cmd_callback (GtkWidget *widget,
|
|||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
image_invert ((void *) gdisp->gimage);
|
||||
image_invert (gdisp->gimage);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
image_desaturate_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
image_desaturate ((void *) gdisp->gimage);
|
||||
image_desaturate (gdisp->gimage);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
channel_ops_duplicate_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
channel_ops_duplicate ((void *) gdisp->gimage);
|
||||
channel_ops_duplicate (gdisp->gimage);
|
||||
}
|
||||
|
||||
void
|
||||
channel_ops_offset_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
channel_ops_offset ((void *) gdisp->gimage);
|
||||
channel_ops_offset (gdisp->gimage);
|
||||
}
|
||||
|
||||
void
|
||||
image_convert_rgb_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
convert_to_rgb ((void *) gdisp->gimage);
|
||||
convert_to_rgb (gdisp->gimage);
|
||||
}
|
||||
|
||||
void
|
||||
image_convert_grayscale_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
convert_to_grayscale ((void *) gdisp->gimage);
|
||||
convert_to_grayscale (gdisp->gimage);
|
||||
}
|
||||
|
||||
void
|
||||
image_convert_indexed_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
convert_to_indexed ((void *) gdisp->gimage);
|
||||
convert_to_indexed (gdisp->gimage);
|
||||
}
|
||||
|
||||
void
|
||||
image_resize_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
GimpImage * gimage;
|
||||
|
@ -775,7 +763,7 @@ image_resize_cmd_callback (GtkWidget *widget,
|
|||
gimage = gdisp->gimage;
|
||||
|
||||
/* the ImageResize structure */
|
||||
image_resize = (ImageResize *) g_malloc (sizeof (ImageResize));
|
||||
image_resize = g_new (ImageResize, 1);
|
||||
image_resize->gimage = gimage;
|
||||
image_resize->resize = resize_widget_new (ResizeWidget,
|
||||
ResizeImage,
|
||||
|
@ -796,7 +784,7 @@ image_resize_cmd_callback (GtkWidget *widget,
|
|||
|
||||
void
|
||||
image_scale_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
GimpImage * gimage;
|
||||
|
@ -807,7 +795,7 @@ image_scale_cmd_callback (GtkWidget *widget,
|
|||
gimage = gdisp->gimage;
|
||||
|
||||
/* the ImageResize structure */
|
||||
image_scale = (ImageResize *) g_malloc (sizeof (ImageResize));
|
||||
image_scale = g_new (ImageResize, 1);
|
||||
image_scale->gimage = gimage;
|
||||
image_scale->resize = resize_widget_new (ScaleWidget,
|
||||
ResizeImage,
|
||||
|
@ -1102,7 +1090,7 @@ dialogs_indexed_palette_cmd_callback (GtkWidget *widget,
|
|||
{
|
||||
static ColormapDialog * cmap_dlg;
|
||||
|
||||
if(!cmap_dlg)
|
||||
if (!cmap_dlg)
|
||||
{
|
||||
cmap_dlg = colormap_dialog_create (image_context);
|
||||
colormap_dialog_connect_selected (cmap_dlg_sel_cb, NULL, cmap_dlg);
|
||||
|
@ -1169,7 +1157,7 @@ dialogs_module_browser_cmd_callback (GtkWidget *widget,
|
|||
/*********************/
|
||||
|
||||
static void
|
||||
image_resize_callback (GtkWidget *w,
|
||||
image_resize_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
ImageResize * image_resize;
|
||||
|
@ -1191,7 +1179,8 @@ image_resize_callback (GtkWidget *w,
|
|||
}
|
||||
else
|
||||
{
|
||||
g_message (_("Resize Error: Both width and height must be greater than zero."));
|
||||
g_message (_("Resize Error: Both width and height must be "
|
||||
"greater than zero."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1201,7 +1190,7 @@ image_resize_callback (GtkWidget *w,
|
|||
}
|
||||
|
||||
static void
|
||||
image_scale_callback (GtkWidget *w,
|
||||
image_scale_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
ImageResize * image_scale;
|
||||
|
@ -1238,7 +1227,7 @@ image_scale_callback (GtkWidget *w,
|
|||
image_scale->resize->height);
|
||||
flush = TRUE;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
g_message (_("Scale Error: Both width and height must be "
|
||||
"greater than zero."));
|
||||
|
@ -1255,18 +1244,18 @@ image_scale_callback (GtkWidget *w,
|
|||
}
|
||||
|
||||
static gint
|
||||
image_delete_callback (GtkWidget *w,
|
||||
GdkEvent *e,
|
||||
image_delete_callback (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer client_data)
|
||||
{
|
||||
image_cancel_callback (w, client_data);
|
||||
image_cancel_callback (widget, client_data);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
image_cancel_callback (GtkWidget *w,
|
||||
image_cancel_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
ImageResize *image_resize;
|
||||
|
|
|
@ -15,22 +15,15 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "appenv.h"
|
||||
#include "about_dialog.h"
|
||||
#include "app_procs.h"
|
||||
#include "brightness_contrast.h"
|
||||
#include "gimpbrushlist.h"
|
||||
#include "by_color_select.h"
|
||||
#include "colormaps.h"
|
||||
#include "colormap_dialog.i.h"
|
||||
#include "color_area.h"
|
||||
#include "color_balance.h"
|
||||
#include "commands.h"
|
||||
#include "convert.h"
|
||||
#include "curves.h"
|
||||
#include "desaturate.h"
|
||||
#include "devices.h"
|
||||
#include "channel_ops.h"
|
||||
|
@ -44,23 +37,18 @@
|
|||
#include "gimprc.h"
|
||||
#include "global_edit.h"
|
||||
#include "gradient.h"
|
||||
#include "histogram_tool.h"
|
||||
#include "hue_saturation.h"
|
||||
#include "image_render.h"
|
||||
#include "info_window.h"
|
||||
#include "interface.h"
|
||||
#include "invert.h"
|
||||
#include "lc_dialog.h"
|
||||
#include "layer_select.h"
|
||||
#include "levels.h"
|
||||
#include "module_db.h"
|
||||
#include "palette.h"
|
||||
#include "patterns.h"
|
||||
#include "plug_in.h"
|
||||
#include "posterize.h"
|
||||
#include "resize.h"
|
||||
#include "scale.h"
|
||||
#include "threshold.h"
|
||||
#include "tips_dialog.h"
|
||||
#include "tools.h"
|
||||
#include "undo.h"
|
||||
|
@ -78,7 +66,7 @@ typedef struct
|
|||
} ImageResize;
|
||||
|
||||
/* external functions */
|
||||
extern void layers_dialog_layer_merge_query (GImage *, int);
|
||||
extern void layers_dialog_layer_merge_query (GImage *, gboolean);
|
||||
|
||||
/* local functions */
|
||||
static void image_resize_callback (GtkWidget *, gpointer);
|
||||
|
@ -686,7 +674,7 @@ image_equalize_cmd_callback (GtkWidget *widget,
|
|||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
image_equalize ((void *) gdisp->gimage);
|
||||
image_equalize (gdisp->gimage);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -697,74 +685,74 @@ image_invert_cmd_callback (GtkWidget *widget,
|
|||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
image_invert ((void *) gdisp->gimage);
|
||||
image_invert (gdisp->gimage);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
image_desaturate_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
image_desaturate ((void *) gdisp->gimage);
|
||||
image_desaturate (gdisp->gimage);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
channel_ops_duplicate_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
channel_ops_duplicate ((void *) gdisp->gimage);
|
||||
channel_ops_duplicate (gdisp->gimage);
|
||||
}
|
||||
|
||||
void
|
||||
channel_ops_offset_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
channel_ops_offset ((void *) gdisp->gimage);
|
||||
channel_ops_offset (gdisp->gimage);
|
||||
}
|
||||
|
||||
void
|
||||
image_convert_rgb_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
convert_to_rgb ((void *) gdisp->gimage);
|
||||
convert_to_rgb (gdisp->gimage);
|
||||
}
|
||||
|
||||
void
|
||||
image_convert_grayscale_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
convert_to_grayscale ((void *) gdisp->gimage);
|
||||
convert_to_grayscale (gdisp->gimage);
|
||||
}
|
||||
|
||||
void
|
||||
image_convert_indexed_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
convert_to_indexed ((void *) gdisp->gimage);
|
||||
convert_to_indexed (gdisp->gimage);
|
||||
}
|
||||
|
||||
void
|
||||
image_resize_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
GimpImage * gimage;
|
||||
|
@ -775,7 +763,7 @@ image_resize_cmd_callback (GtkWidget *widget,
|
|||
gimage = gdisp->gimage;
|
||||
|
||||
/* the ImageResize structure */
|
||||
image_resize = (ImageResize *) g_malloc (sizeof (ImageResize));
|
||||
image_resize = g_new (ImageResize, 1);
|
||||
image_resize->gimage = gimage;
|
||||
image_resize->resize = resize_widget_new (ResizeWidget,
|
||||
ResizeImage,
|
||||
|
@ -796,7 +784,7 @@ image_resize_cmd_callback (GtkWidget *widget,
|
|||
|
||||
void
|
||||
image_scale_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
GimpImage * gimage;
|
||||
|
@ -807,7 +795,7 @@ image_scale_cmd_callback (GtkWidget *widget,
|
|||
gimage = gdisp->gimage;
|
||||
|
||||
/* the ImageResize structure */
|
||||
image_scale = (ImageResize *) g_malloc (sizeof (ImageResize));
|
||||
image_scale = g_new (ImageResize, 1);
|
||||
image_scale->gimage = gimage;
|
||||
image_scale->resize = resize_widget_new (ScaleWidget,
|
||||
ResizeImage,
|
||||
|
@ -1102,7 +1090,7 @@ dialogs_indexed_palette_cmd_callback (GtkWidget *widget,
|
|||
{
|
||||
static ColormapDialog * cmap_dlg;
|
||||
|
||||
if(!cmap_dlg)
|
||||
if (!cmap_dlg)
|
||||
{
|
||||
cmap_dlg = colormap_dialog_create (image_context);
|
||||
colormap_dialog_connect_selected (cmap_dlg_sel_cb, NULL, cmap_dlg);
|
||||
|
@ -1169,7 +1157,7 @@ dialogs_module_browser_cmd_callback (GtkWidget *widget,
|
|||
/*********************/
|
||||
|
||||
static void
|
||||
image_resize_callback (GtkWidget *w,
|
||||
image_resize_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
ImageResize * image_resize;
|
||||
|
@ -1191,7 +1179,8 @@ image_resize_callback (GtkWidget *w,
|
|||
}
|
||||
else
|
||||
{
|
||||
g_message (_("Resize Error: Both width and height must be greater than zero."));
|
||||
g_message (_("Resize Error: Both width and height must be "
|
||||
"greater than zero."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1201,7 +1190,7 @@ image_resize_callback (GtkWidget *w,
|
|||
}
|
||||
|
||||
static void
|
||||
image_scale_callback (GtkWidget *w,
|
||||
image_scale_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
ImageResize * image_scale;
|
||||
|
@ -1238,7 +1227,7 @@ image_scale_callback (GtkWidget *w,
|
|||
image_scale->resize->height);
|
||||
flush = TRUE;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
g_message (_("Scale Error: Both width and height must be "
|
||||
"greater than zero."));
|
||||
|
@ -1255,18 +1244,18 @@ image_scale_callback (GtkWidget *w,
|
|||
}
|
||||
|
||||
static gint
|
||||
image_delete_callback (GtkWidget *w,
|
||||
GdkEvent *e,
|
||||
image_delete_callback (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer client_data)
|
||||
{
|
||||
image_cancel_callback (w, client_data);
|
||||
image_cancel_callback (widget, client_data);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
image_cancel_callback (GtkWidget *w,
|
||||
image_cancel_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
ImageResize *image_resize;
|
||||
|
|
|
@ -15,27 +15,19 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include "appenv.h"
|
||||
#include "drawable.h"
|
||||
#include "desaturate.h"
|
||||
#include "interface.h"
|
||||
#include "paint_funcs.h"
|
||||
#include "gimage.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
void
|
||||
image_desaturate (gimage_ptr)
|
||||
void *gimage_ptr;
|
||||
image_desaturate (GimpImage *gimage)
|
||||
{
|
||||
GImage *gimage;
|
||||
GimpDrawable *drawable;
|
||||
|
||||
gimage = (GImage *) gimage_ptr;
|
||||
drawable = gimage_active_drawable (gimage);
|
||||
|
||||
if (! drawable_color (drawable))
|
||||
|
|
|
@ -18,10 +18,11 @@
|
|||
#ifndef __DESATURATE_H__
|
||||
#define __DESATURATE_H__
|
||||
|
||||
#include "gimpimageF.h"
|
||||
#include "gimpdrawableF.h"
|
||||
|
||||
/* desaturate functions */
|
||||
void image_desaturate (void *);
|
||||
void desaturate (GimpDrawable *);
|
||||
void image_desaturate (GimpImage *gimage);
|
||||
void desaturate (GimpDrawable *drawable);
|
||||
|
||||
#endif /* __DESATURATE_H__ */
|
||||
|
|
|
@ -15,10 +15,6 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include "drawable.h"
|
||||
#include "equalize.h"
|
||||
#include "gimage.h"
|
||||
|
@ -28,14 +24,11 @@
|
|||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
void
|
||||
image_equalize (void *gimage_ptr)
|
||||
image_equalize (GimpImage *gimage)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpDrawable *drawable;
|
||||
|
||||
gimage = (GimpImage *) gimage_ptr;
|
||||
drawable = gimage_active_drawable (gimage);
|
||||
|
||||
if (gimp_drawable_indexed (drawable))
|
||||
|
@ -43,6 +36,7 @@ image_equalize (void *gimage_ptr)
|
|||
g_message (_("Equalize does not operate on indexed drawables."));
|
||||
return;
|
||||
}
|
||||
|
||||
equalize (gimage, drawable, TRUE);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,9 @@
|
|||
#include "gimpdrawableF.h"
|
||||
|
||||
/* equalize functions */
|
||||
void image_equalize (void *);
|
||||
void equalize (GimpImage *, GimpDrawable *, gboolean);
|
||||
void image_equalize (GimpImage *gimage);
|
||||
void equalize (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
gboolean mask_only);
|
||||
|
||||
#endif /* __INVERT_H__ */
|
||||
|
|
|
@ -2191,7 +2191,8 @@ gimp_image_lower_layer (GimpImage *gimage,
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Layer *
|
||||
gimp_image_raise_layer_to_top (GimpImage *gimage,
|
||||
Layer *layer_arg)
|
||||
|
@ -2359,6 +2360,85 @@ gimp_image_lower_layer_to_bottom (GimpImage *gimage,
|
|||
}
|
||||
|
||||
|
||||
Layer *
|
||||
gimp_image_position_layer (GimpImage *gimage,
|
||||
Layer *layer_arg,
|
||||
gint new_index)
|
||||
{
|
||||
Layer *layer;
|
||||
GSList *list;
|
||||
GSList *next;
|
||||
gint x_min, y_min, x_max, y_max;
|
||||
gint off_x, off_y;
|
||||
gint index;
|
||||
gint list_length;
|
||||
|
||||
list = gimage->layers;
|
||||
list_length = g_slist_length (list);
|
||||
|
||||
next = NULL;
|
||||
layer = NULL;
|
||||
index = 0;
|
||||
|
||||
/* find layer_arg */
|
||||
while (list)
|
||||
{
|
||||
layer = (Layer *) list->data;
|
||||
if (layer == layer_arg)
|
||||
{
|
||||
break;
|
||||
}
|
||||
list = g_slist_next (list);
|
||||
index++;
|
||||
}
|
||||
|
||||
if (layer != layer_arg)
|
||||
{
|
||||
/* The requested layer was not found in the layerstack
|
||||
* Return without changing anything
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (new_index < 0)
|
||||
new_index = 0;
|
||||
|
||||
if (new_index >= list_length)
|
||||
new_index = list_length - 1;
|
||||
|
||||
if (new_index == index)
|
||||
return NULL;
|
||||
|
||||
/* check if we want to move it below a bottom layer without alpha */
|
||||
layer = (Layer *) g_slist_last (list)->data;
|
||||
if (new_index == list_length - 1 &&
|
||||
!layer_has_alpha (layer))
|
||||
{
|
||||
g_message (_("BG has no alpha, layer was placed above"));
|
||||
new_index--;
|
||||
}
|
||||
|
||||
list = g_slist_remove (gimage->layers, layer_arg);
|
||||
gimage->layers = g_slist_insert (list, layer_arg, new_index);
|
||||
|
||||
/* update the affected area (== area of layer_arg) */
|
||||
drawable_offsets (GIMP_DRAWABLE(layer_arg), &off_x, &off_y);
|
||||
x_min = off_x;
|
||||
y_min = off_y;
|
||||
x_max = off_x + drawable_width (GIMP_DRAWABLE (layer_arg));
|
||||
y_max = off_y + drawable_height (GIMP_DRAWABLE (layer_arg));
|
||||
gtk_signal_emit (GTK_OBJECT (gimage),
|
||||
gimp_image_signals[REPAINT],
|
||||
x_min, y_min, x_max, y_max);
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_image_invalidate_preview (gimage);
|
||||
|
||||
gimp_image_dirty (gimage);
|
||||
|
||||
return layer_arg;
|
||||
}
|
||||
|
||||
Layer *
|
||||
gimp_image_merge_visible_layers (GimpImage *gimage,
|
||||
MergeType merge_type)
|
||||
|
|
|
@ -196,6 +196,7 @@ Layer * gimp_image_raise_layer (GimpImage *, Layer *);
|
|||
Layer * gimp_image_lower_layer (GimpImage *, Layer *);
|
||||
Layer * gimp_image_raise_layer_to_top (GimpImage *, Layer *);
|
||||
Layer * gimp_image_lower_layer_to_bottom (GimpImage *, Layer *);
|
||||
Layer * gimp_image_position_layer (GimpImage *, Layer *, gint);
|
||||
Layer * gimp_image_merge_visible_layers (GimpImage *, MergeType);
|
||||
Layer * gimp_image_merge_down (GimpImage *, Layer *, MergeType);
|
||||
Layer * gimp_image_flatten (GimpImage *);
|
||||
|
|
|
@ -2191,7 +2191,8 @@ gimp_image_lower_layer (GimpImage *gimage,
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Layer *
|
||||
gimp_image_raise_layer_to_top (GimpImage *gimage,
|
||||
Layer *layer_arg)
|
||||
|
@ -2359,6 +2360,85 @@ gimp_image_lower_layer_to_bottom (GimpImage *gimage,
|
|||
}
|
||||
|
||||
|
||||
Layer *
|
||||
gimp_image_position_layer (GimpImage *gimage,
|
||||
Layer *layer_arg,
|
||||
gint new_index)
|
||||
{
|
||||
Layer *layer;
|
||||
GSList *list;
|
||||
GSList *next;
|
||||
gint x_min, y_min, x_max, y_max;
|
||||
gint off_x, off_y;
|
||||
gint index;
|
||||
gint list_length;
|
||||
|
||||
list = gimage->layers;
|
||||
list_length = g_slist_length (list);
|
||||
|
||||
next = NULL;
|
||||
layer = NULL;
|
||||
index = 0;
|
||||
|
||||
/* find layer_arg */
|
||||
while (list)
|
||||
{
|
||||
layer = (Layer *) list->data;
|
||||
if (layer == layer_arg)
|
||||
{
|
||||
break;
|
||||
}
|
||||
list = g_slist_next (list);
|
||||
index++;
|
||||
}
|
||||
|
||||
if (layer != layer_arg)
|
||||
{
|
||||
/* The requested layer was not found in the layerstack
|
||||
* Return without changing anything
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (new_index < 0)
|
||||
new_index = 0;
|
||||
|
||||
if (new_index >= list_length)
|
||||
new_index = list_length - 1;
|
||||
|
||||
if (new_index == index)
|
||||
return NULL;
|
||||
|
||||
/* check if we want to move it below a bottom layer without alpha */
|
||||
layer = (Layer *) g_slist_last (list)->data;
|
||||
if (new_index == list_length - 1 &&
|
||||
!layer_has_alpha (layer))
|
||||
{
|
||||
g_message (_("BG has no alpha, layer was placed above"));
|
||||
new_index--;
|
||||
}
|
||||
|
||||
list = g_slist_remove (gimage->layers, layer_arg);
|
||||
gimage->layers = g_slist_insert (list, layer_arg, new_index);
|
||||
|
||||
/* update the affected area (== area of layer_arg) */
|
||||
drawable_offsets (GIMP_DRAWABLE(layer_arg), &off_x, &off_y);
|
||||
x_min = off_x;
|
||||
y_min = off_y;
|
||||
x_max = off_x + drawable_width (GIMP_DRAWABLE (layer_arg));
|
||||
y_max = off_y + drawable_height (GIMP_DRAWABLE (layer_arg));
|
||||
gtk_signal_emit (GTK_OBJECT (gimage),
|
||||
gimp_image_signals[REPAINT],
|
||||
x_min, y_min, x_max, y_max);
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_image_invalidate_preview (gimage);
|
||||
|
||||
gimp_image_dirty (gimage);
|
||||
|
||||
return layer_arg;
|
||||
}
|
||||
|
||||
Layer *
|
||||
gimp_image_merge_visible_layers (GimpImage *gimage,
|
||||
MergeType merge_type)
|
||||
|
|
|
@ -196,6 +196,7 @@ Layer * gimp_image_raise_layer (GimpImage *, Layer *);
|
|||
Layer * gimp_image_lower_layer (GimpImage *, Layer *);
|
||||
Layer * gimp_image_raise_layer_to_top (GimpImage *, Layer *);
|
||||
Layer * gimp_image_lower_layer_to_bottom (GimpImage *, Layer *);
|
||||
Layer * gimp_image_position_layer (GimpImage *, Layer *, gint);
|
||||
Layer * gimp_image_merge_visible_layers (GimpImage *, MergeType);
|
||||
Layer * gimp_image_merge_down (GimpImage *, Layer *, MergeType);
|
||||
Layer * gimp_image_flatten (GimpImage *);
|
||||
|
|
|
@ -2191,7 +2191,8 @@ gimp_image_lower_layer (GimpImage *gimage,
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Layer *
|
||||
gimp_image_raise_layer_to_top (GimpImage *gimage,
|
||||
Layer *layer_arg)
|
||||
|
@ -2359,6 +2360,85 @@ gimp_image_lower_layer_to_bottom (GimpImage *gimage,
|
|||
}
|
||||
|
||||
|
||||
Layer *
|
||||
gimp_image_position_layer (GimpImage *gimage,
|
||||
Layer *layer_arg,
|
||||
gint new_index)
|
||||
{
|
||||
Layer *layer;
|
||||
GSList *list;
|
||||
GSList *next;
|
||||
gint x_min, y_min, x_max, y_max;
|
||||
gint off_x, off_y;
|
||||
gint index;
|
||||
gint list_length;
|
||||
|
||||
list = gimage->layers;
|
||||
list_length = g_slist_length (list);
|
||||
|
||||
next = NULL;
|
||||
layer = NULL;
|
||||
index = 0;
|
||||
|
||||
/* find layer_arg */
|
||||
while (list)
|
||||
{
|
||||
layer = (Layer *) list->data;
|
||||
if (layer == layer_arg)
|
||||
{
|
||||
break;
|
||||
}
|
||||
list = g_slist_next (list);
|
||||
index++;
|
||||
}
|
||||
|
||||
if (layer != layer_arg)
|
||||
{
|
||||
/* The requested layer was not found in the layerstack
|
||||
* Return without changing anything
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (new_index < 0)
|
||||
new_index = 0;
|
||||
|
||||
if (new_index >= list_length)
|
||||
new_index = list_length - 1;
|
||||
|
||||
if (new_index == index)
|
||||
return NULL;
|
||||
|
||||
/* check if we want to move it below a bottom layer without alpha */
|
||||
layer = (Layer *) g_slist_last (list)->data;
|
||||
if (new_index == list_length - 1 &&
|
||||
!layer_has_alpha (layer))
|
||||
{
|
||||
g_message (_("BG has no alpha, layer was placed above"));
|
||||
new_index--;
|
||||
}
|
||||
|
||||
list = g_slist_remove (gimage->layers, layer_arg);
|
||||
gimage->layers = g_slist_insert (list, layer_arg, new_index);
|
||||
|
||||
/* update the affected area (== area of layer_arg) */
|
||||
drawable_offsets (GIMP_DRAWABLE(layer_arg), &off_x, &off_y);
|
||||
x_min = off_x;
|
||||
y_min = off_y;
|
||||
x_max = off_x + drawable_width (GIMP_DRAWABLE (layer_arg));
|
||||
y_max = off_y + drawable_height (GIMP_DRAWABLE (layer_arg));
|
||||
gtk_signal_emit (GTK_OBJECT (gimage),
|
||||
gimp_image_signals[REPAINT],
|
||||
x_min, y_min, x_max, y_max);
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_image_invalidate_preview (gimage);
|
||||
|
||||
gimp_image_dirty (gimage);
|
||||
|
||||
return layer_arg;
|
||||
}
|
||||
|
||||
Layer *
|
||||
gimp_image_merge_visible_layers (GimpImage *gimage,
|
||||
MergeType merge_type)
|
||||
|
|
|
@ -196,6 +196,7 @@ Layer * gimp_image_raise_layer (GimpImage *, Layer *);
|
|||
Layer * gimp_image_lower_layer (GimpImage *, Layer *);
|
||||
Layer * gimp_image_raise_layer_to_top (GimpImage *, Layer *);
|
||||
Layer * gimp_image_lower_layer_to_bottom (GimpImage *, Layer *);
|
||||
Layer * gimp_image_position_layer (GimpImage *, Layer *, gint);
|
||||
Layer * gimp_image_merge_visible_layers (GimpImage *, MergeType);
|
||||
Layer * gimp_image_merge_down (GimpImage *, Layer *, MergeType);
|
||||
Layer * gimp_image_flatten (GimpImage *);
|
||||
|
|
|
@ -2191,7 +2191,8 @@ gimp_image_lower_layer (GimpImage *gimage,
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Layer *
|
||||
gimp_image_raise_layer_to_top (GimpImage *gimage,
|
||||
Layer *layer_arg)
|
||||
|
@ -2359,6 +2360,85 @@ gimp_image_lower_layer_to_bottom (GimpImage *gimage,
|
|||
}
|
||||
|
||||
|
||||
Layer *
|
||||
gimp_image_position_layer (GimpImage *gimage,
|
||||
Layer *layer_arg,
|
||||
gint new_index)
|
||||
{
|
||||
Layer *layer;
|
||||
GSList *list;
|
||||
GSList *next;
|
||||
gint x_min, y_min, x_max, y_max;
|
||||
gint off_x, off_y;
|
||||
gint index;
|
||||
gint list_length;
|
||||
|
||||
list = gimage->layers;
|
||||
list_length = g_slist_length (list);
|
||||
|
||||
next = NULL;
|
||||
layer = NULL;
|
||||
index = 0;
|
||||
|
||||
/* find layer_arg */
|
||||
while (list)
|
||||
{
|
||||
layer = (Layer *) list->data;
|
||||
if (layer == layer_arg)
|
||||
{
|
||||
break;
|
||||
}
|
||||
list = g_slist_next (list);
|
||||
index++;
|
||||
}
|
||||
|
||||
if (layer != layer_arg)
|
||||
{
|
||||
/* The requested layer was not found in the layerstack
|
||||
* Return without changing anything
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (new_index < 0)
|
||||
new_index = 0;
|
||||
|
||||
if (new_index >= list_length)
|
||||
new_index = list_length - 1;
|
||||
|
||||
if (new_index == index)
|
||||
return NULL;
|
||||
|
||||
/* check if we want to move it below a bottom layer without alpha */
|
||||
layer = (Layer *) g_slist_last (list)->data;
|
||||
if (new_index == list_length - 1 &&
|
||||
!layer_has_alpha (layer))
|
||||
{
|
||||
g_message (_("BG has no alpha, layer was placed above"));
|
||||
new_index--;
|
||||
}
|
||||
|
||||
list = g_slist_remove (gimage->layers, layer_arg);
|
||||
gimage->layers = g_slist_insert (list, layer_arg, new_index);
|
||||
|
||||
/* update the affected area (== area of layer_arg) */
|
||||
drawable_offsets (GIMP_DRAWABLE(layer_arg), &off_x, &off_y);
|
||||
x_min = off_x;
|
||||
y_min = off_y;
|
||||
x_max = off_x + drawable_width (GIMP_DRAWABLE (layer_arg));
|
||||
y_max = off_y + drawable_height (GIMP_DRAWABLE (layer_arg));
|
||||
gtk_signal_emit (GTK_OBJECT (gimage),
|
||||
gimp_image_signals[REPAINT],
|
||||
x_min, y_min, x_max, y_max);
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_image_invalidate_preview (gimage);
|
||||
|
||||
gimp_image_dirty (gimage);
|
||||
|
||||
return layer_arg;
|
||||
}
|
||||
|
||||
Layer *
|
||||
gimp_image_merge_visible_layers (GimpImage *gimage,
|
||||
MergeType merge_type)
|
||||
|
|
|
@ -196,6 +196,7 @@ Layer * gimp_image_raise_layer (GimpImage *, Layer *);
|
|||
Layer * gimp_image_lower_layer (GimpImage *, Layer *);
|
||||
Layer * gimp_image_raise_layer_to_top (GimpImage *, Layer *);
|
||||
Layer * gimp_image_lower_layer_to_bottom (GimpImage *, Layer *);
|
||||
Layer * gimp_image_position_layer (GimpImage *, Layer *, gint);
|
||||
Layer * gimp_image_merge_visible_layers (GimpImage *, MergeType);
|
||||
Layer * gimp_image_merge_down (GimpImage *, Layer *, MergeType);
|
||||
Layer * gimp_image_flatten (GimpImage *);
|
||||
|
|
|
@ -2191,7 +2191,8 @@ gimp_image_lower_layer (GimpImage *gimage,
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Layer *
|
||||
gimp_image_raise_layer_to_top (GimpImage *gimage,
|
||||
Layer *layer_arg)
|
||||
|
@ -2359,6 +2360,85 @@ gimp_image_lower_layer_to_bottom (GimpImage *gimage,
|
|||
}
|
||||
|
||||
|
||||
Layer *
|
||||
gimp_image_position_layer (GimpImage *gimage,
|
||||
Layer *layer_arg,
|
||||
gint new_index)
|
||||
{
|
||||
Layer *layer;
|
||||
GSList *list;
|
||||
GSList *next;
|
||||
gint x_min, y_min, x_max, y_max;
|
||||
gint off_x, off_y;
|
||||
gint index;
|
||||
gint list_length;
|
||||
|
||||
list = gimage->layers;
|
||||
list_length = g_slist_length (list);
|
||||
|
||||
next = NULL;
|
||||
layer = NULL;
|
||||
index = 0;
|
||||
|
||||
/* find layer_arg */
|
||||
while (list)
|
||||
{
|
||||
layer = (Layer *) list->data;
|
||||
if (layer == layer_arg)
|
||||
{
|
||||
break;
|
||||
}
|
||||
list = g_slist_next (list);
|
||||
index++;
|
||||
}
|
||||
|
||||
if (layer != layer_arg)
|
||||
{
|
||||
/* The requested layer was not found in the layerstack
|
||||
* Return without changing anything
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (new_index < 0)
|
||||
new_index = 0;
|
||||
|
||||
if (new_index >= list_length)
|
||||
new_index = list_length - 1;
|
||||
|
||||
if (new_index == index)
|
||||
return NULL;
|
||||
|
||||
/* check if we want to move it below a bottom layer without alpha */
|
||||
layer = (Layer *) g_slist_last (list)->data;
|
||||
if (new_index == list_length - 1 &&
|
||||
!layer_has_alpha (layer))
|
||||
{
|
||||
g_message (_("BG has no alpha, layer was placed above"));
|
||||
new_index--;
|
||||
}
|
||||
|
||||
list = g_slist_remove (gimage->layers, layer_arg);
|
||||
gimage->layers = g_slist_insert (list, layer_arg, new_index);
|
||||
|
||||
/* update the affected area (== area of layer_arg) */
|
||||
drawable_offsets (GIMP_DRAWABLE(layer_arg), &off_x, &off_y);
|
||||
x_min = off_x;
|
||||
y_min = off_y;
|
||||
x_max = off_x + drawable_width (GIMP_DRAWABLE (layer_arg));
|
||||
y_max = off_y + drawable_height (GIMP_DRAWABLE (layer_arg));
|
||||
gtk_signal_emit (GTK_OBJECT (gimage),
|
||||
gimp_image_signals[REPAINT],
|
||||
x_min, y_min, x_max, y_max);
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_image_invalidate_preview (gimage);
|
||||
|
||||
gimp_image_dirty (gimage);
|
||||
|
||||
return layer_arg;
|
||||
}
|
||||
|
||||
Layer *
|
||||
gimp_image_merge_visible_layers (GimpImage *gimage,
|
||||
MergeType merge_type)
|
||||
|
|
|
@ -196,6 +196,7 @@ Layer * gimp_image_raise_layer (GimpImage *, Layer *);
|
|||
Layer * gimp_image_lower_layer (GimpImage *, Layer *);
|
||||
Layer * gimp_image_raise_layer_to_top (GimpImage *, Layer *);
|
||||
Layer * gimp_image_lower_layer_to_bottom (GimpImage *, Layer *);
|
||||
Layer * gimp_image_position_layer (GimpImage *, Layer *, gint);
|
||||
Layer * gimp_image_merge_visible_layers (GimpImage *, MergeType);
|
||||
Layer * gimp_image_merge_down (GimpImage *, Layer *, MergeType);
|
||||
Layer * gimp_image_flatten (GimpImage *);
|
||||
|
|
|
@ -2191,7 +2191,8 @@ gimp_image_lower_layer (GimpImage *gimage,
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Layer *
|
||||
gimp_image_raise_layer_to_top (GimpImage *gimage,
|
||||
Layer *layer_arg)
|
||||
|
@ -2359,6 +2360,85 @@ gimp_image_lower_layer_to_bottom (GimpImage *gimage,
|
|||
}
|
||||
|
||||
|
||||
Layer *
|
||||
gimp_image_position_layer (GimpImage *gimage,
|
||||
Layer *layer_arg,
|
||||
gint new_index)
|
||||
{
|
||||
Layer *layer;
|
||||
GSList *list;
|
||||
GSList *next;
|
||||
gint x_min, y_min, x_max, y_max;
|
||||
gint off_x, off_y;
|
||||
gint index;
|
||||
gint list_length;
|
||||
|
||||
list = gimage->layers;
|
||||
list_length = g_slist_length (list);
|
||||
|
||||
next = NULL;
|
||||
layer = NULL;
|
||||
index = 0;
|
||||
|
||||
/* find layer_arg */
|
||||
while (list)
|
||||
{
|
||||
layer = (Layer *) list->data;
|
||||
if (layer == layer_arg)
|
||||
{
|
||||
break;
|
||||
}
|
||||
list = g_slist_next (list);
|
||||
index++;
|
||||
}
|
||||
|
||||
if (layer != layer_arg)
|
||||
{
|
||||
/* The requested layer was not found in the layerstack
|
||||
* Return without changing anything
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (new_index < 0)
|
||||
new_index = 0;
|
||||
|
||||
if (new_index >= list_length)
|
||||
new_index = list_length - 1;
|
||||
|
||||
if (new_index == index)
|
||||
return NULL;
|
||||
|
||||
/* check if we want to move it below a bottom layer without alpha */
|
||||
layer = (Layer *) g_slist_last (list)->data;
|
||||
if (new_index == list_length - 1 &&
|
||||
!layer_has_alpha (layer))
|
||||
{
|
||||
g_message (_("BG has no alpha, layer was placed above"));
|
||||
new_index--;
|
||||
}
|
||||
|
||||
list = g_slist_remove (gimage->layers, layer_arg);
|
||||
gimage->layers = g_slist_insert (list, layer_arg, new_index);
|
||||
|
||||
/* update the affected area (== area of layer_arg) */
|
||||
drawable_offsets (GIMP_DRAWABLE(layer_arg), &off_x, &off_y);
|
||||
x_min = off_x;
|
||||
y_min = off_y;
|
||||
x_max = off_x + drawable_width (GIMP_DRAWABLE (layer_arg));
|
||||
y_max = off_y + drawable_height (GIMP_DRAWABLE (layer_arg));
|
||||
gtk_signal_emit (GTK_OBJECT (gimage),
|
||||
gimp_image_signals[REPAINT],
|
||||
x_min, y_min, x_max, y_max);
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_image_invalidate_preview (gimage);
|
||||
|
||||
gimp_image_dirty (gimage);
|
||||
|
||||
return layer_arg;
|
||||
}
|
||||
|
||||
Layer *
|
||||
gimp_image_merge_visible_layers (GimpImage *gimage,
|
||||
MergeType merge_type)
|
||||
|
|
|
@ -196,6 +196,7 @@ Layer * gimp_image_raise_layer (GimpImage *, Layer *);
|
|||
Layer * gimp_image_lower_layer (GimpImage *, Layer *);
|
||||
Layer * gimp_image_raise_layer_to_top (GimpImage *, Layer *);
|
||||
Layer * gimp_image_lower_layer_to_bottom (GimpImage *, Layer *);
|
||||
Layer * gimp_image_position_layer (GimpImage *, Layer *, gint);
|
||||
Layer * gimp_image_merge_visible_layers (GimpImage *, MergeType);
|
||||
Layer * gimp_image_merge_down (GimpImage *, Layer *, MergeType);
|
||||
Layer * gimp_image_flatten (GimpImage *);
|
||||
|
|
|
@ -2191,7 +2191,8 @@ gimp_image_lower_layer (GimpImage *gimage,
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Layer *
|
||||
gimp_image_raise_layer_to_top (GimpImage *gimage,
|
||||
Layer *layer_arg)
|
||||
|
@ -2359,6 +2360,85 @@ gimp_image_lower_layer_to_bottom (GimpImage *gimage,
|
|||
}
|
||||
|
||||
|
||||
Layer *
|
||||
gimp_image_position_layer (GimpImage *gimage,
|
||||
Layer *layer_arg,
|
||||
gint new_index)
|
||||
{
|
||||
Layer *layer;
|
||||
GSList *list;
|
||||
GSList *next;
|
||||
gint x_min, y_min, x_max, y_max;
|
||||
gint off_x, off_y;
|
||||
gint index;
|
||||
gint list_length;
|
||||
|
||||
list = gimage->layers;
|
||||
list_length = g_slist_length (list);
|
||||
|
||||
next = NULL;
|
||||
layer = NULL;
|
||||
index = 0;
|
||||
|
||||
/* find layer_arg */
|
||||
while (list)
|
||||
{
|
||||
layer = (Layer *) list->data;
|
||||
if (layer == layer_arg)
|
||||
{
|
||||
break;
|
||||
}
|
||||
list = g_slist_next (list);
|
||||
index++;
|
||||
}
|
||||
|
||||
if (layer != layer_arg)
|
||||
{
|
||||
/* The requested layer was not found in the layerstack
|
||||
* Return without changing anything
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (new_index < 0)
|
||||
new_index = 0;
|
||||
|
||||
if (new_index >= list_length)
|
||||
new_index = list_length - 1;
|
||||
|
||||
if (new_index == index)
|
||||
return NULL;
|
||||
|
||||
/* check if we want to move it below a bottom layer without alpha */
|
||||
layer = (Layer *) g_slist_last (list)->data;
|
||||
if (new_index == list_length - 1 &&
|
||||
!layer_has_alpha (layer))
|
||||
{
|
||||
g_message (_("BG has no alpha, layer was placed above"));
|
||||
new_index--;
|
||||
}
|
||||
|
||||
list = g_slist_remove (gimage->layers, layer_arg);
|
||||
gimage->layers = g_slist_insert (list, layer_arg, new_index);
|
||||
|
||||
/* update the affected area (== area of layer_arg) */
|
||||
drawable_offsets (GIMP_DRAWABLE(layer_arg), &off_x, &off_y);
|
||||
x_min = off_x;
|
||||
y_min = off_y;
|
||||
x_max = off_x + drawable_width (GIMP_DRAWABLE (layer_arg));
|
||||
y_max = off_y + drawable_height (GIMP_DRAWABLE (layer_arg));
|
||||
gtk_signal_emit (GTK_OBJECT (gimage),
|
||||
gimp_image_signals[REPAINT],
|
||||
x_min, y_min, x_max, y_max);
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_image_invalidate_preview (gimage);
|
||||
|
||||
gimp_image_dirty (gimage);
|
||||
|
||||
return layer_arg;
|
||||
}
|
||||
|
||||
Layer *
|
||||
gimp_image_merge_visible_layers (GimpImage *gimage,
|
||||
MergeType merge_type)
|
||||
|
|
|
@ -196,6 +196,7 @@ Layer * gimp_image_raise_layer (GimpImage *, Layer *);
|
|||
Layer * gimp_image_lower_layer (GimpImage *, Layer *);
|
||||
Layer * gimp_image_raise_layer_to_top (GimpImage *, Layer *);
|
||||
Layer * gimp_image_lower_layer_to_bottom (GimpImage *, Layer *);
|
||||
Layer * gimp_image_position_layer (GimpImage *, Layer *, gint);
|
||||
Layer * gimp_image_merge_visible_layers (GimpImage *, MergeType);
|
||||
Layer * gimp_image_merge_down (GimpImage *, Layer *, MergeType);
|
||||
Layer * gimp_image_flatten (GimpImage *);
|
||||
|
|
|
@ -15,27 +15,19 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include "appenv.h"
|
||||
#include "drawable.h"
|
||||
#include "desaturate.h"
|
||||
#include "interface.h"
|
||||
#include "paint_funcs.h"
|
||||
#include "gimage.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
void
|
||||
image_desaturate (gimage_ptr)
|
||||
void *gimage_ptr;
|
||||
image_desaturate (GimpImage *gimage)
|
||||
{
|
||||
GImage *gimage;
|
||||
GimpDrawable *drawable;
|
||||
|
||||
gimage = (GImage *) gimage_ptr;
|
||||
drawable = gimage_active_drawable (gimage);
|
||||
|
||||
if (! drawable_color (drawable))
|
||||
|
|
|
@ -18,10 +18,11 @@
|
|||
#ifndef __DESATURATE_H__
|
||||
#define __DESATURATE_H__
|
||||
|
||||
#include "gimpimageF.h"
|
||||
#include "gimpdrawableF.h"
|
||||
|
||||
/* desaturate functions */
|
||||
void image_desaturate (void *);
|
||||
void desaturate (GimpDrawable *);
|
||||
void image_desaturate (GimpImage *gimage);
|
||||
void desaturate (GimpDrawable *drawable);
|
||||
|
||||
#endif /* __DESATURATE_H__ */
|
||||
|
|
|
@ -15,10 +15,6 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include "drawable.h"
|
||||
#include "equalize.h"
|
||||
#include "gimage.h"
|
||||
|
@ -28,14 +24,11 @@
|
|||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
void
|
||||
image_equalize (void *gimage_ptr)
|
||||
image_equalize (GimpImage *gimage)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpDrawable *drawable;
|
||||
|
||||
gimage = (GimpImage *) gimage_ptr;
|
||||
drawable = gimage_active_drawable (gimage);
|
||||
|
||||
if (gimp_drawable_indexed (drawable))
|
||||
|
@ -43,6 +36,7 @@ image_equalize (void *gimage_ptr)
|
|||
g_message (_("Equalize does not operate on indexed drawables."));
|
||||
return;
|
||||
}
|
||||
|
||||
equalize (gimage, drawable, TRUE);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,9 @@
|
|||
#include "gimpdrawableF.h"
|
||||
|
||||
/* equalize functions */
|
||||
void image_equalize (void *);
|
||||
void equalize (GimpImage *, GimpDrawable *, gboolean);
|
||||
void image_equalize (GimpImage *gimage);
|
||||
void equalize (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
gboolean mask_only);
|
||||
|
||||
#endif /* __INVERT_H__ */
|
||||
|
|
|
@ -74,6 +74,7 @@ void gimage_foreach (GFunc func, gpointer user_data);
|
|||
#define gimage_lower_layer gimp_image_lower_layer
|
||||
#define gimage_raise_layer_to_top gimp_image_raise_layer_to_top
|
||||
#define gimage_lower_layer_to_bottom gimp_image_lower_layer_to_bottom
|
||||
#define gimage_position_layer gimp_image_position_layer
|
||||
#define gimage_merge_visible_layers gimp_image_merge_visible_layers
|
||||
#define gimage_flatten gimp_image_flatten
|
||||
#define gimage_merge_layers gimp_image_merge_layers
|
||||
|
|
|
@ -15,27 +15,19 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include "appenv.h"
|
||||
#include "drawable.h"
|
||||
#include "desaturate.h"
|
||||
#include "interface.h"
|
||||
#include "paint_funcs.h"
|
||||
#include "gimage.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
void
|
||||
image_desaturate (gimage_ptr)
|
||||
void *gimage_ptr;
|
||||
image_desaturate (GimpImage *gimage)
|
||||
{
|
||||
GImage *gimage;
|
||||
GimpDrawable *drawable;
|
||||
|
||||
gimage = (GImage *) gimage_ptr;
|
||||
drawable = gimage_active_drawable (gimage);
|
||||
|
||||
if (! drawable_color (drawable))
|
||||
|
|
|
@ -18,10 +18,11 @@
|
|||
#ifndef __DESATURATE_H__
|
||||
#define __DESATURATE_H__
|
||||
|
||||
#include "gimpimageF.h"
|
||||
#include "gimpdrawableF.h"
|
||||
|
||||
/* desaturate functions */
|
||||
void image_desaturate (void *);
|
||||
void desaturate (GimpDrawable *);
|
||||
void image_desaturate (GimpImage *gimage);
|
||||
void desaturate (GimpDrawable *drawable);
|
||||
|
||||
#endif /* __DESATURATE_H__ */
|
||||
|
|
|
@ -15,10 +15,6 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include "drawable.h"
|
||||
#include "equalize.h"
|
||||
#include "gimage.h"
|
||||
|
@ -28,14 +24,11 @@
|
|||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
void
|
||||
image_equalize (void *gimage_ptr)
|
||||
image_equalize (GimpImage *gimage)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpDrawable *drawable;
|
||||
|
||||
gimage = (GimpImage *) gimage_ptr;
|
||||
drawable = gimage_active_drawable (gimage);
|
||||
|
||||
if (gimp_drawable_indexed (drawable))
|
||||
|
@ -43,6 +36,7 @@ image_equalize (void *gimage_ptr)
|
|||
g_message (_("Equalize does not operate on indexed drawables."));
|
||||
return;
|
||||
}
|
||||
|
||||
equalize (gimage, drawable, TRUE);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,9 @@
|
|||
#include "gimpdrawableF.h"
|
||||
|
||||
/* equalize functions */
|
||||
void image_equalize (void *);
|
||||
void equalize (GimpImage *, GimpDrawable *, gboolean);
|
||||
void image_equalize (GimpImage *gimage);
|
||||
void equalize (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
gboolean mask_only);
|
||||
|
||||
#endif /* __INVERT_H__ */
|
||||
|
|
|
@ -2191,7 +2191,8 @@ gimp_image_lower_layer (GimpImage *gimage,
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Layer *
|
||||
gimp_image_raise_layer_to_top (GimpImage *gimage,
|
||||
Layer *layer_arg)
|
||||
|
@ -2359,6 +2360,85 @@ gimp_image_lower_layer_to_bottom (GimpImage *gimage,
|
|||
}
|
||||
|
||||
|
||||
Layer *
|
||||
gimp_image_position_layer (GimpImage *gimage,
|
||||
Layer *layer_arg,
|
||||
gint new_index)
|
||||
{
|
||||
Layer *layer;
|
||||
GSList *list;
|
||||
GSList *next;
|
||||
gint x_min, y_min, x_max, y_max;
|
||||
gint off_x, off_y;
|
||||
gint index;
|
||||
gint list_length;
|
||||
|
||||
list = gimage->layers;
|
||||
list_length = g_slist_length (list);
|
||||
|
||||
next = NULL;
|
||||
layer = NULL;
|
||||
index = 0;
|
||||
|
||||
/* find layer_arg */
|
||||
while (list)
|
||||
{
|
||||
layer = (Layer *) list->data;
|
||||
if (layer == layer_arg)
|
||||
{
|
||||
break;
|
||||
}
|
||||
list = g_slist_next (list);
|
||||
index++;
|
||||
}
|
||||
|
||||
if (layer != layer_arg)
|
||||
{
|
||||
/* The requested layer was not found in the layerstack
|
||||
* Return without changing anything
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (new_index < 0)
|
||||
new_index = 0;
|
||||
|
||||
if (new_index >= list_length)
|
||||
new_index = list_length - 1;
|
||||
|
||||
if (new_index == index)
|
||||
return NULL;
|
||||
|
||||
/* check if we want to move it below a bottom layer without alpha */
|
||||
layer = (Layer *) g_slist_last (list)->data;
|
||||
if (new_index == list_length - 1 &&
|
||||
!layer_has_alpha (layer))
|
||||
{
|
||||
g_message (_("BG has no alpha, layer was placed above"));
|
||||
new_index--;
|
||||
}
|
||||
|
||||
list = g_slist_remove (gimage->layers, layer_arg);
|
||||
gimage->layers = g_slist_insert (list, layer_arg, new_index);
|
||||
|
||||
/* update the affected area (== area of layer_arg) */
|
||||
drawable_offsets (GIMP_DRAWABLE(layer_arg), &off_x, &off_y);
|
||||
x_min = off_x;
|
||||
y_min = off_y;
|
||||
x_max = off_x + drawable_width (GIMP_DRAWABLE (layer_arg));
|
||||
y_max = off_y + drawable_height (GIMP_DRAWABLE (layer_arg));
|
||||
gtk_signal_emit (GTK_OBJECT (gimage),
|
||||
gimp_image_signals[REPAINT],
|
||||
x_min, y_min, x_max, y_max);
|
||||
|
||||
/* invalidate the composite preview */
|
||||
gimp_image_invalidate_preview (gimage);
|
||||
|
||||
gimp_image_dirty (gimage);
|
||||
|
||||
return layer_arg;
|
||||
}
|
||||
|
||||
Layer *
|
||||
gimp_image_merge_visible_layers (GimpImage *gimage,
|
||||
MergeType merge_type)
|
||||
|
|
|
@ -196,6 +196,7 @@ Layer * gimp_image_raise_layer (GimpImage *, Layer *);
|
|||
Layer * gimp_image_lower_layer (GimpImage *, Layer *);
|
||||
Layer * gimp_image_raise_layer_to_top (GimpImage *, Layer *);
|
||||
Layer * gimp_image_lower_layer_to_bottom (GimpImage *, Layer *);
|
||||
Layer * gimp_image_position_layer (GimpImage *, Layer *, gint);
|
||||
Layer * gimp_image_merge_visible_layers (GimpImage *, MergeType);
|
||||
Layer * gimp_image_merge_down (GimpImage *, Layer *, MergeType);
|
||||
Layer * gimp_image_flatten (GimpImage *);
|
||||
|
|
|
@ -15,22 +15,15 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "appenv.h"
|
||||
#include "about_dialog.h"
|
||||
#include "app_procs.h"
|
||||
#include "brightness_contrast.h"
|
||||
#include "gimpbrushlist.h"
|
||||
#include "by_color_select.h"
|
||||
#include "colormaps.h"
|
||||
#include "colormap_dialog.i.h"
|
||||
#include "color_area.h"
|
||||
#include "color_balance.h"
|
||||
#include "commands.h"
|
||||
#include "convert.h"
|
||||
#include "curves.h"
|
||||
#include "desaturate.h"
|
||||
#include "devices.h"
|
||||
#include "channel_ops.h"
|
||||
|
@ -44,23 +37,18 @@
|
|||
#include "gimprc.h"
|
||||
#include "global_edit.h"
|
||||
#include "gradient.h"
|
||||
#include "histogram_tool.h"
|
||||
#include "hue_saturation.h"
|
||||
#include "image_render.h"
|
||||
#include "info_window.h"
|
||||
#include "interface.h"
|
||||
#include "invert.h"
|
||||
#include "lc_dialog.h"
|
||||
#include "layer_select.h"
|
||||
#include "levels.h"
|
||||
#include "module_db.h"
|
||||
#include "palette.h"
|
||||
#include "patterns.h"
|
||||
#include "plug_in.h"
|
||||
#include "posterize.h"
|
||||
#include "resize.h"
|
||||
#include "scale.h"
|
||||
#include "threshold.h"
|
||||
#include "tips_dialog.h"
|
||||
#include "tools.h"
|
||||
#include "undo.h"
|
||||
|
@ -78,7 +66,7 @@ typedef struct
|
|||
} ImageResize;
|
||||
|
||||
/* external functions */
|
||||
extern void layers_dialog_layer_merge_query (GImage *, int);
|
||||
extern void layers_dialog_layer_merge_query (GImage *, gboolean);
|
||||
|
||||
/* local functions */
|
||||
static void image_resize_callback (GtkWidget *, gpointer);
|
||||
|
@ -686,7 +674,7 @@ image_equalize_cmd_callback (GtkWidget *widget,
|
|||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
image_equalize ((void *) gdisp->gimage);
|
||||
image_equalize (gdisp->gimage);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -697,74 +685,74 @@ image_invert_cmd_callback (GtkWidget *widget,
|
|||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
image_invert ((void *) gdisp->gimage);
|
||||
image_invert (gdisp->gimage);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
image_desaturate_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
image_desaturate ((void *) gdisp->gimage);
|
||||
image_desaturate (gdisp->gimage);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
channel_ops_duplicate_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
channel_ops_duplicate ((void *) gdisp->gimage);
|
||||
channel_ops_duplicate (gdisp->gimage);
|
||||
}
|
||||
|
||||
void
|
||||
channel_ops_offset_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
channel_ops_offset ((void *) gdisp->gimage);
|
||||
channel_ops_offset (gdisp->gimage);
|
||||
}
|
||||
|
||||
void
|
||||
image_convert_rgb_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
convert_to_rgb ((void *) gdisp->gimage);
|
||||
convert_to_rgb (gdisp->gimage);
|
||||
}
|
||||
|
||||
void
|
||||
image_convert_grayscale_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
convert_to_grayscale ((void *) gdisp->gimage);
|
||||
convert_to_grayscale (gdisp->gimage);
|
||||
}
|
||||
|
||||
void
|
||||
image_convert_indexed_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
convert_to_indexed ((void *) gdisp->gimage);
|
||||
convert_to_indexed (gdisp->gimage);
|
||||
}
|
||||
|
||||
void
|
||||
image_resize_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
GimpImage * gimage;
|
||||
|
@ -775,7 +763,7 @@ image_resize_cmd_callback (GtkWidget *widget,
|
|||
gimage = gdisp->gimage;
|
||||
|
||||
/* the ImageResize structure */
|
||||
image_resize = (ImageResize *) g_malloc (sizeof (ImageResize));
|
||||
image_resize = g_new (ImageResize, 1);
|
||||
image_resize->gimage = gimage;
|
||||
image_resize->resize = resize_widget_new (ResizeWidget,
|
||||
ResizeImage,
|
||||
|
@ -796,7 +784,7 @@ image_resize_cmd_callback (GtkWidget *widget,
|
|||
|
||||
void
|
||||
image_scale_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
GimpImage * gimage;
|
||||
|
@ -807,7 +795,7 @@ image_scale_cmd_callback (GtkWidget *widget,
|
|||
gimage = gdisp->gimage;
|
||||
|
||||
/* the ImageResize structure */
|
||||
image_scale = (ImageResize *) g_malloc (sizeof (ImageResize));
|
||||
image_scale = g_new (ImageResize, 1);
|
||||
image_scale->gimage = gimage;
|
||||
image_scale->resize = resize_widget_new (ScaleWidget,
|
||||
ResizeImage,
|
||||
|
@ -1102,7 +1090,7 @@ dialogs_indexed_palette_cmd_callback (GtkWidget *widget,
|
|||
{
|
||||
static ColormapDialog * cmap_dlg;
|
||||
|
||||
if(!cmap_dlg)
|
||||
if (!cmap_dlg)
|
||||
{
|
||||
cmap_dlg = colormap_dialog_create (image_context);
|
||||
colormap_dialog_connect_selected (cmap_dlg_sel_cb, NULL, cmap_dlg);
|
||||
|
@ -1169,7 +1157,7 @@ dialogs_module_browser_cmd_callback (GtkWidget *widget,
|
|||
/*********************/
|
||||
|
||||
static void
|
||||
image_resize_callback (GtkWidget *w,
|
||||
image_resize_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
ImageResize * image_resize;
|
||||
|
@ -1191,7 +1179,8 @@ image_resize_callback (GtkWidget *w,
|
|||
}
|
||||
else
|
||||
{
|
||||
g_message (_("Resize Error: Both width and height must be greater than zero."));
|
||||
g_message (_("Resize Error: Both width and height must be "
|
||||
"greater than zero."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1201,7 +1190,7 @@ image_resize_callback (GtkWidget *w,
|
|||
}
|
||||
|
||||
static void
|
||||
image_scale_callback (GtkWidget *w,
|
||||
image_scale_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
ImageResize * image_scale;
|
||||
|
@ -1238,7 +1227,7 @@ image_scale_callback (GtkWidget *w,
|
|||
image_scale->resize->height);
|
||||
flush = TRUE;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
g_message (_("Scale Error: Both width and height must be "
|
||||
"greater than zero."));
|
||||
|
@ -1255,18 +1244,18 @@ image_scale_callback (GtkWidget *w,
|
|||
}
|
||||
|
||||
static gint
|
||||
image_delete_callback (GtkWidget *w,
|
||||
GdkEvent *e,
|
||||
image_delete_callback (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer client_data)
|
||||
{
|
||||
image_cancel_callback (w, client_data);
|
||||
image_cancel_callback (widget, client_data);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
image_cancel_callback (GtkWidget *w,
|
||||
image_cancel_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
ImageResize *image_resize;
|
||||
|
|
|
@ -15,22 +15,15 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "appenv.h"
|
||||
#include "about_dialog.h"
|
||||
#include "app_procs.h"
|
||||
#include "brightness_contrast.h"
|
||||
#include "gimpbrushlist.h"
|
||||
#include "by_color_select.h"
|
||||
#include "colormaps.h"
|
||||
#include "colormap_dialog.i.h"
|
||||
#include "color_area.h"
|
||||
#include "color_balance.h"
|
||||
#include "commands.h"
|
||||
#include "convert.h"
|
||||
#include "curves.h"
|
||||
#include "desaturate.h"
|
||||
#include "devices.h"
|
||||
#include "channel_ops.h"
|
||||
|
@ -44,23 +37,18 @@
|
|||
#include "gimprc.h"
|
||||
#include "global_edit.h"
|
||||
#include "gradient.h"
|
||||
#include "histogram_tool.h"
|
||||
#include "hue_saturation.h"
|
||||
#include "image_render.h"
|
||||
#include "info_window.h"
|
||||
#include "interface.h"
|
||||
#include "invert.h"
|
||||
#include "lc_dialog.h"
|
||||
#include "layer_select.h"
|
||||
#include "levels.h"
|
||||
#include "module_db.h"
|
||||
#include "palette.h"
|
||||
#include "patterns.h"
|
||||
#include "plug_in.h"
|
||||
#include "posterize.h"
|
||||
#include "resize.h"
|
||||
#include "scale.h"
|
||||
#include "threshold.h"
|
||||
#include "tips_dialog.h"
|
||||
#include "tools.h"
|
||||
#include "undo.h"
|
||||
|
@ -78,7 +66,7 @@ typedef struct
|
|||
} ImageResize;
|
||||
|
||||
/* external functions */
|
||||
extern void layers_dialog_layer_merge_query (GImage *, int);
|
||||
extern void layers_dialog_layer_merge_query (GImage *, gboolean);
|
||||
|
||||
/* local functions */
|
||||
static void image_resize_callback (GtkWidget *, gpointer);
|
||||
|
@ -686,7 +674,7 @@ image_equalize_cmd_callback (GtkWidget *widget,
|
|||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
image_equalize ((void *) gdisp->gimage);
|
||||
image_equalize (gdisp->gimage);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -697,74 +685,74 @@ image_invert_cmd_callback (GtkWidget *widget,
|
|||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
image_invert ((void *) gdisp->gimage);
|
||||
image_invert (gdisp->gimage);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
image_desaturate_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
image_desaturate ((void *) gdisp->gimage);
|
||||
image_desaturate (gdisp->gimage);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
void
|
||||
channel_ops_duplicate_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
channel_ops_duplicate ((void *) gdisp->gimage);
|
||||
channel_ops_duplicate (gdisp->gimage);
|
||||
}
|
||||
|
||||
void
|
||||
channel_ops_offset_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
channel_ops_offset ((void *) gdisp->gimage);
|
||||
channel_ops_offset (gdisp->gimage);
|
||||
}
|
||||
|
||||
void
|
||||
image_convert_rgb_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
convert_to_rgb ((void *) gdisp->gimage);
|
||||
convert_to_rgb (gdisp->gimage);
|
||||
}
|
||||
|
||||
void
|
||||
image_convert_grayscale_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
convert_to_grayscale ((void *) gdisp->gimage);
|
||||
convert_to_grayscale (gdisp->gimage);
|
||||
}
|
||||
|
||||
void
|
||||
image_convert_indexed_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
convert_to_indexed ((void *) gdisp->gimage);
|
||||
convert_to_indexed (gdisp->gimage);
|
||||
}
|
||||
|
||||
void
|
||||
image_resize_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
GimpImage * gimage;
|
||||
|
@ -775,7 +763,7 @@ image_resize_cmd_callback (GtkWidget *widget,
|
|||
gimage = gdisp->gimage;
|
||||
|
||||
/* the ImageResize structure */
|
||||
image_resize = (ImageResize *) g_malloc (sizeof (ImageResize));
|
||||
image_resize = g_new (ImageResize, 1);
|
||||
image_resize->gimage = gimage;
|
||||
image_resize->resize = resize_widget_new (ResizeWidget,
|
||||
ResizeImage,
|
||||
|
@ -796,7 +784,7 @@ image_resize_cmd_callback (GtkWidget *widget,
|
|||
|
||||
void
|
||||
image_scale_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
GimpImage * gimage;
|
||||
|
@ -807,7 +795,7 @@ image_scale_cmd_callback (GtkWidget *widget,
|
|||
gimage = gdisp->gimage;
|
||||
|
||||
/* the ImageResize structure */
|
||||
image_scale = (ImageResize *) g_malloc (sizeof (ImageResize));
|
||||
image_scale = g_new (ImageResize, 1);
|
||||
image_scale->gimage = gimage;
|
||||
image_scale->resize = resize_widget_new (ScaleWidget,
|
||||
ResizeImage,
|
||||
|
@ -1102,7 +1090,7 @@ dialogs_indexed_palette_cmd_callback (GtkWidget *widget,
|
|||
{
|
||||
static ColormapDialog * cmap_dlg;
|
||||
|
||||
if(!cmap_dlg)
|
||||
if (!cmap_dlg)
|
||||
{
|
||||
cmap_dlg = colormap_dialog_create (image_context);
|
||||
colormap_dialog_connect_selected (cmap_dlg_sel_cb, NULL, cmap_dlg);
|
||||
|
@ -1169,7 +1157,7 @@ dialogs_module_browser_cmd_callback (GtkWidget *widget,
|
|||
/*********************/
|
||||
|
||||
static void
|
||||
image_resize_callback (GtkWidget *w,
|
||||
image_resize_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
ImageResize * image_resize;
|
||||
|
@ -1191,7 +1179,8 @@ image_resize_callback (GtkWidget *w,
|
|||
}
|
||||
else
|
||||
{
|
||||
g_message (_("Resize Error: Both width and height must be greater than zero."));
|
||||
g_message (_("Resize Error: Both width and height must be "
|
||||
"greater than zero."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1201,7 +1190,7 @@ image_resize_callback (GtkWidget *w,
|
|||
}
|
||||
|
||||
static void
|
||||
image_scale_callback (GtkWidget *w,
|
||||
image_scale_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
ImageResize * image_scale;
|
||||
|
@ -1238,7 +1227,7 @@ image_scale_callback (GtkWidget *w,
|
|||
image_scale->resize->height);
|
||||
flush = TRUE;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
g_message (_("Scale Error: Both width and height must be "
|
||||
"greater than zero."));
|
||||
|
@ -1255,18 +1244,18 @@ image_scale_callback (GtkWidget *w,
|
|||
}
|
||||
|
||||
static gint
|
||||
image_delete_callback (GtkWidget *w,
|
||||
GdkEvent *e,
|
||||
image_delete_callback (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer client_data)
|
||||
{
|
||||
image_cancel_callback (w, client_data);
|
||||
image_cancel_callback (widget, client_data);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
image_cancel_callback (GtkWidget *w,
|
||||
image_cancel_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
ImageResize *image_resize;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue